claude-code - 💡(How to fix) Fix Opus 4.7 returns no thinking blocks even with --thinking adaptive --thinking-display summarized [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56356Fetched 2026-05-06 06:30:19
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
1
Participants
Timeline (top)
labeled ×4

On Claude Code CLI 2.1.128, Claude Opus 4.7 returns no thinking blocks at all in the response stream, even when invoked with --thinking adaptive --thinking-display summarized --effort high. Sonnet, Sonnet 4.6, and Opus 4.6 all stream thinking content correctly with the same flags.

This contradicts the documented behavior in the official Opus 4.7 release notes, which states that setting display: "summarized" should restore visible thinking output:

Starting with Claude Opus 4.7, thinking content is omitted from the response by default. Thinking blocks still appear in the response stream, but their thinking field will be empty unless the caller explicitly opts in. … If reasoning outputs are needed, you can set display to "summarized" and opt back in with a one-line change.

The adaptive-thinking docs reinforce that display: "summarized" is the right opt-in, with a streaming example that expects thinking_delta events.

Empirically, on Claude Code 2.1.128 the --thinking-display summarized flag is silently dropped (or otherwise no-op'd) when the model is claude-opus-4-7, and the assistant message contains zero thinking content blocks.

Root Cause

On Claude Code CLI 2.1.128, Claude Opus 4.7 returns no thinking blocks at all in the response stream, even when invoked with --thinking adaptive --thinking-display summarized --effort high. Sonnet, Sonnet 4.6, and Opus 4.6 all stream thinking content correctly with the same flags.

This contradicts the documented behavior in the official Opus 4.7 release notes, which states that setting display: "summarized" should restore visible thinking output:

Starting with Claude Opus 4.7, thinking content is omitted from the response by default. Thinking blocks still appear in the response stream, but their thinking field will be empty unless the caller explicitly opts in. … If reasoning outputs are needed, you can set display to "summarized" and opt back in with a one-line change.

The adaptive-thinking docs reinforce that display: "summarized" is the right opt-in, with a streaming example that expects thinking_delta events.

Empirically, on Claude Code 2.1.128 the --thinking-display summarized flag is silently dropped (or otherwise no-op'd) when the model is claude-opus-4-7, and the assistant message contains zero thinking content blocks.

Fix Action

Workaround

Use claude-sonnet-4-6 (or sonnet, or claude-opus-4-6) instead of claude-opus-4-7 for sessions that need visible thinking output.

Code Example

prompt='Prove that the square root of 2 is irrational. Walk me through your reasoning, then give the final proof.'

# Claude Opus 4.7 — no thinking content
claude --print --output-format stream-json --verbose \
  --model claude-opus-4-7 \
  --thinking adaptive --thinking-display summarized --effort high \
  --include-partial-messages \
  "$prompt"

# Claude Sonnet 4.6 — thinking content streams correctly with the same flags
claude --print --output-format stream-json --verbose \
  --model sonnet \
  --thinking adaptive --thinking-display summarized --effort high \
  --include-partial-messages \
  "$prompt"
RAW_BUFFERClick to expand / collapse

Summary

On Claude Code CLI 2.1.128, Claude Opus 4.7 returns no thinking blocks at all in the response stream, even when invoked with --thinking adaptive --thinking-display summarized --effort high. Sonnet, Sonnet 4.6, and Opus 4.6 all stream thinking content correctly with the same flags.

This contradicts the documented behavior in the official Opus 4.7 release notes, which states that setting display: "summarized" should restore visible thinking output:

Starting with Claude Opus 4.7, thinking content is omitted from the response by default. Thinking blocks still appear in the response stream, but their thinking field will be empty unless the caller explicitly opts in. … If reasoning outputs are needed, you can set display to "summarized" and opt back in with a one-line change.

The adaptive-thinking docs reinforce that display: "summarized" is the right opt-in, with a streaming example that expects thinking_delta events.

Empirically, on Claude Code 2.1.128 the --thinking-display summarized flag is silently dropped (or otherwise no-op'd) when the model is claude-opus-4-7, and the assistant message contains zero thinking content blocks.

Reproduction

CLI: 2.1.128 (verified claude --version).

Authenticated via OAuth (Max plan), apiKeySource: "none" in the init message.

prompt='Prove that the square root of 2 is irrational. Walk me through your reasoning, then give the final proof.'

# Claude Opus 4.7 — no thinking content
claude --print --output-format stream-json --verbose \
  --model claude-opus-4-7 \
  --thinking adaptive --thinking-display summarized --effort high \
  --include-partial-messages \
  "$prompt"

# Claude Sonnet 4.6 — thinking content streams correctly with the same flags
claude --print --output-format stream-json --verbose \
  --model sonnet \
  --thinking adaptive --thinking-display summarized --effort high \
  --include-partial-messages \
  "$prompt"

Observed output

Aggregated across the assistant message and stream_event content-block deltas:

Modelflagsthinking blocksthinking charsthinking_delta charstext chars
claude-opus-4-7--thinking adaptive --thinking-display summarized --effort high0001663
claude-opus-4-7(same flags, second run)0001578
claude-opus-4-7--thinking adaptive --thinking-display omitted000196
claude-opus-4-7--thinking adaptive (no display flag)000169
claude-opus-4-7--thinking adaptive --thinking-display summarized --effort xhigh000214
sonnet--thinking adaptive --thinking-display summarized --effort high11461461110
claude-opus-4-6--thinking adaptive --thinking-display summarized1126126533

The Opus 4.7 results are stable across multiple runs. Increasing effort to xhigh, omitting the display flag, and setting it explicitly to omitted all produce the same outcome: zero thinking content surfaces in the response.

The output text in the Opus 4.7 cases shows the model clearly reasoned through the proof (multi-step proof by contradiction with the standard parity argument), so reasoning is happening — it's just not surfacing in the response stream.

Expected

Per the docs, --thinking adaptive --thinking-display summarized on Opus 4.7 should produce a thinking content block with summarized reasoning text, identical to how Sonnet/Opus 4.6 behave. The thinking should also be observable as thinking_delta events on the partial-message stream.

Hypothesis

Best guess based on the empirical pattern: the Claude Code CLI is not forwarding thinking.display to the Anthropic API for Opus 4.7 specifically (or is forwarding it but the OAuth/Max-plan path is overriding to omitted). The flag works for other models, so it's an Opus-4.7-specific code path. Either:

  1. The CLI's Opus 4.7 integration drops --thinking-display, or
  2. The Opus 4.7 server-side default of omitted is sticking and not being overridden by the explicit summarized.

Impact

Any Claude Code-based application that relies on streaming thinking content to a UI (status indicators, "Claude is reasoning…" UX, audit logging of reasoning traces) loses that feature entirely when switching to Opus 4.7. Sonnet and Opus 4.6 remain working. Concretely affects @anthropic-ai/claude-agent-sdk, the official Python SDK, and downstream third-party SDKs that all rely on the same CLI path.

Workaround

Use claude-sonnet-4-6 (or sonnet, or claude-opus-4-6) instead of claude-opus-4-7 for sessions that need visible thinking output.

extent analysis

TL;DR

The issue can be worked around by using claude-sonnet-4-6 or claude-opus-4-6 instead of claude-opus-4-7 for sessions that require visible thinking output.

Guidance

  • Verify that the --thinking-display summarized flag is being correctly passed to the Anthropic API for Opus 4.7 by checking the API request payload.
  • Investigate the Claude Code CLI's Opus 4.7 integration to determine if the --thinking-display flag is being dropped or overridden.
  • Test the workaround by using claude-sonnet-4-6 or claude-opus-4-6 and verify that thinking content is correctly streamed.
  • Consider updating the @anthropic-ai/claude-agent-sdk and other downstream SDKs to handle the Opus 4.7-specific issue.

Example

No code snippet is provided as the issue is related to the CLI and API interaction.

Notes

The root cause of the issue is unclear, but it appears to be related to the Opus 4.7 integration in the Claude Code CLI. The workaround provides a temporary solution, but a permanent fix will require further investigation and updates to the CLI and/or SDKs.

Recommendation

Apply the workaround by using claude-sonnet-4-6 or claude-opus-4-6 instead of claude-opus-4-7 for sessions that require visible thinking output, as this provides a reliable solution until the root cause is addressed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Opus 4.7 returns no thinking blocks even with --thinking adaptive --thinking-display summarized [1 participants]