[Bug] Auto-Compact triggers prematurely with 51k tokens free space remaining
Bug Description
Autocompact triggers prematurely with ~51k tokens of free space remaining
Harness is hitting the context limit and forcing a conversation rewind/compact at 57% usage (113k/200k tokens),
leaving 51k tokens of free space. This is well above the 33k autocompact buffer, so compaction shouldn't be
triggering yet.
Expected behavior: Compaction triggers when free space drops to or below the autocompact buffer (33k tokens).
Actual behavior: Compaction triggers with 51k tokens free, which is 18k tokens above the buffer threshold.
Context snapshot at time of issue:
Model: claude-opus-4-6
Usage: 113k / 200k tokens (57%)
Breakdown:
System prompt: 3.2k (1.6%)
System tools: 17.9k (9.0%)
MCP tools: 6.7k (3.3%)
Memory files: 1.3k (0.7%)
Skills: 396 (0.2%)
Messages: 86.8k (43.4%)
Free space: 51k (25.3%)
Autocompact buffer: 33k (16.5%)
Impact: Conversations get cut short unnecessarily, losing context and requiring rewinds when there should be ~18k
tokens of usable space remaining.
Environment Info
- Platform: darwin
- Terminal: Apple_Terminal
- Version: 2.1.37
- Feedback ID: d5e33a6d-d50c-407b-ac09-bb1006b45de2
Errors
[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/ryanmish/.local/share/claude/versions/2.1.37 (expected in multi-process scenarios)\n at GFR (/$bunfs/root/claude:3584:2098)\n at ebA (/$bunfs/root/claude:3584:1209)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-02-08T02:14:58.400Z"}]This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗