Problem
When autoCompact is enabled, the auto-compact trigger threshold is too close to the hard context window limit. This creates a failure scenario where:
- Context grows rapidly (e.g., large file reads, verbose tool outputs) and overshoots past the auto-compact threshold straight to the hard limit
- Claude stops working and advises running
/compact manually
- Manual
/compact then fails with "conversation is too long" — because the conversation is so large that even the compaction request can't fit in the context window
- The only option left is
/clear, which destroys all conversation context
This is a catch-22: auto-compact didn't trigger when it should have, and manual compact can't rescue the situation.
Proposed Solution
- Make the auto-compact threshold configurable — allow users to set a percentage (e.g., trigger at 80% or 85% of the context limit instead of the current default)
- Trigger auto-compact earlier by default — even a 5% earlier threshold would provide enough buffer to avoid the failure scenario described above
- Ensure
/compact always works — if the conversation is too long to compact normally, consider a more aggressive fallback (e.g., truncating older messages before compacting)
Example config:
{
"autoCompact": true,
"autoCompactThreshold": 0.85
}
Impact
This is a significant UX issue. Losing an entire long session's context because auto-compact failed silently and manual compact can't recover is extremely frustrating — especially during complex multi-file tasks where rebuilding context is costly.
Environment
- Claude Code CLI
autoCompact: true in settings
- Model: Claude Opus
- Platform: macOS
Problem
When
autoCompactis enabled, the auto-compact trigger threshold is too close to the hard context window limit. This creates a failure scenario where:/compactmanually/compactthen fails with "conversation is too long" — because the conversation is so large that even the compaction request can't fit in the context window/clear, which destroys all conversation contextThis is a catch-22: auto-compact didn't trigger when it should have, and manual compact can't rescue the situation.
Proposed Solution
/compactalways works — if the conversation is too long to compact normally, consider a more aggressive fallback (e.g., truncating older messages before compacting)Example config:
{ "autoCompact": true, "autoCompactThreshold": 0.85 }Impact
This is a significant UX issue. Losing an entire long session's context because auto-compact failed silently and manual compact can't recover is extremely frustrating — especially during complex multi-file tasks where rebuilding context is costly.
Environment
autoCompact: truein settings