claude -p / --print always returns empty result in v2.1.83 (regression)

Resolved 💬 3 comments Opened Mar 25, 2026 by ihanikos Closed Mar 29, 2026

Bug

claude --print exits 0 but produces no text output. The model generates a response (output tokens > 0, text visible in stream-json assistant events) but the result field is always "" and nothing is printed to stdout.

Steps to reproduce

claude -p 'say hello!'
# exits 0, no output

With --output-format json:

{"type":"result","result":"","stop_reason":"end_turn","usage":{"output_tokens":14,...}}

The assistant text IS generated and visible in stream-json:

{"type":"assistant","message":{"content":[{"type":"text","text":"Hello!"}],...}}
{"type":"result","result":""}

Confirmed not caused by hooks

Reproduced in a clean Docker container (node:22-slim) with no hooks, no CLAUDECODE env var, no ~/.claude/settings.json — only auth mounted:

ASSISTANT: 'Hello!'   ← text generated correctly
RESULT: ''            ← never surfaces to stdout

Expected

Hello! printed to stdout.

Environment

  • Version: 2.1.83
  • Platform: Linux (also reproduced in Docker node:22-slim)
  • Shell: zsh / bash
  • CLAUDECODE not set

Relation to existing issues

Distinct from #26190 / #29543 (those are nested session / CLAUDECODE inheritance hangs). This reproduces in a completely clean environment with no parent Claude Code session.

View original on GitHub ↗

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