[BUG] "Compacted (ctrl+o to see full summary)" — Ctrl+O never renders the compact summary, though it is stored in the JSONL with isVisibleInTranscriptOnly: true

Status Closed — not planned
Reported on v2.1.220
Maintainer reply ✓ Yes — bcherny
Activity 4 comments · opened Jul 30, 2026 · closed Aug 24, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Summary

After compaction the TUI prints:

⎿ Compacted (ctrl+o to see full summary)

Pressing Ctrl+O switches to Showing detailed transcript, but the compact summary is never rendered. The line stays collapsed exactly as before — no Compact summary block, no summary body, nothing. The affordance the UI advertises does not exist.

This is a rendering bug only: the summary text is persisted correctly in the session JSONL, and the record is even explicitly flagged for transcript display. The TUI just doesn't show it.

Environment

  • Version: 2.1.220 (Claude Code CLI)
  • OS: macOS 26.6 (Darwin 25.6.0)
  • Terminal: iTerm2

Steps to reproduce

  1. Run a long session, then run /compact (manual trigger; auto-compaction behaves the same).
  2. After compaction, observe the collapsed line: Compacted (ctrl+o to see full summary).
  3. Press Ctrl+O.
  4. Footer changes to Showing detailed transcript · ctrl+o to toggle · ↑↓ scroll · v to open in code.
  5. Scroll to the compaction point.

Expected

The full compact summary is displayed (as it used to be, rendered as a Compact summary block).

Actual

Only the same collapsed one-liner plus the post-compaction tool lines (Read …, Referenced file …, Skills restored …). The summary body is nowhere in the transcript view. Ctrl+O toggling has zero effect on that line.

Evidence that the data is present

From the session JSONL, the message immediately after the compact_boundary system record:

{
  "parentUuid": "90523a41-bb8b-4225-81fb-20444328ae75",
  "type": "user",
  "isVisibleInTranscriptOnly": true,
  "isCompactSummary": true,
  "uuid": "9bd2cd48-effd-4903-b247-cb1b2fad50cc",
  "timestamp": "2026-07-30T07:56:53.689Z",
  "sessionId": "d72da877-…",
  "version": "2.1.220",
  "message": {
    "role": "user",
    "content": "This session is being continued from a previous conversation that ran out of context. The summary below covers the earlier portion of the conversation.\n\nSummary:\n## 1. …"
  }
}
  • message.content length: 12030 chars — the summary is complete.
  • The preceding record is {"type":"system","subtype":"compact_boundary","compactMetadata":{"trigger":"manual","preTokens":897264,"postTokens":14684,…}}.
  • Note "isVisibleInTranscriptOnly": true — this record is explicitly marked as the thing transcript mode should render, yet transcript mode skips it. That flag looks like the most likely place the regression lives: the transcript renderer appears to filter out isCompactSummary messages (or drops isVisibleInTranscriptOnly records) instead of rendering them.

Reproduced across two separate compactions in the same session (boundaries at 2026-07-26T18:39:58Z and 2026-07-30T07:56:54Z); both stored a valid summary (16081 and 12030 chars), neither is viewable via Ctrl+O.

Impact

The compact summary is the only remaining representation of everything that was dropped from context (here: 897k → 15k tokens, 1.7M cumulative dropped tokens). Being unable to read it means there is no in-TUI way to check what the model actually kept — which matters a lot when using /compact with custom instructions, since you can't verify the instructions were honored. The only workaround is jq-ing the raw JSONL.

Regression note

Older reports (e.g. #27242) show a ⏺ Compact summary block was rendered in transcript mode on ~2.1.47–2.1.52, with the complaint being about pre-compaction history. On 2.1.220 even the summary itself is gone, and the label changed to the more explicit "ctrl+o to see full summary" — so the promise got stronger while the behavior got worse.

Related but distinct: #27242 (no access to pre-compaction history — that's about the dropped messages; this is about the summary that replaced them).

Suggested fix

Render isCompactSummary: true / isVisibleInTranscriptOnly: true user messages in transcript mode (Ctrl+O), or — if they are intentionally hidden — change the label so it stops advertising an action that does nothing.

View original on GitHub ↗

3 Comments

dekrezz · 1 month ago

Confirmation: the summary is fully intact on disk — this is purely a TUI rendering gap

Extracted both compact summaries from the same session file with a one-liner:

jq -r 'select(.isCompactSummary == true) | .message.content' \
  ~/.claude/projects/<project>/<session-id>.jsonl

Result — two complete, well-formed summaries:

| compaction | timestamp | chars | trigger | preTokens → postTokens |
|---|---|---|---|---|
| 1 | 2026-07-26T18:39:58Z | 16081 | manual | 843473 → 21678 |
| 2 | 2026-07-30T07:56:53Z | 12030 | manual | 897264 → 14684 |

The second one (the one in the screenshot) contains the full 9-section structure the compaction prompt produces — ## 1. Что было сделано## 9. Следующий шаг — plus the trailing instructions block (If you need specific details from before compaction… read the full transcript at: <path> / Continue the conversation from where it left off…). Nothing is truncated, nothing is empty.

So the pipeline is fine end-to-end:

  1. summary generated ✅
  2. written to JSONL as type: user, isCompactSummary: true
  3. flagged isVisibleInTranscriptOnly: true — i.e. explicitly marked as transcript-mode-only content
  4. UI advertises Compacted (ctrl+o to see full summary)
  5. Ctrl+O renders nothing

Only step 5 is broken. Given flag (3) exists specifically so this record shows up in transcript mode, the regression is almost certainly in the transcript renderer's filter — it drops isVisibleInTranscriptOnly / isCompactSummary records instead of rendering them.

Worth noting the practical cost: /compact was invoked with custom instructions here (не включать в компакт мои сообщения… — "don't include my messages in the compact, only what we did"). Whether those instructions were honored is only verifiable by reading the summary. With Ctrl+O dead, jq on the raw JSONL is the sole way to check that a user-facing feature did what it was told.

bcherny collaborator · 14 days ago

Thanks for the detailed report. I tried to reproduce this on the current release, 2.1.233 (macOS): ran a short session, ran /compact, then pressed Ctrl+O. In the detailed transcript view a ⏺ Compact summary block with the full summary text was rendered right at the compaction point, and it stayed visible after many more messages were added. So on 2.1.233 the summary does show under Ctrl+O.

One thing that may explain what you saw: outside fullscreen mode, the Ctrl+O transcript view only shows the most recent ~30 messages and puts a ctrl+e to show N previous messages divider at the top. After a large compaction, the summary is followed by the preserved recent messages plus the post-compaction Read … / Referenced file … / Skills restored … lines, so the summary can fall above that window and only appears after pressing Ctrl+E. We agree the Compacted (ctrl+o to see full summary) hint is misleading in that case and are looking at keeping the summary in view / clarifying the hint.

Could you check on 2.1.233 whether pressing Ctrl+E while in the Ctrl+O view reveals the summary? If it still doesn't appear at all, please share your terminal, whether the session was resumed with --resume, and claude doctor output.

🤖 Generated with Claude Code

github-actions[bot] · 14 days ago

We weren't able to reproduce this. Could you provide steps to trigger the issue — what you ran, what happened, and what you expected? This issue will be closed automatically if there's no activity within 7 days.

Showing cached comments. Read the full discussion on GitHub ↗