autoCompactEnabled: true does not trigger auto-compaction when context reaches 100%
Description
autoCompactEnabled: true is set in ~/.claude/settings.json but auto-compaction never triggers automatically. The context fills to 100% and Claude Code stops accepting input without ever compacting. This happens consistently across multiple sessions.
Steps to Reproduce
- Set
autoCompactEnabled: truein~/.claude/settings.json - Run a long Claude Code session with many tool calls (git diffs, bash output, large file reads)
- Observe context usage climbing toward 100%
- Context hits 100% — no auto-compaction fires
- Session stalls at
100% context used
Expected Behavior
Auto-compaction should trigger before context reaches 100% (presumably around ~95%) and transparently compact the conversation so the session can continue.
Actual Behavior
Context fills to 100% with no auto-compaction. Manual /compact is required to continue. This has happened consistently across multiple separate sessions over multiple days.
Hypothesis
The issue may be that large single tool responses (e.g. a big git diff or a large file read) push context from below the threshold to 100% in a single turn, skipping the threshold check entirely. The compaction check may only run between turns, so if one tool call blows past the threshold, compaction never gets a chance to fire.
Additionally, system-reminder blocks injected into every tool response in this project are very large and contribute to rapid context growth per turn.
Environment
- Claude Code version: 2.1.153
- OS: Ubuntu 24.04 / Linux 6.17.0-35-generic x86_64
- Shell: bash
- Setting:
"autoCompactEnabled": truein~/.claude/settings.json - Session type: Worktree-based chatrap session (long-running, many tool calls)
Workaround
Manually run /compact when context approaches 100%.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗