Resume with initial command runs command before large-context compaction prompt

Resolved 💬 3 comments Opened Apr 1, 2026 by flxmrk Closed May 9, 2026

Description

When resuming a large session with an initial command, the command executes before the compaction/summary prompt appears, wasting tokens even if the user chooses to compact.

Steps to Reproduce

  1. Have a session with a large context (enough to trigger the "resume from summary" recommendation)
  2. Resume with an initial command:

``
claude --resume <session-id> "my command here"
``

  1. Observe that "my command here" runs immediately against the full restored context
  2. Then the prompt appears recommending to resume from a summary instead

Expected Behavior

The large-context detection and compaction prompt should appear before the initial command is executed, so the user can choose to compact first and avoid wasting tokens on the full context.

Actual Behavior

The initial command runs against the full (large) restored context, consuming tokens. The compaction prompt appears afterward — by which point the tokens are already spent, making the compaction option less useful.

Impact

Users who script or habitually use --resume <id> "command" to continue work lose the benefit of the compaction feature, since the expensive operation has already occurred by the time they are offered the choice.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗