Permission mode resets from bypass to acceptEdits during long-running --dangerously-skip-permissions sessions
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?
Sessions launched with --dangerously-skip-permissions spontaneously switch to acceptEdits mode after running for several hours. The permission mode silently downgrades, causing tool calls (Bash, Write, Edit) to prompt for approval in the terminal.
This is especially disruptive for channel-based sessions (e.g., Telegram bot relay, remote agents) where the user is not watching the terminal and cannot approve prompts. The session effectively hangs until someone notices and manually intervenes.
Steps to Reproduce
- Launch Claude Code with
--dangerously-skip-permissions - Operate normally for several hours (the session must be long-running, not fresh)
- At some variable point (2-6 hours in), observe that tool calls begin prompting for permission approval
- Check the mode selector: it has silently changed from "Bypass permissions" to "Edit automatically" (
acceptEdits)
The trigger is not deterministic. Suspected causes:
- Context compaction (the internal summarization that occurs when context window fills up)
- Channel events (incoming messages via MCP relay tools like Telegram)
- Some internal state serialization/deserialization that drops the permission mode
What Should Happen?
The permission mode should remain on bypassPermissions for the entire session lifetime when launched with --dangerously-skip-permissions. The flag represents an explicit, informed user choice that should persist unconditionally.
Workaround
- Shift+Tab in terminal to cycle back to bypass mode (requires someone watching the terminal)
- Setting
"defaultMode": "bypassPermissions"in.claude/settings.local.jsoncauses the mode to reset to bypass instead of acceptEdits, but the reset itself still occurs and still interrupts unattended execution
Difference from Existing Issues
This is related to but distinct from:
- #39057 - Describes intermittent mid-session resets (not specifically long-running or CLI flag)
- #40852 - Edit tool prompting despite the flag (immediate, not time-delayed)
- #37903 - Similar symptom on Linux, but not specifically about time-based degradation
- #37420 - PreToolUse hook returning "ask" causes reset (different root cause)
The unique aspect here is: the degradation is time-based and occurs in long-running sessions, making it specifically destructive for autonomous/channel-based workflows where no human monitors the terminal. The other issues describe resets triggered by specific actions (protected directory prompts, hook returns). This one appears to happen passively over time.
Impact
High for autonomous/remote workflows. When Claude Code is operated via a channel relay (Telegram, Slack, etc.), the user sends messages through the channel and never sees the terminal. A silent permission mode downgrade causes the session to hang indefinitely with no feedback to the user. The session appears "dead" from the channel side.
Error Messages/Logs
No error messages. The mode change is silent. The only symptom is that tool calls begin showing permission prompts in the terminal.
Claude Model
Opus 4.6 (1M context)
Is this a regression?
Unclear. Long-running --dangerously-skip-permissions sessions are a relatively recent workflow pattern.
Claude Code Version
v2.1.84 (also observed on v2.1.81+)
Platform
Anthropic API
Operating System
macOS (Darwin 24.6.0)
Terminal/Shell
zsh
Additional Information
First observed Mar 30, 2026. Reproduced multiple times across different long-running sessions. The pattern is consistent: fresh session starts fine in bypass mode, then degrades after hours of operation.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗