Chathist banner
shuntaka9576 shuntaka9576

Chathist

AI community

Description

📜 A lightweight CLI tool to view and export your AI coding agent's chat history.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

chathist

A lightweight CLI tool to view and export your AI coding agent's chat history—currently optimized for Claude Code.

Built for speed and flexibility, chathist hooks into fzf / fzf-tmux to let you breeze through past sessions with instant previews. It’s fully customizable via Lua configuration and Jinja2 templates, so you can tailor the output to your exact workflow.

![img](asset/chathist-demo.gif)

Installation

Brew (MacOS)

brew install shuntaka9576/tap/chathist

Cargo (git)

git clone https://github.com/shuntaka9576/chathist
cd chathist
cargo install --path .

Getting Started

`chathist` is designed to pair perfectly with `fzf`.

`chathist list` appends normalized conversation text as an extra tab-separated field, so you can search by message body with `fzf` while keeping the session ID in the first column for previews and selection.

Zsh Integration

Add this to your `.zshrc` to get a unified session picker on `Ctrl+H`.

**Session picker keybindings (inside fzf)**

Key Action
Tab Multi-select sessions
Shift+Up/Down Scroll preview
Ctrl+S Switch to cross-worktree mode
Ctrl+A Switch to all repositories mode
Ctrl+D Switch back to current project

After selecting sessions, you choose an action.

Action Description
resume Resume the session in Claude Code (claude --resume)
open Open in editor with a template
function chathist-widget() {
  local selection=$(chathist list | fzf-tmux --multi \
    --delimiter=$'\t' \
    --with-nth=2.. \
    --header 'ctrl-s: cross-worktree / ctrl-a: all repos / ctrl-d: current project' \
    --preview 'chathist pick {1} --stdout' \
    --preview-window 'right:45%:wrap' \
    --bind 'ctrl-s:reload(chathist list -w)+change-preview(chathist pick -w {1} --stdout)+change-header(cross-worktree | ctrl-a: all repos | ctrl-d: current project)' \
    --bind 'ctrl-a:reload(cha