[Bug] EnterWorktree fails when agent has cwd override in isolated mode
Open 💬 1 comment Opened May 27, 2026 by leourbina
Bug Description
When using claude agents --cwd ., some times (like in this session) the agent is unable to edit files, and all the attempts error out. It starts when it tries to create a worktree and gets the error:
⏺ Creating worktree(issue-553-admin-logout-redirect)
⎿ Error: EnterWorktree cannot be called from a subagent with a cwd override (isolation:
"worktree" or explicit cwd) — it would mutate the parent session's process-wide working
directory. This agent is already isolated in its own working copy.
Environment Info
- Platform: darwin
- Terminal: xterm-256color
- Version: 2.1.152
- Feedback ID: 5fd0bd19-2a4b-42fc-a54e-08257af1a1ee
Errors
[]This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗