Read tool cannot find poppler-utils in headless (-p) mode

Resolved 💬 4 comments Opened Mar 1, 2026 by renstroost Closed Mar 29, 2026

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

  1. Install poppler: brew install poppler
  2. Verify: which pdftotext/opt/homebrew/bin/pdftotext
  3. In an interactive Claude Code session, read a PDF file → works (renders pages as images)
  4. Run headless: claude -p "Read the file at /path/to/file.pdf and describe it" --output-format text
  5. 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.

View original on GitHub ↗

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