{"version":"2.1.333","anchor":"exitworktree-refused-for-an-agent-under-a-run-limit","canonical_anchor":"session-and-worktree-tools-refused-when-an-agent-is-working","heading":"Worktree tools refuse for agents in a comment or Slack thread, or under a run limit","tier":"notice","area":"Worktrees","scope":"individual","heads_up":true,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.333\/e\/exitworktree-refused-for-an-agent-under-a-run-limit","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.333","markdown":"### Worktree tools refuse for agents in a comment or Slack thread, or under a run limit\n\nEnterWorktree, ExitWorktree and related tools now refuse for agents working from a comment or Slack thread, and ExitWorktree refuses for agents under a run limit\n\n**Unclear.** It is not clear what kind of limit on the agent triggers this refusal.\n\n**What**\n\nA 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:\n\n- 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`.\n\n- Agents under a run limit: `ExitWorktree` now stops before doing anything when a check on the calling agent returns a reason to refuse.\n\n- 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.\n\n**Why**\n\nIn 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.\n\n- Area: Worktrees\n- Names: `ExitWorktree`\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 3\/5\n- Scope: individual\n- Heads-up: yes"}