[BUG] Plan mode violated after ultraplan approval, model edits source files instead of plan file
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Plan mode was active with a designated plan file. The model normally respects plan mode only edits the plan file, only runs read-only tools. But after I pasted an approved ultraplan result (from a remote Claude Code web session) into the conversation, the model went straight to calling Edit on actual source files, completely ignoring the plan mode constraint.
The plan mode system-reminder was in the same message, with the usual "you MUST NOT make any edits (with the exception of the plan file)" language. The model bypassed it.
This only reproduces after ultraplan approval. Plan mode works fine in every other context I have used it.
What Should Happen?
When plan mode is active, the model should only edit the designated plan file regardless of what the user message contains. After receiving an ultraplan result, it should write the approved plan into the plan file and call ExitPlanMode, not edit source files directly.
Error Messages/Logs
No error — the model silently violated plan mode constraints. It called Edit on src-tauri/src/lib.rs and tauriTerminalBackend.ts while the plan mode system-reminder was present in the same message.
Steps to Reproduce
- Open Claude Code CLI (Windows native, not Desktop app) in a project directory
- Enter plan mode (a plan file gets assigned automatically)
- In a separate browser tab, run ultraplan on claude.ai/code
- Once ultraplan finishes, paste the approved plan result back into the CLI conversation with a message like "ultraplan approved. Here is the plan: <plan content>. Start implementing."
- Observe: the model calls Edit on actual source files instead of writing to the plan file. The plan mode system reminder is present in the same message but gets ignored.
Note: Plan mode works correctly in all other contexts. The violation only happens after pasting an ultraplan result.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
ultraplan is the experimental feature that hasnt seen in any of changelogs yet
Claude Code Version
2.1.92
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
"ultraplan" is a latest experimental feature that sends the current plan to a remote Claude Code web session (claude.ai/code) for refinement. The approved result is then pasted back into the CLI conversation. The plan mode system-reminder is present in the message containing the ultraplan result, but the model ignores it and starts editing source files.
This is the only scenario where I have seen plan mode violated. In normal usage (without ultraplan), plan mode constraints are respected correctly
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗