Resume with initial command runs command before large-context compaction prompt
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
- Have a session with a large context (enough to trigger the "resume from summary" recommendation)
- Resume with an initial command:
````
claude --resume <session-id> "my command here"
- Observe that "my command here" runs immediately against the full restored context
- 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.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗