[BUG] Claude CLI returns empty output with large stdin input in headless mode

Resolved 💬 8 comments Opened Sep 7, 2025 by geomna Closed Feb 5, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Claude CLI in headless mode (-p flag) returns empty output when processing large stdin input (~7000+ characters), while smaller inputs (~2500 characters) work correctly.

What Should Happen?

Claude CLI should process large text input and return analysis results.

Error Messages/Logs

- Command exits with return code 0 (success)
- Empty stdout output (0 characters)
- No stderr errors
- `--verbose` flag provides no additional information

Steps to Reproduce

  1. Create a test file with ~7000 characters of content
  2. Run: cat testfile.txt | claude -p --verbose --append-system-prompt "Analyze this content" --output-format text
  3. Observe empty output despite successful exit code

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

1.0.108

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Non-interactive/CI environment

Additional Information

Test Results

  • Input size ~2350 characters: Returns expected output (1904 characters)
  • Input size ~6986 characters: Returns empty output (0 characters)
  • Both cases: exit code 0, no stderr errors

Impact
This prevents using Claude CLI for processing large documents, code reviews, or batch text analysis in automated workflows.

View original on GitHub ↗

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