[Bug] Context Usage Reporting Incorrect After Auto-Compaction
Bug Description
After automatic chat compaction, /context temporarily reports artificially low remaining space, showing alerts like "Context low (2% remaining)"
when actual usage is much lower. The discrepancy resolves after a few messages or a reload.
Reproduction: Consistently occurs immediately after automatic chat compaction triggers.
Observed behavior:
- Pre-compaction: Normal context usage
- Post-compaction: False low-context alert (e.g., "2% remaining")
- Actual usage (via /context): 21%+ available
- After reload: Usage drops significantly (43% → 17%), suggesting chat dereference cleared phantom usage
Impact: Causes unnecessary compaction cycles and confusing UX where the context appears exhausted when plenty of space remains and can make chats unrecoverable
Environment Info
- Platform: linux
- Terminal: zed
- Version: 2.0.14
- Feedback ID: 50c54eab-70de-4181-8e5f-b70357ac05d8
Errors
[{"error":"Error: Tool mcp__cymbiont__search_context not found\n at LlB (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:2123:7930)\n at G$ (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:73:19415)\n at ka (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:75:42814)\n at S9 (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:75:38355)\n at Wm (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:75:38283)\n at z$ (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:75:38137)\n at WC (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:75:35216)\n at H4 (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:73:4841)\n at h5 (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:75:32461)\n at Q.updateContainer (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:79:1827)","timestamp":"2025-10-11T06:30:00.717Z"},{"error":"Error: Tool mcp__cymbiont__search_context not found\n at LlB (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:2123:7930)\n at G$ (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:73:19415)\n at ka (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:75:42814)\n at S9 (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:75:38355)\n at Wm (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:75:38283)\n at z$ (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:75:38137)\n at WC (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:75:35216)\n at H4 (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:73:4841)\n at h5 (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:75:32461)\n at Q.updateContainer (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:79:1827)","timestamp":"2025-10-11T06:30:00.864Z"},{"error":"Error: Request was aborted.\n at tS.makeRequest (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:573:3850)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-10-11T06:30:06.336Z"},{"error":"Error: Failed to get summary response from streaming\n at bg1 (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:1694:1087)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async GZB (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:1690:7044)\n at async KP (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:2492:55419)\n at async wZ (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:2713:33255)\n at async d7 (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:2713:34138)\n at async _s1 (file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:2707:2851)\n at async file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:2713:30586\n at async file:///home/brandt/.nvm/versions/node/v18.20.7/lib/node_modules/@anthropic-ai/claude-code/cli.js:2696:4705","timestamp"
Note: Error logs were truncated.
Additional context: The bug creates a compaction death spiral - each message sent post-compaction triggers another immediate compaction. This makes the chat effectively unusable, as users cannot send messages without triggering the cycle again. Without exiting and reloading, the chat becomes unrecoverable as it enters an infinite compaction loop.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗