Skip to content

[BUG] No working mechanism to review previous context after compaction, plan-mode clear, or branch navigation — data preserved but UI inaccessible #27242

@scapeshift-ojones

Description

@scapeshift-ojones

Summary

Claude Code has no working way to review conversation history that has been cleared or compacted. The full data is always preserved in transcript.jsonl, but the TUI provides zero functional paths to access it. This affects three distinct scenarios:

  1. Post-compaction: Ctrl+O enters "transcript mode" (mislabeled as "history"), which shows only post-compaction messages. Ctrl+E toggles the status bar text but reveals no hidden content. Pre-compaction conversation is inaccessible.
  2. Post-plan-mode "clear context": Creates a new session with the plan injected as the first message. The exploration conversation that informed the plan is in a separate JSONL with no UI link back.
  3. Branch navigation: Right-arrow in the /resume picker (which used to allow browsing conversation branches) does nothing. Branch data is intact in JSONL with correct parentUuid linkage.

This is blocking. Users cannot audit Claude's reasoning after compaction, cannot review the exploration that led to a plan, and cannot navigate between conversation branches. The only workaround is manually parsing raw JSONL files, which is not a reasonable expectation for a TUI tool.

These bugs also compound with unfixed session discovery bugs in #26123 (closed prematurely, 49 👍) — index staleness and /rename names not showing in picker. The resume picker is the single gateway to all historical context and it's degraded at every level: can't find sessions, can't identify them, can't navigate branches within them, can't view pre-compaction history.

Environment

  • Version: 2.1.47 through 2.1.50 (confirmed on both; no fix in any release)
  • OS: macOS (Darwin 24.5.0)
  • Terminal: Ghostty (also reproduced in Terminal.app)
  • Platform: CLI (not VS Code extension)

Bug 1: Post-compaction — Ctrl+O and Ctrl+E do not show history

Steps to reproduce

  1. Run a long session until automatic context compaction triggers
  2. Observe the banner: ✻ Conversation compacted (ctrl+o for history)
  3. Press Ctrl+O — the TUI enters "Showing detailed transcript" mode
  4. Observe: only post-compaction messages are shown (compact summary + subsequent work)
  5. Press Ctrl+E — the status bar toggles between "ctrl+e to show all" / "ctrl+e to collapse"
  6. Observe: Ctrl+E toggles visibility of "Worked for 1m 40s" timing badges and task completion lines, but does not expand or reveal any pre-compaction content

What I see

✻ Conversation compacted (ctrl+o for history)
. fff
⏺ Compact summary
  ⎿  This session is being continued from a previous conversation...
     ...
     If you need specific details from before compaction, read the full
     transcript at: /path/to/session-uuid.jsonl
⏺ Task "Run tests" completed in background
⏺ Task "Verify GREEN state" completed in background
...
──────────────────────────────────────────────────
  Showing detailed transcript · ctrl+o to toggle · ctrl+e to show all

The banner says "ctrl+o for history" but Ctrl+O enters transcript mode, not a history viewer. The "ctrl+e to show all" text suggests expandable content, but pressing it only toggles timing badges.

What I expect

Ctrl+O (or some keybinding) should display the full pre-compaction conversation. The data exists in transcript.jsonl — there is no technical barrier to rendering it.

Root cause (from prior analysis)

In cli.js, transcript mode passes hidePastThinking: !0 (hardcoded true), hiding all thinking blocks except the last one. Source analysis by @carrotRakko on #16965. Community patch exists: aleks-apostle/claude-code-patches#9

But even beyond thinking blocks, the fundamental issue is that transcript mode does not load pre-compaction messages at all.


Bug 2: Post-plan-mode — "Clear context and accept edits" severs session history

Steps to reproduce

  1. Start a session and have Claude enter plan mode
  2. Claude explores the codebase, asks design questions, iterates on a plan
  3. Accept the plan with "clear context and accept edits"
  4. Observe: a new session is created with the plan text as the first user message
  5. The pre-plan exploration conversation is in the old session's JSONL
  6. There is no UI link between the two sessions

What I see

The new session starts clean with the plan pasted as a user message, including a note:

If you need specific details from before exiting plan mode (like exact code
snippets, error messages, or content you generated), read the full transcript
at: /path/to/old-session-uuid.jsonl

The pre-plan conversation (which may contain important architectural decisions, rejected approaches, and codebase exploration results) is only accessible by manually reading a raw JSONL file.

What I expect

At minimum: the /resume picker should show the relationship between the plan session and its predecessor. Ideally: the pre-plan conversation should be browsable from within the new session.

Evidence

Verified via JSONL analysis: the "clear context" operation creates a new session file. The old session's JSONL preserves the full exploration, but the new session's first message only contains the final plan text — no link to the old session UUID is stored in the JSONL metadata.


Bug 3: Branch navigation — right-arrow in /resume picker does nothing

Steps to reproduce

  1. Create a session with conversation branches (rewind to earlier points, take different paths):
    M.1 → M.2 → M.2.A → M.2.A2    (branch A)
                 M.2.B → M.2.B2    (branch B)
                 M.2.C → M.2.C2    (branch C)
                 M.2.D → M.2.D2    (branch D, current)
    
  2. Exit the session
  3. Run /resume
  4. Select the session in the picker
  5. Press right-arrow on the session line
  6. Observe: nothing happens — no branch picker, no visual change, no error

What I see

The /resume picker shows the session but right-arrow is completely unresponsive. Only the current branch (M.2.D path) is accessible.

What I expect

Right-arrow should expand the session to show branch points, allowing navigation between M.2.A, M.2.B, M.2.C, and M.2.D paths. This feature previously worked (estimated ~v2.1.31 timeframe, early February 2026).

Data is intact

JSONL analysis confirms the branch tree is perfectly preserved:

Node 449b88fa (M.2 response) has 4 children:
  → aad46fec: "now branching to M.2.A"   (isSidechain: false)
  → 2501f512: "now branching to M.2.B"   (isSidechain: false)
  → 3a73bb07: "now branching to M.2.C"   (isSidechain: false)
  → 64f1cfaa: "now branching to M.2.D"   (isSidechain: false)

All branches have correct parentUuid linkage and multi-child nodes. The isSidechain flag is never set to true on any branch (confirming #24471's analysis). This is a UI bug, not a data bug.


Consolidates / Related Issues

Direct (same root cause — data preserved, UI can't access it)

Issue Title Engagement Status
#26125 No way to view pre-compaction history — Ctrl+O/E broken 7 👍 Closed (duplicate) — predecessor to this issue
#24471 Rewind history lost after compaction (branching tree) 6 👍 Open
#9001 Scroll regression — cannot scroll conversation history 18 👍 Open
#18204 Compaction clears screen — can't scroll up 4 👍 2 ❤️ Open (stale)
#13446 After compaction terminal resets, can't scroll up 4 👍 Open (stale)
#23894 Sub-session visibility lost after v2.1.30 architecture change 2 👍 Open
#16965 Cannot read past thinking blocks with Ctrl+O 0 👍 Open
#21188 View full conversation history in UI 0 👍 Open (stale, enhancement)
#14511 Ctrl+O triggers transcript view, not verbose toggle 6 👍 Open (stale)
#19888 Compaction loses entire history, Ctrl+E unresponsive 5 👍 Open
#28324 Remote Control doesn't show chat history when resuming 0 👍 Open (new, Feb 24)

Compounding (session discovery/identification — you can't even get to the history)

Issue Title Engagement Status
#26123 /resume broken — 3 root causes, only 2 fixed 49 👍 Closed (prematurely — Bug 1 index staleness + Bug 4 /rename unfixed on v2.1.50)
#25032 sessions-index.json not updated, stale/missing sessions 9 👍 Open

Compaction side-effects (context corruption when compaction occurs)

Issue Title Engagement Status
#20696 Compaction intermittently fails or deadlocks chats 35 comments Open
#26220 Cascading failure: auto-compaction, /compact, rewind all fail 4 👍 Open
#27954 Thinking block skipped on first response after compaction 1 👍 Open (new, Feb 23)
#28303 User message truncated during auto-compact operation 0 👍 Open (new, Feb 24)
#23821 Subagent output files lost after context compaction 0 👍 Open
#25655 All plugin hooks stop firing after context compaction 2 👍 Open

Related proposals

Issue Title Engagement Status
#26771 Indexed transcript references in compaction summaries 22 👍 Open (enhancement)
#27293 Lossless context cleanup before auto-compaction 0 👍 Open
#27338 User questions lost from transcript during background subagents 0 👍 Open

Combined engagement: 140+ thumbs-up, 100+ comments across 20+ issues, multi-platform confirmation (macOS, Windows, Linux). Zero Anthropic team response on any of them as of v2.1.52.

All direct issues share a single root cause: Claude Code preserves conversation data in JSONL but provides no working UI to access it after the active context window moves forward.

Workarounds

  1. Parse raw JSONL: jq queries against transcript.jsonl — functional but defeats the purpose of a TUI
  2. Pre-compaction hooks: Community script by @EMarkODell auto-saves before each compaction
  3. Cozempic: Open-source context loss mitigation tool
  4. Community patch for thinking blocks: Update thinking patch for latest Claude Code aleks-apostle/claude-code-patches#9
  5. Avoid plan-mode "clear context": Manually copy pre-plan notes before accepting

Proposed Fix

A proper fix would address all three scenarios with a single feature: a scrollable history viewer that reads from transcript.jsonl, navigable via Ctrl+O or a new keybinding. This viewer should:

  1. Load and render the full transcript including pre-compaction messages
  2. Display thinking blocks (remove hidePastThinking: !0 hardcoding)
  3. Show branch points with navigation between branches
  4. For plan-mode sessions, link back to the predecessor session

The data layer is already correct — this is purely a UI/rendering gap.

Pinned by stevenpetryk

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions