Feature request: global default worktree isolation for spawned agents

Resolved 💬 1 comment Opened Apr 5, 2026 by jkgeorge89 Closed May 27, 2026

Problem

When spawning multiple agents via the Agent tool, each call requires manually specifying isolation: "worktree". If you forget on even one agent, it edits the main working tree directly. Combined with branch switches or stashes, this can lose hours of agent work.

Current workaround

  • Add isolation: worktree to each custom agent definition in .claude/agents/ frontmatter (only covers named agents, not ad-hoc)
  • Add a CLAUDE.md rule instructing Claude to always pass isolation: "worktree" (depends on model compliance)

Requested feature

A settings.json option like:

{
  "defaultAgentIsolation": "worktree"
}

This would make all spawned agents (both custom and ad-hoc) use worktree isolation by default, without needing to specify it on every Agent tool call. Individual calls could still override with isolation: "none" if needed.

Why this matters

In complex multi-agent workflows (e.g., migrating 4+ packages in parallel), forgetting isolation: "worktree" on a single agent can cause data loss when the main branch is switched. A global default eliminates this class of error entirely.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗