[Bug] EnterWorktree fails when agent has cwd override in isolated mode

Status Closed — not planned
Reported on v2.1.152
Maintainer reply None cached
Activity 2 comments · opened May 27, 2026 · closed Jul 31, 2026

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

[]

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗