anthropics / anthropics/claude-code

[Feature Request] Add metadata field to indicate summarized thinking blocks and document thinking compression ratios

Offen
#90,115 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area:api enhancement
Vorherrschende Sprache
Python
Sterne
145k
Forks
23.1k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

**Summary**

Nothing in the payload distinguishes a summarised thinking block from a raw one. Across 64,148 thinking blocks in my own Claude Code transcripts, the only keys ever present on a thinking block are `type`, `thinking`, and `signature`. So neither a client nor a user can tell which they are looking at, and displayed thinking reads as the model's reasoning because there is no signal that it isn't.

**Evidence that the two differ substantially**

`usage.output_tokens_details.thinking_tokens` reports a substantially larger count than the thinking text carried in the same message. Across 38,726 thinking turns, the median ratio of visible text to billed tokens is 0.40 for opus-5, 0.36 for sonnet-5 and 0.35 for fable-5 — and it falls from 0.55 for short thinking to 0.28 above 2,000 billed tokens. (Visible tokens estimated as chars/4, applied identically across buckets. One user's own transcripts, so the workload is mine rather than representative.)

The numbers are context for how much is being elided. This issue does not depend on them: even if the ratio were 0.95, an unlabelled block would still be unlabelled.

**Requested change**

1. A field on the thinking block indicating whether it is summarised or raw.
2. One line in the extended-thinking docs stating that displayed thinking may be a summary, and that billing is against the full trace rather than the text shown.

**Scope — deliberately narrow**

This asks only for a label on what is already returned. It does not ask for raw traces, and it is not blocked by any decision about them. If raw thinking is never exposed, this becomes more useful rather than less: the summary is then the permanent artefact, and it should say what it is.

**Why it matters**

Users reasonably believe they are reading the model's reasoning, because nothing tells them otherwise. Given the faithfulness literature (arXiv:2505.05410), an unlabelled paraphrase is also harder to check than a labelled one.

**Environment Info**
- Platform: linux
- Terminal: tmux
- Version: 2.1.247
- Feedback ID: 9862b8f4-46c7-4c86-8c80-bf40b6213788

**Related, not duplicated**
- #76104 — original request for live thinking display, closed 2026-08-17.
- #90128 asks for unsummarised raw thinking. That is a policy question; this one is a metadata field, and the two are independent — either can ship without the other.

Reproducing the measurement is about twenty lines against any transcript directory.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

No implementation file or test is named. Start by locating the thinking-block response schema and the extended-thinking documentation, then check any existing response examples or validation tests. Done means the returned block identifies summarized versus raw thinking and the docs state that displayed thinking may be summarized and billing covers the full trace.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
api, documentation
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.