Worktree tools refuse for agents in a comment or Slack thread, or under a run limit
EnterWorktree, ExitWorktree and related tools now refuse for agents working from a comment or Slack thread, and ExitWorktree refuses for agents under a run limit
You'll noticeTier: how much it should matter to you
2Useful: my rating, 1 to 5
3Signal: worth watching, 1 to 5
WorktreesArea: what it touches
ImprovementsKind: in v2.1.333,
ImprovementsSection of the release
Unclear Whether this refusal is on when the server sends no value is not known.
What
A worktree is a separate working copy of a git repository that Claude Code can switch into. EnterWorktree and ExitWorktree are the tools Claude uses to enter and leave one. Some agents are now refused:
Agents working from a comment or a Slack thread: EnterWorktree, ExitWorktree and related session tools now refuse. The refusal says the call would move the person's whole session. This is controlled by the flag bot_protected_tengu_squishy_pebble.
Agents under a run limit: ExitWorktree now stops before doing anything when a check on the calling agent returns a reason to refuse.
File errors: a separate check, which reads a flag or a setting, adds a note to file errors when the session's working directory (the folder it is working in) has moved.
Why
In practice, an agent acting from a comment or Slack thread, or one running under a limit, can no longer switch the session into or out of a worktree. That avoids moving a person's whole session out from under them. If a file error mentions that the working directory moved, that note comes from this change.