[BUG] PDF Reading Fails Under 200k Token Limit
Resolved 💬 6 comments Opened Dec 10, 2025 by CallisteH Closed Mar 7, 2026
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 attempting to work with a PDF document under 200,000 tokens, Claude Code incorrectly reports context overflow and fails to process the file properly.
Specific behavior:
- Upload a 150,000-token PDF (verified via https://www.claudetokenizer.com/ which calls directly api)
- Ask a simple question about the document on first message
- Claude Code immediately responds with "Context low · Run /compact to compact & continue"
- Run /compact command (completes instantly)
- All sections in the compact output remain at default values - no actual compaction occurs
- The PDF content is never successfully read/interpreted
What Should Happen?
Claude Code should successfully read and interpret the PDF document. The document should be processable since it's under the stated token limit. The /compact command should either meaningfully reduce context or indicate that the document is already within acceptable limits.
Error Messages/Logs
● Read(my-pdf.pdf)
⎿ Read PDF (1.8MB)
⎿ Context low · Run /compact to compact & continue
After running /compact:
Command completes instantly
All sections remain at default values (no compaction performed)
From claude.ai web interface (same PDF):
"No compactable messages available" sometimes, or "Context size exceeds the limit"
Steps to Reproduce
- Prepare a PDF document approximately 150,000 tokens in size (can verify token count via https://www.claudetokenizer.com/) - I can send you the sample pdf I use by private canals
- Ensure PDF is not corrupted (verified: can extract text via pdftotext, images are readable)
- In Claude Code, run: claude "Please summarize this document" path/to/my-pdf.pdf (or attach via file upload)
- Observe: "Context low" message appears immediately on first message
- Run /compact command
- Observe: All sections remain at default, no actual compaction occurs
- Attempt any follow-up question about the PDF content
- Result: Claude cannot process the PDF content
Claude Model
Other
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.64
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗