[BUG] /compact command fails at 0% context remaining
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When the context window reaches 0% during a long conversation, running the /compact command throws an error instead of compressing the conversation. The conversation becomes completely stuck — no further interaction is possible, and the only
option is to run /clear, which loses all conversation context.
What Should Happen?
The /compact command should gracefully compress the conversation even when the context window is at 0%. Ideally, Claude Code
should also auto-compact before reaching 0% to prevent the conversation from becoming unrecoverable. At minimum, /compact
should never fail — it should always be able to summarize and free up context space.
Error Messages/Logs
● 예시 답안 섹션은 확인했습니다. 이건 프리뷰에서의 예시 답안 표시 부분입니다. 하지만 스크린샷의 ⓐ : 빈 줄은 **PDF 출력 시의
답안란(학생이 쓰는 칸)**입니다. 이 부분도 찾아봐야 합니다.
● Searched for 1 pattern (ctrl+o to expand)
❯ 이 스크린샷은 '지칭 추론' 유형에서 '동일/상이 의미 선별' 세부 유형인데, pdf 렌더링 결과물에서 각 알파벳 표기 뒤에 있는
순수
영어 텍스트에만 밑줄이 쳐지면 돼. 지금은 '(A) those tiny ~~ sweat' 여기 통째로 쳐져있지만 those 부터 sweat 까지 부분만
쳐지게 바꿔줘.
⎿ [Image #3]
⎿ Context limit reached · /compact or /clear to continue
Steps to Reproduce
- Start a Claude Code session in a large project directory 2. Have a long conversation with many tool calls (file reads, edits, searches, etc.) until the context window indicator reaches
0%
- Once context is at 0%, Claude shows "Context limit reached · /compact or /clear to continue"
- Run
/compact - The command fails with an error instead of compressing the conversation
- The session is now stuck — neither
/compactnor further prompts work - The only recovery option is
/clear, which erases all conversation context
Environment: Windows 11, Claude Code CLI (latest version), using bash shell via MSYS2/Git Bash
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.44
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Cursor
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗