EnterWorktree blocked in agent-view sessions makes worktree.root config unreachable from the primary multi-task UI
Summary
The agent view is the natural UI for running multiple tasks in parallel. Git worktrees are the natural isolation mechanism for those tasks. But agent-view sessions are always background sessions, and background sessions block EnterWorktree — making the two features mutually exclusive.
Environment
- macOS 25.5.0
- Claude Code (current version)
- Project has
.claude/settings.jsonwithworktree.rootandsymlinkDirectoriesconfigured
Repro
- Open a task from the agent view (creates a background session)
- Ask the agent to work on a branch in isolation using a worktree
- Agent cannot call
EnterWorktree— it is listed as a deferred tool but the background session system prompt explicitly says "Do not call EnterWorktree" - Falling back to manual
git worktree addbypasses theworktree.rootandsymlinkDirectoriesfromsettings.jsonentirely
Why this matters
- Agent view → always background session (by design)
- Background session →
EnterWorktreeblocked (by design) EnterWorktree→ the only path that readsworktree.root+ sets upsymlinkDirectories
The result: worktree.root and symlinkDirectories in settings.json are effectively dead config for anyone using the agent view. The two features that are most natural together (multi-agent tasks + worktree isolation) cannot be combined.
Note: bgIsolation: "none" is already set in this project, so there is no double-worktree risk that the restriction would be guarding against.
Expected behaviour
EnterWorktree should be available in agent-view background sessions, or the background session should at least respect worktree.root when the agent falls back to git worktree add manually.