[BUG] "PDF too large" error incorrectly triggered on plain text (.txt) files in VS Code extension
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?
The error message "PDF too large (max 100 pages, 20MB). Try reading the file a different way (e.g., extract text with pdftotext)" is being incorrectly triggered when uploading or referencing plain text files. The file in question was a .txt file converted from a PDF using pdftotext, not a PDF itself.
What Should Happen?
It should read the txt file uploaded and extract data
Error Messages/Logs
PDF too large (max 100 pages, 20MB). Try reading the file a different way (e.g., extract text with pdftotext).
Steps to Reproduce
Take a PDF datasheet and extract a section using pdftk:
pdftk input.pdf cat 405-419 output extract.pdf
Convert to text using pdftotext:
pdftotext extract.pdf extract.txt
Upload extract.txt to Claude Code in VS Code and submit a prompt referencing it
Also attempted referencing the file by absolute path in the prompt — same error
Also attempted renaming to adc_burst.txt and re-uploading — same error
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.138
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗