Browse and search Claude Code conversation history from the terminal.
Project description
cchat
Browse and search Claude Code conversation history from the terminal.
cchat reads the JSONL conversation logs that Claude Code stores in ~/.claude/projects/ and presents them as readable conversation turns. It handles compaction stitching, branch detection, and the full UUID tree structure so you don't have to parse raw JSONL yourself.
Install
pip / pipx
pip install cchat
# or
pipx install cchat
curl (no pip needed)
curl -fsSL https://raw.githubusercontent.com/asparagusbeef/cchat/main/cchat.py \
-o ~/.local/bin/cchat && chmod +x ~/.local/bin/cchat
wget
wget -qO ~/.local/bin/cchat \
https://raw.githubusercontent.com/asparagusbeef/cchat/main/cchat.py && chmod +x ~/.local/bin/cchat
PowerShell (Windows without WSL)
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/asparagusbeef/cchat/main/cchat.py" `
-OutFile "$env:LOCALAPPDATA\cchat\cchat.py"
Note: cchat reads
~/.claude/projects/which is a Linux/macOS path. On native Windows (not WSL), Claude Code may store data differently.
Quick start
# List recent sessions in the current project
cchat list
# View the last 5 turns of the latest session
cchat view
# View a specific session (by index from list)
cchat view 2
# Search across all sessions
cchat search "error handling"
Commands
| Command | Alias | Description |
|---|---|---|
cchat list [N] |
ls |
List recent sessions (default: 10) |
cchat view [SESSION] |
v |
View conversation turns |
cchat copy [SESSION] |
cp |
Copy messages to clipboard (WSL) |
cchat search PATTERN |
s |
Search across sessions |
cchat tree [SESSION] |
Show conversation tree structure | |
cchat export [SESSION] |
Export full session (markdown or JSON) | |
cchat projects |
List all projects |
View options
| Flag | Description |
|---|---|
-n N |
Show last N turns |
-r RANGE |
Show specific turns: 5, 3-7, -1, -3--1 |
--all |
Show all turns |
--tools |
Show tool call summaries |
--raw |
Show everything (tool I/O, thinking, system) |
--json |
Output as JSON |
--no-stitch |
Don't bridge compaction boundaries |
--timestamps |
Show timestamps |
--compact-summaries |
Include compaction summary messages |
--truncate LEN |
Truncate length for raw content (default: 500) |
-p PATH |
Use a different project directory |
Session selection
Sessions can be specified by:
- Index:
cchat view 2(2nd most recent fromcchat list) - UUID prefix:
cchat view a1b2c3(matches session ID) - Omitted: uses the most recent session
How it works
Claude Code stores each conversation as a JSONL file in ~/.claude/projects/<project-key>/. Each line is a JSON entry with a type (user, assistant, system, etc.) and a UUID-based parent-child tree.
cchat:
- Resolves the active path by walking the UUID tree from the last entry backward
- Stitches across compaction boundaries using
logicalParentUuidlinks (or positional fallback) - Groups entries into turns (one user message + full assistant response)
- Detects branch points by filtering out mechanical fan-out (tool_use forks, progress entries)
Requirements
- Python 3.8+
- No dependencies (stdlib only)
- Clipboard copy uses
clip.exe(WSL) — other platforms not yet supported
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cchat-0.1.0.tar.gz.
File metadata
- Download URL: cchat-0.1.0.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1b93df9a0bd7484441a7755569ae095e695de70bd02a88f5f0213cb20b21bc8
|
|
| MD5 |
79171654d51f28a4dcf075b04b6de29f
|
|
| BLAKE2b-256 |
9c2b3705ca10773989138cfacbea96610412ad4cad0004d05bf7916695972a60
|
Provenance
The following attestation bundles were made for cchat-0.1.0.tar.gz:
Publisher:
publish.yml on asparagusbeef/cchat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cchat-0.1.0.tar.gz -
Subject digest:
b1b93df9a0bd7484441a7755569ae095e695de70bd02a88f5f0213cb20b21bc8 - Sigstore transparency entry: 886090891
- Sigstore integration time:
-
Permalink:
asparagusbeef/cchat@fc1de2d3cba2eef59953dd714cbeae093a5a02d5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/asparagusbeef
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fc1de2d3cba2eef59953dd714cbeae093a5a02d5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cchat-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cchat-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac53b812c37ab6dfb5aeef5cb6a640f0d85324072faa9d836b20a7d9eb342903
|
|
| MD5 |
131f9efdad8ee42166be52bea8a482c6
|
|
| BLAKE2b-256 |
4bad161ecfe9902a2b8ed0b8704306c32e770e40e7f3da47d8858f1546c28d60
|
Provenance
The following attestation bundles were made for cchat-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on asparagusbeef/cchat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cchat-0.1.0-py3-none-any.whl -
Subject digest:
ac53b812c37ab6dfb5aeef5cb6a640f0d85324072faa9d836b20a7d9eb342903 - Sigstore transparency entry: 886090953
- Sigstore integration time:
-
Permalink:
asparagusbeef/cchat@fc1de2d3cba2eef59953dd714cbeae093a5a02d5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/asparagusbeef
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fc1de2d3cba2eef59953dd714cbeae093a5a02d5 -
Trigger Event:
push
-
Statement type: