Allow display:"summarized" extended-thinking in --print --output-format stream-json (headless force-omits it)

Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 0 comments · opened Jul 31, 2026

Type: Feature request

Claude Code version: 2.1.220 (reproduced on macOS; provider Vertex, but provider-independent)

Summary
In headless mode (--print), Claude Code forces the thinking display parameter to "omitted", so every stream-json consumer receives thinking blocks with an empty thinking field and a signature, and zero thinking_delta events. The interactive TUI opts into display:"summarized" and renders reasoning text. There is no supported way for a headless/stream-json consumer to request the same summarized thinking the TUI shows. The Agent SDK inherits this, since it wraps the --print subprocess.

Repro

# Opus 4.8 (display defaults to omitted; also force-omitted in headless): empty
claude --print --output-format stream-json --verbose --include-partial-messages \
  --model opus "Think step by step: what is 47*53?"
#   thinking block: thinking_len=0, signature present, thinking_delta events=0

# Sonnet 4.5/4.6 (display defaults to summarized): text present
claude --print --output-format stream-json --verbose --include-partial-messages \
  --model sonnet "Think step by step: what is 47*53?"
#   thinking block: thinking_len=87, thinking_delta events=16

Root cause (not a bug — current behavior)
Empty thinking + signature + no deltas is the documented behavior of display:"omitted" (docs: Thinking → "Controlling thinking display"). Two compounding causes:

  1. Model default: omitted is the API default on Opus 4.8/4.7, Opus 5, Sonnet 5, Fable, Mythos; summarized is default only on Opus 4.6 / Sonnet 4.6 and earlier.
  2. Headless force-omit: independent of the model default, the CLI request builder forces display:"omitted" for non-interactive --print sessions, unless one of a few internal opt-outs holds (display-set-explicitly, --forward-subagent-text, async, exact-tools). The interactive TUI path resolves to "summarized"; --output-format text/json resolves to "omitted". This is a deliberate latency optimization (faster time-to-first-text-token), per the docs' stated benefit of omitted.

None of the reachable opt-outs surface main-agent summarized thinking in --print: --forward-subagent-text doesn't flip it, and --include-partial-messages has no thinking_delta events to surface once omitted is in force.

The ask
Expose a supported, documented control — --thinking-display <summarized|omitted> CLI flag and/or a settings.json key — that is honored in --print/--output-format stream-json. When set to summarized, the CLI should request display:"summarized" on the underlying Messages API call (which already supports it on Opus 4.8 — it's what the interactive TUI requests), populating the thinking field and re-emitting thinking_delta events.

Why this is the right fix
The API fully supports display:"summarized" on the newest models; the only gap is that headless Claude Code doesn't let a consumer opt in. A single knob restores machine-readable reasoning for every stream-json surface (a custom console, the Agent SDK, any subprocess consumer) with zero downstream rewrite. Consumers that want the lower-latency default can leave omitted in place.

Alternatives considered

  • Use a 4.6/earlier tier for surfaces that need visible reasoning — works today but forces a model-quality tradeoff.
  • Parse the TUI output — not machine-readable / not a supported contract.

View original on GitHub ↗