Auto-compact not triggering on resumed sessions with Opus 4.6 (1M context)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Description
Auto-compact never triggered during an extended heavy-usage session on Opus 4.6 (1M context). The conversation was resumed from a prior session that ran out of context — the resume injected a large summary at the top of the conversation. After resuming, auto-compact never triggered again despite hours of intensive work.
Environment
Model: Opus 4.6 (1M context)
Platform: Windows 11
Claude Code version: latest
Expected Behavior
Auto-compact should trigger as context approaches the 1M window limit, compressing prior messages to reduce per-message token cost. The system prompt even states: "The system will automatically compress prior messages in your conversation as it approaches context limits."
Actual Behavior
After resuming a compacted session, auto-compact never triggered. The context grew unchecked, and every message sent the full conversation history (500K+ tokens) back to the API. Combined with 8 agent spawns (~580K tokens total in agent calls alone), the entire usage allocation was consumed in approximately 1 hour.
Impact
Full usage allocation consumed in ~1 hour of work
Normal heavy sessions last 4-8+ hours before hitting limits
The resumed session appears to have blocked the auto-compaction mechanism
Hypothesis
The session resume mechanism may interfere with auto-compact tracking. The compaction system may not correctly track context size or compaction thresholds when a conversation is continued from a prior compacted session via the summary injection pattern.
What Should Happen?
claude code resume should not block auto-compact
Error Messages/Logs
Steps to Reproduce
Start a conversation with heavy tool usage (MCP server development, multiple agent spawns, large file reads/writes)
Session runs out of context and compacts / provides a summary for continuation
Resume the session ("continue from where we left off")
Continue heavy work — building an MCP server with 121 tools, spawning 8+ research agents, dozens of build/deploy/test cycles
Auto-compact never triggers again after the resume
Entire usage allocation drains in ~1 hour due to massive per-message token cost
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.80 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 12 comments on GitHub. Read the full discussion on GitHub ↗