Skills
Claude Code Context Buffer: Proactive Compaction at 30/15/5% Thresholds Prevents Autocompact Failure and Session Loss
Claude Code reserves a fixed 33K-token autocompact buffer (reduced from 45K in recent versions), meaning the displayed remaining context percentage is inflated — actual usable space hits zero at ~83.5% displayed usage, at which point compaction triggers. A documented production pattern monitors context via StatusLine and creates session backups at 30%, 15%, and 5% remaining, while issuing proactive /compact commands with custom instructions (e.g. '/compact Focus on API interfaces and architectural decisions') to control what the summary preserves. The /context command now surfaces per-tool context consumption to identify which tools are bloating the window.
Source
↳ Follow the thread