[FEATURE] EnterWorktree should support targeting a different repo than the session root
Problem
When working in a multi-repo workspace (e.g., a context repo that manages several independent git repos via a workspace CLI), EnterWorktree only creates a worktree of the repo rooted at the session's starting directory. There's no way to create a worktree in a sub-repo.
Example
~/my-workspace/ ← session starts here (context repo)
├── .git/
├── CLAUDE.md
├── repo-a/ ← independent git repo
│ └── .git/
├── repo-b/ ← independent git repo
│ └── .git/
If I want to make isolated changes in repo-a, I can't use EnterWorktree because it targets ~/my-workspace/ (the context repo), which doesn't contain repo-a's code in its git tree. The sub-repos are separate git repos, not submodules.
Proposed Solution
Add an optional path parameter to EnterWorktree that specifies which git repo to create the worktree in:
EnterWorktree(name="my-feature", path="repo-a")
This would create a worktree of repo-a/.git rather than the session root's .git.
Workaround
Currently the only options are:
- Create a branch directly in the sub-repo (no isolation)
- Start a separate Claude Code session from within the sub-repo
Neither is ideal when the session context (CLAUDE.md, memory, etc.) is in the parent workspace.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗