[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:

  1. Upload a 150,000-token PDF (verified via https://www.claudetokenizer.com/ which calls directly api)
  2. Ask a simple question about the document on first message
  3. Claude Code immediately responds with "Context low · Run /compact to compact & continue"
  4. Run /compact command (completes instantly)
  5. All sections in the compact output remain at default values - no actual compaction occurs
  6. 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

  1. 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
  2. Ensure PDF is not corrupted (verified: can extract text via pdftotext, images are readable)
  3. In Claude Code, run: claude "Please summarize this document" path/to/my-pdf.pdf (or attach via file upload)
  4. Observe: "Context low" message appears immediately on first message
  5. Run /compact command
  6. Observe: All sections remain at default, no actual compaction occurs
  7. Attempt any follow-up question about the PDF content
  8. 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_

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗