Feature request: Configurable auto-compaction threshold
Problem
Automatic context compaction currently triggers at 100% context usage, which often interrupts mid-task — while writing code, mid-edit, or during a complex discussion. This breaks workflow momentum and is frustrating for power users with long sessions.
Proposed Solution
Allow users to configure an earlier compaction threshold (e.g., 95%) via settings (~/.claude/settings.json or .claude/settings.json):
{
"compactionThreshold": 0.95
}
This way, compaction would trigger at a natural pause point (between tool calls or between tasks) rather than being forced mid-work at 100%.
Alternative approaches
- Expose context usage % to the model so it can proactively run
/compactbetween tasks when usage is high - "Compact at next natural break" mode — when threshold is reached, defer compaction until the current tool call chain completes rather than interrupting immediately
Impact
This is a significant UX pain point for power users running long, multi-task sessions. The mid-work interruption forces a context reload that can lose task continuity and requires re-reading compacted summaries to resume.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗