claude-code - 💡(How to fix) Fix [FEATURE] UX: /compact should preserve original conversation in history and continue in a new session [3 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49146Fetched 2026-04-17 08:49:35
View on GitHub
Comments
3
Participants
3
Timeline
5
Reactions
0
Author
Timeline (top)
commented ×3labeled ×2

Fix Action

Fix / Workaround

Current workaround:

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

When /compact is triggered (manually or automatically), the current behavior compacts the conversation in place: the original messages are replaced by a summary within the same session. The original JSONL file is preserved on disk, but it becomes inaccessible from the Claude Code UI — it no longer appears as a distinct entry in the conversation history.

Why this matters:

The compaction summary is necessarily lossy. In a real use case today, a detail from before compaction was missing from the summary — and the only way to recover it was to manually locate the UUID-named JSONL file on disk and parse it. That is not a reasonable expectation for most users.

The proposed behavior would make compaction feel like turning a page, not erasing one.

Current workaround:

The user can manually note the JSONL path before compacting and provide it explicitly in the new session, but this requires knowing where the files are stored and is not discoverable.

Proposed Solution

Expected / proposed behavior:

The original conversation remains visible in the history as a closed/archived session. A new session is automatically created, pre-seeded with the compacted summary as context. The user can navigate back to the original session if they need to review what was said before compaction.

Alternative Solutions

No response

Priority

High - Significant impact on productivity

Feature Category

Interactive mode (TUI)

Use Case Example

No response

Additional Context

No response

extent analysis

TL;DR

Modify the compaction behavior to preserve the original conversation in the history and create a new session with the compacted summary.

Guidance

  • Review the current compaction logic to identify where the original conversation is being replaced, and modify it to instead create a new session with the compacted summary.
  • Update the conversation history display to show the original conversation as a closed or archived session, allowing users to navigate back to it if needed.
  • Consider adding a clear indicator or link to the original conversation in the new session, to facilitate easy access to the archived conversation.
  • Test the modified compaction behavior to ensure it works as expected and does not introduce any regressions.

Example

No code snippet is provided as the issue does not contain specific implementation details.

Notes

The proposed solution requires changes to the compaction logic and conversation history display, which may involve updates to the UI and backend code. The exact implementation details are not provided in the issue.

Recommendation

Apply workaround: Modify the compaction behavior to preserve the original conversation in the history and create a new session with the compacted summary, as this addresses the significant impact on productivity and provides a better user experience.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [FEATURE] UX: /compact should preserve original conversation in history and continue in a new session [3 comments, 3 participants]