claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Unable to read PDF with claude code

Open tristanbes opened this issue 7 months ago • 8 comments

Environment

  • Platform (select one):

    • [x] Anthropic API
  • Claude CLI version: 1.0.7

  • Operating System: MacOS

Bug Description

When referencing a .pdf file, like "based on the @path-to-pdf" it gives:

Fetch(file:///Users/t.b.../workspace/..../full-reference-en-US-113718.pdf) ⎿  Error: Invalid URL

⏺ Read(afull-reference-en-US-113718.pdf)… ⎿  Error: This tool cannot read binary files. The file appears to be a binary .pdf file. Please use appropriate tools for binary file analysis.

tristanbes avatar Jun 02 '25 16:06 tristanbes

same here

Error: This tool cannot read binary files. The file appears to be a binary .pdf file. Please use appropriate tools for binary file analysis.  API Error: Connection error.

benbonnet avatar Jun 03 '25 09:06 benbonnet

+1 , I was thinking I am doing something wrong.

irtiza avatar Jun 07 '25 20:06 irtiza

Image

Same here. Claude Code did mark it as done, but I had to confirm the actual status and Claude Code did tick off the box as complete but did not read the file.

edwrdcrpio avatar Jun 09 '25 23:06 edwrdcrpio

same issue here

Designedforusers avatar Jun 14 '25 08:06 Designedforusers

just came across this issue today

mchulet avatar Jun 25 '25 03:06 mchulet

I have the same issue here. It decided to use pdftotext as a way of translating. Not very helpful since it was filled with equations. Has anyone else had a similar experience?

EduardoNeville avatar Jun 25 '25 21:06 EduardoNeville

Same Issue! Any guidance / support / work-arounds?

Misty1334 avatar Jun 30 '25 18:06 Misty1334

I installed PyPDF2 via pip & now CC is reading the pdf files.

Misty1334 avatar Jun 30 '25 18:06 Misty1334

I installed PyPDF2 via pip & now CC is reading the pdf files.

~~I installed PyPDF2 in a venv, set the venv, and started Claude. No change. How did you do it?~~ Nevermind, I had to tell Claud to use the tool. "Use PyPDF2 to open..."

cptkoolbeenz avatar Jul 01 '25 03:07 cptkoolbeenz

What is the function of pypdf2? Does it convert PDF to text? I think claude code should have the ability to directly use multi-modal reading of PDFs like gemini

isCopyman avatar Jul 11 '25 11:07 isCopyman

+1

jw408 avatar Jul 13 '25 22:07 jw408

+1 this would be a great feature especially for commercial sdk's that only provide pdf documentation.

tjdcs avatar Jul 14 '25 00:07 tjdcs

+1 — would be helpful for referencing images and handwritten markup in PDFs.

lukeburns avatar Jul 15 '25 17:07 lukeburns

This is shipped in 1.0.58

bcherny avatar Jul 24 '25 22:07 bcherny

Same issue here with PDF and with xlsx

allisonault avatar Jul 31 '25 15:07 allisonault

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.

github-actions[bot] avatar Aug 08 '25 14:08 github-actions[bot]