claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

"Infinite Auto-Compact Loop Causing Performance Degradation"

Open sean-rowe opened this issue 6 months ago • 6 comments

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"}]

sean-rowe avatar Jun 17 '25 22:06 sean-rowe

I second this. i used /clear, and it is stuck on auto-compact loop

Andre-Profitt avatar Jun 20 '25 23:06 Andre-Profitt

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

LarsArtmann avatar Jun 21 '25 00:06 LarsArtmann

[!TIP] WORK AROUND: Disable auto-compact via claude config set -g autoCompactEnabled false and /compact manually.

It's not great but at least it works (for me).

LarsArtmann avatar Jun 21 '25 00:06 LarsArtmann

Another person managed to get it working after a restart. See: https://github.com/anthropics/claude-code/issues/2391#issuecomment-2993237142

LarsArtmann avatar Jun 21 '25 01:06 LarsArtmann

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)

nlev8 avatar Jun 27 '25 19:06 nlev8

Seeing this too. Everything seems slow. Even if I disable auto compact performing worse than before this issue

jleechan2015 avatar Jun 28 '25 23:06 jleechan2015

yes. it seems now its high time switching claude code completely with some other coding agent or degrading max subscription with 20 USD subscription.

Oxytra avatar Jul 01 '25 14:07 Oxytra

[!TIP] My recommendations so far: https://github.com/anthropics/claude-code/issues/2391#issuecomment-3078045620

LarsArtmann avatar Jul 16 '25 11:07 LarsArtmann

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....

Codewow avatar Aug 25 '25 12:08 Codewow

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.

github-actions[bot] avatar Dec 07 '25 10:12 github-actions[bot]

come on man fix this crap! Paying users out here bro damn!

racerx2 avatar Dec 15 '25 02:12 racerx2