[BUG] UI: Conversation transcript duplicates on each auto-compaction in long sessions

Resolved 💬 3 comments Opened Apr 20, 2026 by calmog Closed May 28, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When a conversation runs long and auto-compaction fires multiple times,
the UI renders the full transcript on top of itself once per compaction
cycle. Result: N compactions → each message appears N times in the window.

What Should Happen?

## Expected
Each message appears exactly once regardless of compaction count.

## Actual
Every message duplicated N times (N = number of compaction cycles).

## Confirmed: Data is NOT corrupted
Checked underlying JSONL files — no duplicate entries. Duplication is
purely in the UI rendering layer. Token consumption is unaffected.

## Environment

  • Claude Code version: 2.1.107
  • Platform: macOS Darwin 24.6.0 (Apple Silicon)
  • Shell: zsh

## Workaround
None that preserves history. /clear avoids it but destroys the session —
not viable when compaction is the intended mechanism for long sessions.

Error Messages/Logs

Steps to Reproduce

  1. Open a long-running session (4+ MB JSONL, multiple tool calls over hours)
  2. Let auto-compaction fire multiple times in the same session
  3. Scroll through the conversation — all messages appear duplicated N times

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.114

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗