Skip to content

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

@renstroost

Description

@renstroost

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliarea:toolsbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOSstaleIssue is inactive

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions