[BUG] v2.1.83: -p (print) mode returns empty result while tokens are generated and billed
Status Fixed / completed
Reported on v2.1.78
Maintainer reply None cached
Workaround ✓ Mentioned in description ↑
Activity 3 comments · opened Mar 25, 2026 · closed Mar 25, 2026
Description
Claude Code CLI v2.1.83 in -p (print/non-interactive) mode returns empty text on stdout while tokens are generated and billed. The --output-format json confirms tokens are consumed (output_tokens: 12) and cost is charged (total_cost_usd: 0.08) but "result": "" is always empty.
Reproduction
claude --dangerously-skip-permissions -p "Say BANANA" < /dev/null
# Expected: "BANANA"
# Actual: empty (just a newline)
claude --dangerously-skip-permissions --output-format json -p "Say BANANA" < /dev/null
# Shows: "result":"", "output_tokens":12, "total_cost_usd":0.058
Workaround
Downgrading to v2.1.78 fixes the issue:
npm install -g @anthropic-ai/claude-code@2.1.78
/opt/homebrew/bin/claude --dangerously-skip-permissions -p "Say BANANA" < /dev/null
# Returns: "BANANA"
Environment
- CLI Version: 2.1.83 (broken), 2.1.78 (works)
- OS: macOS 15.5 (Apple Silicon M4 Pro)
- Node: v25.8.0
- Auth: claude.ai subscription (OAuth, not API key)
- Regression window: Works in v2.1.78, broken in v2.1.83
Impact
This breaks all automation that uses -p mode for non-interactive scripting (Telegram bots, queue processors, CI/CD pipelines). Tokens are consumed and billed but the response text is silently discarded.
Notes
- Interactive mode (without
-p) works fine --output-format jsonshows the metadata (tokens, cost, session_id) butresultfield is empty string--baremode also affected but additionally requires API key auth- Context-mode and other plugins/hooks do not affect the issue (tested with disabled plugins, empty MCP config,
--disable-slash-commands)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗