"Infinite Auto-Compact Loop Causing Performance Degradation"

Status Closed — not planned
Maintainer reply None cached
Activity 13 comments · opened Jun 17, 2025 · closed Jan 15, 2026

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

View original on GitHub ↗

13 Comments

Andre-Profitt · 1 year ago

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

LarsArtmann · 1 year ago
LarsArtmann · 1 year ago
[!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 · 1 year ago

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

nlev8 · 1 year ago

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)

jleechan2015 · 1 year ago

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

Oxytra · 1 year ago

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

LarsArtmann · 1 year ago
Codewow · 1 year ago

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

github-actions[bot] · 8 months ago

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.

racerx2 · 8 months ago

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

github-actions[bot] · 7 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

github-actions[bot] · 7 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.