claude-code - 💡(How to fix) Fix claude --print returns empty output (exit 0) in v2.1.109 [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48455Fetched 2026-04-16 06:59:40
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×5closed ×1commented ×1

claude --print returns empty stdout with exit code 0 in version 2.1.109. This is a regression from 2.1.108 where --print worked correctly.

Root Cause

claude --print returns empty stdout with exit code 0 in version 2.1.109. This is a regression from 2.1.108 where --print worked correctly.

Code Example

$ claude --version
2.1.109 (Claude Code)

$ claude --print -p 'say hello'
# (empty output, exit 0)

$ echo "say hello" | claude --print
# (empty output, exit 0)

$ claude --print --no-session-persistence --permission-mode bypassPermissions -p 'Reply with exactly: {"test": true}'
# (empty output, exit 0)
RAW_BUFFERClick to expand / collapse

Description

claude --print returns empty stdout with exit code 0 in version 2.1.109. This is a regression from 2.1.108 where --print worked correctly.

Reproduction

$ claude --version
2.1.109 (Claude Code)

$ claude --print -p 'say hello'
# (empty output, exit 0)

$ echo "say hello" | claude --print
# (empty output, exit 0)

$ claude --print --no-session-persistence --permission-mode bypassPermissions -p 'Reply with exactly: {"test": true}'
# (empty output, exit 0)

All three forms produce zero stdout, zero stderr, and exit code 0.

Impact

Any application using claude --print as a subprocess is broken:

  • Custom macOS apps that fork Claude for background tasks (classification, summarization, triage)
  • Piped workflows (echo "prompt" | claude --print | jq)
  • Any automation relying on --print mode

The interactive mode (without --print) continues to work normally.

Environment

  • macOS 15.4 (Darwin 25.2.0)
  • claude-code 2.1.109
  • Rate limits are well within bounds (15% of 5-hour window)
  • Auth is valid (interactive sessions work fine)

Expected behavior

claude --print should output the model's response to stdout and exit, as it did in 2.1.108.

extent analysis

TL;DR

Downgrade to version 2.1.108 to restore the correct behavior of claude --print until a fixed version is available.

Guidance

  • Verify that the issue is indeed specific to version 2.1.109 by testing claude --print in version 2.1.108 to confirm the regression.
  • Check the release notes or changelog for version 2.1.109 to see if there are any known issues or changes related to the --print flag.
  • Consider reaching out to the developers or maintainers of Claude for further assistance or to report the issue, as this appears to be a regression introduced in the latest version.
  • If downgrading is not feasible, explore alternative workflows or tools that do not rely on claude --print for critical functionality.

Example

No code snippet is provided as the issue is related to the behavior of the claude command-line tool rather than a specific code implementation.

Notes

The solution provided is based on the information given and may not be applicable if there are other factors at play not mentioned in the issue description. It's also important to note that downgrading might reintroduce bugs or security vulnerabilities fixed in version 2.1.109.

Recommendation

Apply workaround: Downgrade to version 2.1.108. This is recommended because it is the last known version where claude --print worked correctly, and there's no clear indication of when a fix for version 2.1.109 will be available.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

claude --print should output the model's response to stdout and exit, as it did in 2.1.108.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING