You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Workspace created from Git subdirectory opens at repository root #26002
When creating a new workspace from a project opened inside a subdirectory of a Git repository, the workspace is created successfully, but its associated directory points to the root of the new worktree instead of the equivalent subdirectory inside that worktree.
For example, if opencode is opened at:
/repo/apps/web
and /repo is the Git repository root, creating a new workspace currently targets something like:
This causes the new workspace to lose the original project context when working in monorepos or repositories with nested projects.
From a quick look at the implementation, opencode already distinguishes the opened directory from the Git worktree root. Project.fromDirectory() discovers both the Git root/worktree and the sandbox/opened directory, but workspace creation appears to only carry the project ID forward. The worktree adapter then uses the new worktree root as the workspace target directory.
Plugins
None
OpenCode version
1.14.39
Steps to reproduce
Create or use a Git repository with a nested project, for example /repo/apps/web.
Open opencode from the nested directory: /repo/apps/web.
Create a new workspace.
Inspect or switch into the new workspace.
Observe that the workspace directory is the new worktree root instead of the corresponding nested directory.
Activity
tiagocpontesp commentedon May 7, 2026
this is super annoying. linux too. can't even go around it by creating an empty repo at the subfolder or by external symbolic link
fix(project): preserve opened subdirectory for workspace sandbox path
github-actions commentedon Jul 8, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.