claude-hist A developer created claude-hist, a command-line tool that uses fzf to fuzzy-find and resume past Claude Code sessions across all projects. The tool searches session titles, git branches, and conversation text, then automatically changes to the working directory and runs `claude --resume`. | /usr/bin/env bash | | | set -euo pipefail | | | claude-hist: fuzzy-find a past Claude Code session across every project and | | | resume it. Search matches titles/branches first, then conversation text. | | | Sessions list newest first with each parent's subagents grouped beneath it; | | | selecting a subagent resumes its parent. Selecting a session cd's to its | | | working directory and runs claude --resume . A bottom preview pane shows the | | | transcript PgUp/PgDn scroll it, arrow keys move the selection with query | | | terms highlighted. | | | | | | Usage: claude-hist --rebuild | | | --rebuild Discard the metadata cache and rebuild it from scratch. | | | | | | Deps: fzf, jq, claude perl optional, for preview highlighting . | | | PROJECTS DIR="$HOME/.claude/projects" | | | CACHE DIR="${XDG CACHE HOME:-$HOME/.cache}/claude-hist" | | | CACHE FILE="$CACHE DIR/index.tsv" | | | C HEADER=$'\033 1;36m' user turns | | | C CLAUDE=$'\033 1;32m' claude turns | | | C META=$'\033 2m' dim meta line | | | C LINK=$'\033 1;33m' subagent - parent link line | | | C RESET=$'\033 0m' | | | usage { | | | cat <<'EOF' | | | claude-hist: fuzzy-find a past Claude Code session across every project and | | | resume it. Searches session title, branch, and conversation text, newest first. | | | Selecting a session cd's to its working directory and runs claude --resume . | | | The preview pane shows the transcript PgUp/PgDn scroll it; arrows move the | | | selection with matched query terms highlighted. | | | Usage: claude-hist --rebuild | | | --rebuild Discard the metadata cache and rebuild it from scratch. | | | Deps: fzf, jq, claude perl optional, for preview highlighting . | | | EOF | | | } | | | die { echo "claude-hist: $ " &2; exit 1; } | | | Batch-stat command emitting "