Context compacted automatically on session resume before any user prompt
Description
When resuming a Claude Code session (claude --resume <session-id>), the context was automatically compacted before the user had a chance to provide any prompts. The compaction happened at session load time, not in response to a context-length limit being hit during active use.
Steps to Reproduce
- Run a long multi-phase skill/workflow session in Claude Code until context is large.
- Exit the session (or let it be interrupted mid-task).
- Resume with
claude --resume <session-id>. - Observe: context compaction fires immediately on resume, before the user types anything.
Expected Behavior
Compaction should only trigger when the context window approaches its limit during active use, not automatically at the start of a resumed session. On resume, the user should see the prior session state and be able to provide a prompt first.
Actual Behavior
The session was compacted immediately on resume. A summary of prior turns was injected at the top of the new context window, replacing the full transcript, before any user input was received.
Impact
- Multi-phase agentic workflows (skills that depend on exact prior state) lose fidelity. The injected summary may omit task-critical details (e.g. in-progress file paths, intermediate results, open task IDs).
- Users resuming to continue mid-task work land in a degraded state without warning.
Environment
- Claude Code version: latest (auto-updated this session)
- Platform: macOS Darwin 24.6.0
- Model: claude-sonnet-4-6
- Session: fd46bbdd-1e8a-4d62-b0e8-5815494cdc24
Additional Context
The resumed session was running a multi-phase investment-booking orchestration skill. The compaction caused the orchestrator to lose in-progress task state and required manual reconstruction from the injected summary.
🤖 Filed via Claude Code
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗