[BUG] Long assistant text blocks missing from session .jsonl in plan-mode session with interrupts (rendered text lost too; related #79584)

Status Open
Reported on v2.1.216
Maintainer reply None cached
Activity 1 comment · opened Jul 23, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet (closest is #79584, which covers the display half but explicitly found the transcript intact; this report is about the transcript losing the text)
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code (2.1.216; #79584 reports the display symptom persisting on 2.1.217)

What's Wrong?

In a long interactive session, every assistant text block longer than ~190 characters is silently missing from the session transcript (<project>/<session-id>.jsonl). The session has 14 persisted text blocks, all ≤186 chars (the short "status line" texts the assistant emits before tool calls). Every substantive multi-paragraph text block the assistant produced in the session — at least 8 of them, roughly 500–4,000 chars each — has no record in the file. The phrases from those messages appear in the .jsonl only where they were quoted inside later tool_use inputs (e.g. an AskUserQuestion the assistant used to re-deliver the lost content).

Two related observations:

  1. Most of the missing-from-disk messages were also never rendered in the TUI — the user saw only the tool dialog that followed the text. That display symptom matches open issue #79584 (text before a tool call in the same turn not rendered, esp. AskUserQuestion).
  2. At least one missing-from-disk message WAS rendered and the user replied to its content point by point. So the transcript loss is not just "unrendered text was never written": rendered text is being dropped from persistence too. A commenter on #79584 found the opposite on their setup (lost text fully persisted, display-only loss), which suggests this is a distinct or additional failure mode.

Sibling sessions in the same project directory (same CLI version 2.1.216, same model, same machine, previous days) persist text blocks up to ~5,000 chars fine. What distinguishes the affected session:

| session | text blocks persisted | max text len | plan-mode records | tool-rejection interrupts |
|---|---|---|---|---|
| affected | 14 | 186 | 25 | 8 |
| sibling 1 | 75 | 5004 | 0 | 0 |
| sibling 2 | 8 | 2122 | 0 | 0 |
| sibling 3 | 39 | 5013 | 0 | 0 |
| sibling 4 | 49 | 3210 | 0 | 0 |

The affected session is the only one that used plan mode and the only one where the user interrupted/rejected tool calls (Esc on AskUserQuestion / ExitPlanMode / Edit). Every turn in it that contained a long text block was eventually interrupted somewhere before the turn ended; short text blocks from those same turns persisted. Model was claude-fable-5 throughout all five sessions, so interleaved thinking + text + tool_use turn shapes are common to all of them.

What Should Happen?

Every assistant text block should be appended to the session .jsonl (and rendered). Transcript loss is worse than the display loss in #79584: --resume and context compaction rebuild from the transcript, so the conversation content is permanently gone, including messages the user saw and replied to — the record no longer supports the replies that reference it.

Error Messages/Logs

# affected session: all persisted assistant text blocks are short status lines
$ jq -r 'select(.type=="assistant") | .message.content[]? | select(.type=="text") | .text | length' <session>.jsonl | sort -n | tail -3
146
186   # <- maximum; the session produced many 500–4,000 char messages

# distinctive phrase from a long message the user demonstrably read and replied to:
$ grep -c "<distinctive phrase from that message>" <session>.jsonl
0     # matches only appear inside later tool_use inputs that re-quoted it

# sibling session, same version/model/machine, no plan mode, no interrupts:
$ jq -r '... | length' <sibling>.jsonl | sort -n | tail -1
5004

Steps to Reproduce

Best-effort; the trigger correlates with interrupted turns, and #79584 calls the display half intermittent:

  1. Start an interactive session in plan mode ("tui": "fullscreen" was set here; unconfirmed whether it matters — but note the jsonl writer shouldn't depend on the renderer at all).
  2. Drive an extended design discussion so the assistant repeatedly emits a multi-paragraph text block followed by a tool call in the same turn (AskUserQuestion or ExitPlanMode produce this shape constantly in plan mode).
  3. Interrupt/reject some of those tool calls (Esc), reply, and continue for several such rounds.
  4. After the session, extract assistant text blocks from the session .jsonl (jq command above) and grep for distinctive phrases from the long messages.
  5. Observed: the long text blocks are absent from the transcript (and most were never rendered); only short pre-tool status lines persist.

Claude Model

Other: claude-fable-5

Is this a regression?

I don't know

Claude Code Version

2.1.216 (Claude Code)

Platform

Anthropic API

Operating System

macOS (Darwin 25.5.0)

Terminal/Shell

Other: Ghostty, with "tui": "fullscreen" enabled

Additional Information

  • Related: #79584 (assistant text before a tool call intermittently not rendered). This report adds: on this setup the text is also missing from the session .jsonl, including at least one message that was rendered, contradicting the display-layer-only conclusion there.
  • The affected session also ran background subagents (Task tool) and received queued user messages mid-turn, in case those matter.
  • The ~190-char boundary is an observation across 14 persisted vs ~8 missing blocks, not a proven threshold.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗