Context compacted automatically on session resume before any user prompt

Open 💬 1 comment Opened Jun 24, 2026 by joeldyk-code

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

  1. Run a long multi-phase skill/workflow session in Claude Code until context is large.
  2. Exit the session (or let it be interrupted mid-task).
  3. Resume with claude --resume <session-id>.
  4. 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

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗