Claude Code session

Claude Compaction Viewer

A TUI and CLI tool for inspecting Claude Code conversation history and compaction events.

74 stars 3 forksSessions & history Source

Install

Install
uv tool install claude-compaction-viewer

Found in the project README. Check it for setup steps after installing.

From source
git clone https://github.com/swyxio/claude-compaction-viewer.git

From the README

Claude Code Compaction Viewer

A TUI and CLI tool for inspecting Claude Code conversation history and compaction events.

What is compaction?

When a Claude Code session runs long, the context window fills up. Rather than crashing or losing everything, Claude Code performs compaction: it inserts a boundary marker in the conversation, generates a structured summary of everything before it, and continues with the summary replacing the full history in the active context.

The full conversation is preserved on disk in JSONL files at ~/.claude/projects/. This tool lets you see exactly what happened:

- Where compaction boundaries were inserted
- What the compressed summary contains (the "outcome" of compaction)
- How many tokens were in context before each compaction triggered
- Whether compaction was auto-triggered or manual (/compact)

Inspired by Tal Raviv's article on doing "brain surgery" on Claude Code.

Install

Usage

Scan all conversations for compactions

Prints a table of every Claude Code conversation across all your projects, highlighting which ones have compaction events:

View compaction summaries

Prints full details for each compaction event — the trigger, token count, and the complete summary text that Claude sees after compaction.

Interactive TUI

Launches a full terminal UI:

- Left sidebar: tree of all Claude Code projects and conversation files
- Stats bar: message counts, token usage, model, duration
- Compaction bar: highlighted summary of all compaction events
- Message table: scrollable list of every message (user, assistant, tool calls, system)
- Detail panel: full content of selected message with metadata

TUI Keybindings

You can also open a specific file directly:

How Claude Code stores conversations

Claude Code saves every conversation as a…
Read the full README on GitHub

Details

Language
Python
License
MIT
Last updated
5 March 2026

FAQ

What is Claude Compaction Viewer?

A TUI and CLI tool for inspecting Claude Code conversation history and compaction events. It is a session for Claude Code, from swyxio/claude-compaction-viewer on GitHub.

How do I install Claude Compaction Viewer?

Run uv tool install claude-compaction-viewer, then follow the setup in the README.

Is Claude Compaction Viewer popular?

swyxio/claude-compaction-viewer has 74 GitHub stars and 3 forks. It was last updated on 5 March 2026.

More sessions & history

Browse the most popular Claude Code mods, all sessions & history, or the skills and MCP server directories.