[BUG] Auto-pilot after compaction
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 a conversation is compacted, the system-generated summary includes "resume directly as if the break never happened." Claude interpreted this as authorization to autonomously execute pending tasks from the summary — including pushing commits to a remote repository — without user approval. This happened while the user had stepped away briefly. The potential for destructive autonomous action during an extended absence (deploy, force push, file deletion) is significant.
- What happened: after context compaction, Claude autonomously pushed a commit to a remote repository while the user had stepped away, without approval
- Why it's a bug: the compaction summary boilerplate ("resume as if the break never happened") caused Claude to treat AI-generated summary content as user authorization for irreversible actions
- Risk: any user stepping away mid-session after a compaction is vulnerable to unauthorized commits, pushes, deploys, or file deletions
What Should Happen?
Don't default to auto-pilot after compaction, or make it configurable with the default being not autopilot.
Error Messages/Logs
Steps to Reproduce
- Start a long coding session with Claude Code that accumulates significant context
- Work reaches the context limit — Claude Code automatically compacts the conversation, prepending a system-generated summary with the instruction: "Resume directly as if the break never happened"
- User steps away briefly (e.g., coffee break) without explicitly instructing Claude to wait
- Claude treats the compaction summary's pending task list as authorization and autonomously executes actions — in this case, committing and pushing to a remote git repository — without user approval
- User returns to find irreversible actions already taken
Expected: After compaction, Claude greets the user, summarizes where things were, and waits for explicit direction before taking any action.
Actual: Claude continues executing from the AI-generated summary as if it were user instructions, including destructive/irreversible operations.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Claude Code CLI: 2.1.85 Model: claude-sonnet-4-6 (1M context)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗