"Infinite Auto-Compact Loop Causing Performance Degradation"
Bug Description
I'm seeing this Context left until auto-compact: NaN% and it keeps compacting, using up all of my time.
Environment Info
- Platform: linux
- Terminal: wsl-Ubuntu
- Version: 1.0.27
- Feedback ID: bae01ce8-23f0-4fde-bf51-3d568651441c
Errors
[{"error":"Error: Request was aborted.\n at no._createMessage (file:///home/srowe/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1306:6810)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-06-17T22:11:18.851Z"},{"error":"Error: Request was aborted.\n at Tw.makeRequest (file:///home/srowe/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1315:3597)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-06-17T22:11:18.872Z"},{"error":"Error: Request was aborted.\n at Tw.makeRequest (file:///home/srowe/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1315:3784)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-06-17T22:11:36.841Z"},{"error":"Error: Request was aborted.\n at Tw.makeRequest (file:///home/srowe/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1315:3597)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-06-17T22:11:36.864Z"}]
I second this. i used /clear, and it is stuck on auto-compact loop
This seems to be related to my Issue: https://github.com/anthropics/claude-code/issues/2283 and https://github.com/anthropics/claude-code/issues/2387
[!TIP] WORK AROUND: Disable auto-compact via
claude config set -g autoCompactEnabled falseand/compactmanually.
It's not great but at least it works (for me).
Another person managed to get it working after a restart. See: https://github.com/anthropics/claude-code/issues/2391#issuecomment-2993237142
It was resolving on its own a few times but now persists. Restarting VS Code and my computer doesn't help either. getting this constantly: API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10) ⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 2/10) ⎿ API Error (Request timed out.) · Retrying in 2 seconds… (attempt 3/10)
Seeing this too. Everything seems slow. Even if I disable auto compact performing worse than before this issue
yes. it seems now its high time switching claude code completely with some other coding agent or degrading max subscription with 20 USD subscription.
[!TIP] My recommendations so far: https://github.com/anthropics/claude-code/issues/2391#issuecomment-3078045620
Found a workaround. Not sure how detrimental it is to context awareness, but deleting/renaming the settings.local file in the .claude folder fixed the context issues for me. I am guessing the file just got too large for Claude to be able to effectively read because of all the bash commands it stored away that weren't reusable in most cases.
if you want to YOLO it, you can use "claude --dangerously-skip-permissions" to bypass permission prompts (the ones that when saved to the project, fill up the setting.local.json file and ultimately cause the context issue)
But that is absolute last resort and very dangerous to do. Hence the flag name....
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
come on man fix this crap! Paying users out here bro damn!