anthropics / anthropics/claude-code

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

オープン
#90,115 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
area:api enhancement
主要言語
Python
スター
145k
フォーク
23.1k
PR マージ指標
PR 指標を取得中

説明

**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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
api, documentation
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
55/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。