[BUG] Programmatic EnterPlanMode call crashes session with "Auto mode is unavailable for your plan" — no graceful fallback
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?
When Claude programmatically calls EnterPlanMode during a session running in "Ask permissions" mode, the session bricks with the error "Auto mode is unavailable for your plan." There is no graceful fallback — the session is completely unresponsive and must be abandoned, losing all context.
Expected behavior: Either (a) EnterPlanMode should work the same way as manually selecting Plan mode from the dropdown (which works fine), or (b) it should fail gracefully with an error message and let the session continue normally.
Current behavior: The session hangs permanently. The only option is to start a new session.
Environment: Claude Code desktop app, macOS, Claude Opus 4.6, version 2.1.87.
What Should Happen?
When EnterPlanMode is called programmatically on a plan that doesn't support auto mode, it should either:
- Work identically to manually selecting "Plan mode" from the permission dropdown (which functions correctly), or
- Fail gracefully — return an error to the model explaining the limitation, allow the session to continue normally, and let Claude propose its plan in a regular message instead
The session should never become permanently unresponsive from a tool call failure.
Error Messages/Logs
Steps to Reproduce
- Use a plan that does not include "auto mode" (auto-accept permissions)
- Start a session in "Ask permissions" mode
- Have Claude call the
EnterPlanModetool programmatically during the session - Session becomes unresponsive — no recovery possible, must abandon and start fresh
Note: Plan mode works perfectly when selected manually from the permission mode dropdown in the UI. The issue is only when the EnterPlanMode tool is invoked programmatically by the model mid-session.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.87
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗