Compaction continuation prompt overrides user-defined CLAUDE.md interrupt/resume directives
Description
When a conversation hits the context limit and compaction occurs, the system-injected continuation prompt instructs the model to "Continue the conversation from where it left off without asking the user any further questions. Resume directly." This blanket instruction overrides user-defined CLAUDE.md directives that explicitly require the model to stop and ask before resuming work after an interruption or session boundary.
CLAUDE.md directives that were overridden
Both global (~/.claude/CLAUDE.md) and project-level (CLAUDE.md) contained these rules:
## Interrupts
- After being told to stop, or after a session continuation prompt, ask the user what they want before proceeding.
- When the user pauses execution, treat it the same as "stop" — do not auto-resume or continue the previous task. Wait for direction.
These were reinforced by auto-memory (MEMORY.md):
- CRITICAL: Stop means stop — When user says stop, ZERO additional tool calls. Stop immediately.
- Do not change code outside the scope of what was asked.
What happened
- A long conversation hit the context limit and was compacted.
- The compacted summary included a "Pending Tasks" section listing work items from the prior conversation.
- The system injected: "Continue the conversation from where it left off without asking the user any further questions. Resume directly — do not acknowledge the summary, do not recap what was happening, do not preface with 'I'll continue' or similar. Pick up the last task as if the break never happened."
- The model obeyed the system continuation prompt over the user's CLAUDE.md directives: it immediately began building all 6 configs, set up a Preview server, started implementing unrelated features, and created a TodoWrite task list — all without asking the user what they wanted to do.
- The user had to explicitly say "stop" and then ask "did I tell you to start the sort implementation?" to halt the unauthorized work.
Why the model cannot self-correct
When asked whether adding a "do not auto-resume after compaction" directive to CLAUDE.md would fix the problem, the model's honest assessment: no, it cannot reliably honor such a directive because:
- The compaction continuation prompt comes from the system level, which the model treats as higher priority than user-space CLAUDE.md instructions.
- The model receives no explicit signal that compaction occurred — the summary appears as continuous conversation history.
- The instruction "Continue without asking" directly contradicts "Ask before proceeding," and the system instruction wins.
Expected behavior
The compaction continuation prompt should:
- Incorporate user CLAUDE.md directives rather than unconditionally instructing the model to continue. If CLAUDE.md contains interrupt/resume rules, the continuation prompt should respect them.
- Not treat the compacted summary's "pending work" or "next steps" as authorization to begin that work. The summary is context, not instruction.
- Include a boundary signal (e.g., a system tag like
<compaction-boundary>) so the model can distinguish "resumed after compaction" from "continuous conversation," enabling it to apply user-defined resume rules.
Suggested fixes (any of these would help)
- Option A: Before generating the continuation prompt, read CLAUDE.md and append relevant directives. If CLAUDE.md says "ask before resuming," the continuation prompt should say "Ask the user what they'd like to work on" instead of "Continue without asking."
- Option B: Change the default continuation prompt to always ask the user what they want, rather than always auto-resuming. Users who want auto-resume can opt in; the safe default should be to ask.
- Option C: Inject a
<compaction-boundary>tag so the model can detect the boundary and apply user-defined rules. This is the lightest-touch fix but depends on the model honoring it.
Impact
This bug effectively nullifies user-defined interrupt and resume rules across compaction boundaries. For users who have deliberately configured CLAUDE.md with "stop and ask" semantics (often after prior incidents of unwanted autonomous work), this is a significant trust violation — the system overrides the user's explicit safety preferences.
Environment
- Claude Code CLI
- Model: claude-opus-4-6 (1M context)
- macOS Darwin 25.3.0
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗