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

Status Fixed / completed
Maintainer reply None cached
Activity 5 comments · opened Sep 18, 2025 · 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 ↗

5 Comments

oneryalcin · 1 year ago

of course this impacts both Typescript and Python SDKs.

oneryalcin · 1 year ago

Closing this as 1.0.119 as of today solved this issue and release notes mentioned it

JLiotta-25 · 1 year ago

This appears to be a regression that hasn't been fixed. The thinking messages are an important part of understanding Claude's reasoning process, especially in programmatic/headless usage.

The fact that this worked correctly in v1.0.58 but broke in later versions indicates this is a regression, not an intentional change. Thinking messages should be consistently available across both interactive and headless modes, or at minimum there should be a flag to control their visibility.

For users relying on headless mode for automation or integration, losing visibility into the thinking process significantly reduces the utility and debuggability of the tool. Please consider reopening this issue and restoring the v1.0.58 behavior.

oneryalcin · 1 year ago

@JLiotta-25 I agree with your comments but this regression is fixed in 1.0.119 and I can see the thinking messages again. That's why I closed the issue

This appears to be a regression that hasn't been fixed. The thinking messages are an important part of understanding Claude's reasoning process, especially in programmatic/headless usage. The fact that this worked correctly in v1.0.58 but broke in later versions indicates this is a regression, not an intentional change. Thinking messages should be consistently available across both interactive and headless modes, or at minimum there should be a flag to control their visibility. For users relying on headless mode for automation or integration, losing visibility into the thinking process significantly reduces the utility and debuggability of the tool. Please consider reopening this issue and restoring the v1.0.58 behavior.
github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.