Description
The Read tool's PDF rendering cannot find poppler-utils when Claude Code runs in headless/print mode (claude -p "...") even though the binary is on PATH and findable in the parent process.
Steps to reproduce
- Install poppler:
brew install poppler
- Verify:
which pdftotext → /opt/homebrew/bin/pdftotext
- In an interactive Claude Code session, read a PDF file → works (renders pages as images)
- Run headless:
claude -p "Read the file at /path/to/file.pdf and describe it" --output-format text
- The Read tool returns:
"PDF reading is not supported. Install poppler-utils (e.g. brew install poppler or apt-get install poppler-utils) to enable PDF reading."
Environment
- macOS 15.5 (Darwin 24.6.0), Apple Silicon
- poppler installed via Homebrew at
/opt/homebrew/bin/pdftotext
- PATH confirmed to include
/opt/homebrew/bin in the parent process (captured via env > debug.txt before launching claude -p)
- Claude Code launched from a bash script via
make target
Evidence
The parent process env dump shows:
PATH=/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:...
And which pdftotext returns /opt/homebrew/bin/pdftotext.
Interactive session reads the same PDF file successfully (multimodal rendering works). Only -p mode fails.
Expected behavior
The Read tool should find pdftotext on PATH in headless mode the same way it does in interactive mode.
Workaround
For our use case (MCP plugin serving Teams attachments), we provide extracted text in the tool response body field via pdfplumber. The PDF file is also available on disk at file_path for interactive sessions where Read works. Only automated/headless testing is affected.
Description
The Read tool's PDF rendering cannot find
poppler-utilswhen Claude Code runs in headless/print mode (claude -p "...") even though the binary is on PATH and findable in the parent process.Steps to reproduce
brew install popplerwhich pdftotext→/opt/homebrew/bin/pdftotextclaude -p "Read the file at /path/to/file.pdf and describe it" --output-format text"PDF reading is not supported. Install poppler-utils (e.g. brew install poppler or apt-get install poppler-utils) to enable PDF reading."Environment
/opt/homebrew/bin/pdftotext/opt/homebrew/binin the parent process (captured viaenv > debug.txtbefore launchingclaude -p)maketargetEvidence
The parent process env dump shows:
And
which pdftotextreturns/opt/homebrew/bin/pdftotext.Interactive session reads the same PDF file successfully (multimodal rendering works). Only
-pmode fails.Expected behavior
The Read tool should find
pdftotexton PATH in headless mode the same way it does in interactive mode.Workaround
For our use case (MCP plugin serving Teams attachments), we provide extracted text in the tool response
bodyfield viapdfplumber. The PDF file is also available on disk atfile_pathfor interactive sessions where Read works. Only automated/headless testing is affected.