anthropics / anthropics/claude-code

Between-tool assistant text intermittently NOT stored in session .jsonl — replaced by a summary typed as 'thinking' (permanent data loss, regression from display-only summarization)

Aperta
#94,336 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area:core area:model bug has repro platform:windows
Lingua principale
Python
Stelle
145k
Fork
23.1k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

## Summary

The display-side summarization of assistant text emitted **between tool calls** (Fable 5 in Claude Code) is already documented in #77798, #86565, #80136, #81853, #67164. Until now, the mitigating fact — confirmed in our own sessions on 2026-09-03 by reading the session `.jsonl` — was that **the transcript on disk retained the verbatim text**; only the rendering was lossy.

**That is no longer reliably true.** We have a confirmed case (2026-09-14) where a substantive ~2,400-character assistant text block emitted between two tool calls **never reached the session `.jsonl` at all**. In its position, the transcript contains a ~40-word paraphrase of that text stored as a **`thinking`-type content block**. The original text is unrecoverable — it exists nowhere on disk. This upgrades a display annoyance to **permanent data loss**, and it also **mistypes content**: prose the model addressed to the user is stored as if it were internal reasoning.

## Environment

- Claude Code VS Code extension `anthropic.claude-code-2.1.270-win32-x64`
- Windows 11 Pro (build 26200)
- Model: `claude-fable-5` (subscription auth)
- Not observed on Opus turns in the same sessions (Opus days show zero summary artifacts)

## Evidence

**Incident (2026-09-14, ~16:34 UTC).** Sanitized entry-type sequence from the session `.jsonl` around the loss (line numbers from the file):

```
799 assistant TEXT (intro prose, stored verbatim — survives)
800 assistant tool_use: Read
801 user tool_result
803 assistant thinking (empty)
804 assistant thinking ← ~40-word SUMMARY of the missing text block
805 assistant tool_use: Edit
811 user tool_result
814 assistant TEXT (closing prose, stored verbatim — survives)
```

Between lines 801 and 805 the model emitted a four-paragraph text block (~2.4k chars) to the user. The UI displayed a summary of it (quote-block style); line 804 is that summary, stored as `thinking`. No `text` block containing the original exists anywhere in the file (verified by phrase search across all 848 lines).

**Baseline (the same measurement, previous 22 days).** We scanned our session transcripts and classified every assistant `text` block as mid-turn (a later `tool_use` occurs before the next real user message) or end-of-turn:

| Session span | Model | Mid-turn text blocks stored verbatim |
|---|---|---|
| 2026-08-23 → 09-06 (321 MB session) | fable | ~1,800 blocks, ~966k chars — including blocks >2,300 chars |
| 2026-09-06 → 09-14 (237 MB session) | fable | ~1,170 blocks, ~530k chars, present every single day |
| same session, Opus turns | opus | verbatim, zero summary artifacts |
| 2026-09-14 (session with the incident) | fable | 13 shorter mid-turn blocks stored verbatim; the one substantive block lost |

So storage of mid-turn text was verbatim and reliable for weeks — and in the incident session, *most* mid-turn text still stored fine. The loss is **selective/intermittent**, which is worse for users than a clean regime change: there is no way to know which prose survived without diffing against a memory of what was said.

## Impact

1. **Permanent loss of user-facing output.** The lost block was the substantive part of the turn (the reason the user asked "what did you actually say there?" — and the answer was recoverable only because the model's context window still held it).
2. **Transcript integrity.** The `.jsonl` now contains a paraphrase the model never wrote, typed as `thinking`. Anything downstream that consumes transcripts (export, resume/compaction, audit, user tooling) receives fabricated-looking content in place of real output.
3. **The recommended workaround is broken.** The guidance that emerged around the display-side issues — "the full text is in the transcript, check there" — no longer holds.

## Expected behavior

Summarize in the *display layer* if that's a product decision — but the stored transcript should always retain the verbatim assistant output, and content blocks should keep their true type (`text` addressed to the user must not be stored as `thinking`).

## Reproduction

Intermittent; observed with `claude-fable-5` on long multi-tool turns where a substantive (multi-paragraph) text block is emitted between tool calls. Shorter between-tool narration in the same session stored normally. Happy to provide additional sanitized structural detail from the affected transcript on request.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.