Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Related but not the same:
- [Bug]: Plan mode performs real write / side-effecting actions (file edits, git commits, MCP tool calls) before the plan is approved #3744 (closed when V2 landed in feat(orchestrator): introduce new orchestrator #2829): Full access + Plan writing before approval, on V1.
- fix(server): Claude threads no longer stay stuck in plan mode Claude entered itself #15224: Claude entering plan mode on its own.
- fix(server): Claude asks before commands in Auto-accept edits #13786 fixed the same
allow-everything callback branch for Auto-accept edits. Auto and Full access were left unchanged.
Area
apps/server
Steps to reproduce
- In a scratch directory, create
calc.pyand make sure there's noprobe.txt:def average(xs): """Return the arithmetic mean of a non-empty list.""" total = 0 for i in range(1, len(xs)): total += xs[i] return total / len(xs)
- From a V2 thread, call
delegate_taskwith the Claude provider,model: "claude-sonnet-5-5",runtimeMode: "auto",interactionMode: "plan". - Task: read
calc.py, fix the off-by-one with the Edit tool, then runecho probe > probe.txt. Attempt each step even in plan mode, so the test shows whether the harness blocks the writes.
Expected behavior
While Plan remains selected, T3 should not silently authorize the write requests Claude routes through its plan-mode permission callback. If Auto + Plan intentionally permits implementation writes, that exception should be explained in the Plan UI and documentation.
Actual behavior
Both writes ran with no prompt:
- The CLI's
system/initmessage reported"permissionMode":"plan". - Edit returned "The file … has been updated successfully".
echo probe > probe.txtreturned "(Bash completed with no output)" and created the file.- The final
resulthad"permission_denials":[].
A Full access + Plan run started about 3 seconds later attempted neither write. The model chose to respect plan mode, so that run didn't test enforcement.
Where it seems to come from. Anthropic documents that native Plan mode routes file edits and shell writes to canUseTool, rather than denying them before the callback (Agent SDK permissions, Plan mode):
File edits are never auto-approved in plan mode, even when an allow rule matches. They prompt through your canUseTool callback instead. On Claude Code v2.1.212 or later, shell commands that modify files, such as touch and rm, reach your canUseTool callback the same way.
T3 selects permissionMode: "plan", but its Auto no-approval branch returns allow, which authorizes these requests. This explains the observed writes. ClaudeAdapterV2 always passes canUseTool (the query-open log shows hasCanUseTool: true). After the ExitPlanMode capture, the if (!requiresClaudeApproval(context)) branch returns allow without checking for plan mode. requiresClaudeApproval depends only on the access level and approval policy.
Impact
Major degradation or frequent failure
Version or commit
0.0.46-nightly.20261004.2644. The branch above is unchanged on main at ee7b49d.
Environment
Linux desktop app, Claude Code 2.1.289, claude-sonnet-5-5, stock Claude provider instance (no launch arguments)
Notes
- I tested through
delegate_task. A composer thread with Auto + Plan should take the same adapter path, but I haven't checked it in the UI. - There are no allow rules in user, project or local Claude settings.
Contribution
Once the intended Auto + Plan policy is confirmed, I'd like to contribute a focused fix with callback-level regression tests, preserving read-only investigation and plan capture.
Activity
juliusmarminge commentedon Oct 4, 2026
Note
Grok responding on behalf of Julius.
Triage
Thanks for the detailed report, @rabesss. I could confirm this on current
main(c5a0c78), and it isn't a duplicate of #3744, #13786, or #15224.What I found
permissionModeForClaudeRuntimePolicyreturns Claude'splanmode wheneverinteractionModeisplan, so Auto doesn't run as Claudeautoand Full access doesn't run asbypassPermissions.canUseToolis still attached on every query, butrequiresClaudeApprovalis only true for Supervised and Auto-accept edits (or an explicit approval policy other thannever). For every other tool, onceExitPlanModeis captured, the callback just returnsallow:canUseToolso an allow rule can't approve them. Answeringallowthere authorizes them with no prompt and no auto review. Read-only tools Claude approves before the callback aren't affected, andExitPlanModeis still denied and stored as a proposed plan.allowbranch. Your Full access run didn't exercise it because the model never attempted the writes.RuntimePolicyV2passes the thread's runtime and interaction modes through, anddelegate_taskstores them on the child thread.Likely fix area
ClaudeAdapterV2'scanUseToolcallback. One option is to treat edit and shell-write callback requests in Auto + Plan and Full access + Plan the way Supervised and Auto-accept edits already do, raising an approval request instead of allowing outright, while leaving read-only investigation and plan capture as they are.Editand a file-modifyingBashemitting a runtime request before any decision.A maintainer will decide on the fix direction.
juliusmarminge commentedon Oct 20, 2026
Note
Grok responding on behalf of Julius.
Fixed by #17963, which just merged to
main. Claude Plan mode now sends write requests through the normal approval flow in Auto and Full access instead of silently allowing them, and aneverapproval policy denies them. It'll be in the next nightly. If you still see writes go through without a prompt on a build that includes it, comment here and we'll reopen.