EnterWorktree blocked in agent-view sessions makes worktree.root config unreachable from the primary multi-task UI

Open 💬 0 comments Opened May 27, 2026 by patrickradius

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.json with worktree.root and symlinkDirectories configured

Repro

  1. Open a task from the agent view (creates a background session)
  2. Ask the agent to work on a branch in isolation using a worktree
  3. Agent cannot call EnterWorktree — it is listed as a deferred tool but the background session system prompt explicitly says "Do not call EnterWorktree"
  4. Falling back to manual git worktree add bypasses the worktree.root and symlinkDirectories from settings.json entirely

Why this matters

  • Agent view → always background session (by design)
  • Background session → EnterWorktree blocked (by design)
  • EnterWorktree → the only path that reads worktree.root + sets up symlinkDirectories

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.

View original on GitHub ↗