[Bug] Compact Fails When Context Window Nearly Full, Requires Restart

Status Fixed / completed
Maintainer reply ✓ Yes — amorriscode
Activity 10 comments · opened Sep 16, 2025 · closed Nov 3, 2025
💡 Likely answer: A maintainer (amorriscode, contributor) responded on this thread — see the highlighted reply below.

Bug Description
Compact does not work properly for a couple of days now. When I am at 5% of remaining context window left and I run /compact I get an error that it failed because the conversation is too long. Howver: If I then exit the conversation and run claude --continue + /compact it works on the second try.

Environment Info

  • Platform: darwin
  • Terminal: iTerm.app
  • Version: 1.0.115
  • Feedback ID: 4ac0357e-962c-4ccd-90af-5ee34469b677

View original on GitHub ↗

10 Comments

github-actions[bot] · 11 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/7594
  2. https://github.com/anthropics/claude-code/issues/7655
  3. https://github.com/anthropics/claude-code/issues/7530

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

acidtech · 11 months ago

You keep closing these tickets but STILL haven't fixed the problem with /compact. Just saying its been 7 days without a new complaint doesn't mean the problem has been addressed.

ivg-design · 11 months ago

yes! i have the same issue - do not close it until its fixed!

dvortex · 10 months ago

i still have this problem around 4 times per day. i try to /compact early to get ahead of it (at 37%) but it still fails.

rweijnen · 10 months ago

same issue, and please stop auto-closing issues. I would instead suggest fixing them 😉

JuliusPIV · 10 months ago

Can confirm I encountered the issue today with 23% left.

franciszekzak · 10 months ago

Free space 38.6%, still got the error.

oborchers · 10 months ago

Yup. I lost. Count how often It Happens for me during the Day.

amorriscode contributor · 10 months ago

This should be fixed in 2.0.31.

github-actions[bot] · 9 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.