Skip to main content

cchist

Python License tests

One place to browse, search and resume all your AI coding sessions — across Claude Code and Codex.

中文说明 →

Claude Code and Codex scatter every conversation into per-project folders (~/.claude/projects/…, ~/.codex/sessions/…). Over time they become impossible to navigate: --resume only shows an auto-generated title, and the sessions are spread across a dozen directories.

cchist flattens them all into one view. Search by title or full text, see the first & last message and turn counts, jump back into any session (it cds to the original directory and resumes), and safely clean up throwaway chats.

Two frontends, one core:

  • Terminal TUI (default) — keyboard-driven, press Enter to resume seamlessly
  • Web UI (cchist web) — nicer to read long transcripts, export, and view stats

Features

🔀 Multi-agent Unifies Claude Code and Codex sessions in one list
🗂 Cross-project Every folder flattened into one view; sort by time / source / project / turns / size
🔍 Search Filter by title / path / first & last message, or full-text scan the transcript
↩️ Seamless resume Enter runs claude --resume / codex resume in the original directory
🗑 Safe delete Trash first (recoverable); empty & orphaned sessions auto-flagged
🧹 Batch cleanup Move all empty / orphaned sessions to trash at once
⬇️ Export Export any conversation to Markdown
📊 Stats Web overview: sessions-per-day trend and per-project breakdown
Favorites Star important sessions
🌐 Bilingual English / 中文 UI (auto-detected, or set CCHIST_LANG)
🔧 Portable Env-var overridable paths; Linux / macOS / Windows; Python 3.9+

Install

pip install --user "cchist[web]"     # from PyPI, with the web UI
# or from source:
git clone https://github.com/Zephyrus704/cchist.git && cd cchist && pip install --user ".[web]"

If cchist: command not found, add ~/.local/bin to your PATH: export PATH="$HOME/.local/bin:$PATH".

Usage

cchist              # terminal UI (default)
cchist web          # web UI (opens the browser)
cchist web --port 9000 --no-browser
cchist --help

TUI keys

Key Action
↑/↓ Move
Enter Open (cd + resume)
/ Focus search
g Toggle full-text search
Click header / s Sort by column; click again to reverse
e Export selected to Markdown
f Favorite / unfavorite
d Delete (move to trash)
c Batch-clean empty / orphaned
t View trash
r Restore from trash
Ctrl+D Empty trash
Ctrl+P Command palette
q Quit

Web UI notes

cchist web starts a local server (default http://127.0.0.1:8770).

  • Stop it from the terminal with Ctrl+C, or click ⏻ Stop server in the top-right. ⚠️ Closing the browser tab does not stop the server.
  • It binds to 127.0.0.1 only. Do not expose it with --host 0.0.0.0.

How it works

Each tool stores sessions as JSONL with the working directory and every message:

  • Claude Code~/.claude/projects/<slug>/<session-id>.jsonl
  • Codex~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl

cchist only reads them. A small Provider abstraction (providers.py) knows each tool's location, format and resume command; everything else (trash, search, sort, export, UI) is provider-agnostic. Resume writes a signal file, then the CLI wrapper os.execvps into the real tool so the terminal is handed over cleanly.

cchist never modifies your conversation files — it only moves/deletes them, and deletes go to a recoverable trash first.

Override storage locations with CLAUDE_CONFIG_DIR and CODEX_HOME.

Project layout

src/cchist/
├── config.py      path config
├── providers.py   per-tool adapters (Claude, Codex)
├── core.py        data layer: scan / parse / search / trash / export (stdlib only)
├── resume.py      cross-platform resume
├── i18n.py        English / 中文 strings
├── tui.py         terminal UI (textual)
├── cli.py         CLI entry & subcommands
└── web/           FastAPI backend + build-free frontend

Development

pip install ".[dev,web]"
pytest

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cchist-0.3.0.tar.gz (35.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cchist-0.3.0-py3-none-any.whl (35.4 kB view details)

Uploaded Python 3

File details

Details for the file cchist-0.3.0.tar.gz.

File metadata

  • Download URL: cchist-0.3.0.tar.gz
  • Upload date:
  • Size: 35.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for cchist-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b8671e1cd0d1306cc9eebf352bcea7ed40fda0c07b38aa67505ff40e97a253ee
MD5 8fe4b8d8e3e39aa74009858c4775960d
BLAKE2b-256 47ed95df53a5d39f2dfd1f33524c8c5f2dc8971ea553dd39e04b3d2b0865cabb

See more details on using hashes here.

File details

Details for the file cchist-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: cchist-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 35.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for cchist-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eaacb7584fb383588f50dfc1aaef8b0fa4ac12ca89162b3a066a28636422ccf1
MD5 34583d117884f294468d7607ea8f952f
BLAKE2b-256 231b77e3e712eae160ebeb04cec06c9637d6033049202f9e3d7304a7f12d883a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page