[BUG] Thinking messages not displayed in headless mode (-p flag) but visible in interactive UI

Resolved 💬 5 comments Opened Sep 18, 2025 by oneryalcin Closed Sep 19, 2025

I noticed that thinking messages are being suppressed in headless mode when using the -p flag, but they show up normally in the interactive terminal UI.

Reproduction Steps

Use this example prompt to test:

Think and answer, thinking can be long but answer should be two lines. What's the best way to use lru_cache in python

Interactive mode (claude terminal): Shows thinking messages with the ✻ Thinking... indicator followed by the actual thinking content

Headless mode:

claude -p "Think and answer, thinking can be long but answer should be two lines. What's the best way to use lru_cache in python" --output-format=stream-json --verbose

No thinking messages are displayed in the output, even with --output-format=stream-json --verbose

Expected vs Actual Behavior

This seems like inconsistent behavior since thinking is often valuable for understanding Claude's reasoning process, especially in programmatic usage.

Interestingly, when I downgraded to version 1.0.58, the thinking messages were properly displayed in headless mode, suggesting this is a regression introduced in a more recent version.

Expected behavior: Thinking messages should be consistently displayed (or have a flag to control visibility) across both interactive and headless modes.

Current version (any recent version up to 1.0117) exhibiting the issue: Latest (compared against 1.0.58 which worked correctly)

View original on GitHub ↗

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