{"id":48085877,"url":"https://github.com/ay-bh/chat-history","last_synced_at":"2026-04-08T17:00:36.976Z","repository":{"id":345611774,"uuid":"1186642121","full_name":"ay-bh/chat-history","owner":"ay-bh","description":"Search, inspect, and export Claude Code + Cursor conversation history","archived":false,"fork":false,"pushed_at":"2026-03-23T19:44:54.000Z","size":141,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-04T16:12:05.260Z","etag":null,"topics":["agent-skill","ai-agent","ai-tools","chat-history","claude","claude-code","cli","context","conversation-history","cursor","cursor-ide","developer-tools","llm","rust","search","session-history","transcript"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/chat-history","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ay-bh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-19T20:57:38.000Z","updated_at":"2026-03-23T15:05:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ay-bh/chat-history","commit_stats":null,"previous_names":["ay-bh/chat-history"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ay-bh/chat-history","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ay-bh%2Fchat-history","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ay-bh%2Fchat-history/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ay-bh%2Fchat-history/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ay-bh%2Fchat-history/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ay-bh","download_url":"https://codeload.github.com/ay-bh/chat-history/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ay-bh%2Fchat-history/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31564915,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-skill","ai-agent","ai-tools","chat-history","claude","claude-code","cli","context","conversation-history","cursor","cursor-ide","developer-tools","llm","rust","search","session-history","transcript"],"created_at":"2026-04-04T15:18:02.505Z","updated_at":"2026-04-08T17:00:36.957Z","avatar_url":"https://github.com/ay-bh.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chat-history\n\nA fast Rust CLI to search, inspect, and export **Claude Code** and **Cursor** conversation history.\n\nScoring logic ported from [claude-historian-mcp](https://github.com/Vvkmnn/claude-historian-mcp), [claude-history](https://github.com/raine/claude-history), and [search-sessions](https://github.com/sinzin91/search-sessions), with Cursor transcript parsing inspired by [cursor-history](https://github.com/S2thend/cursor-history).\n\n## Install\n\nRequires [Rust](https://rustup.rs/). Then:\n\n```bash\ncargo install chat-history\n```\n\nThis installs both `chat-history` and `ch` (short alias) into `~/.cargo/bin/`.\n\n### Install the agent skill (recommended)\n\n```bash\nchat-history install-skill\n```\n\nThis writes the bundled `SKILL.md` to `~/.cursor/skills/chat-history/` and `~/.claude/skills/chat-history/`, giving Claude Code and Cursor agents the ability to search your conversation history automatically. Re-run after upgrading to pick up skill updates.\n\n### Build from source\n\n```bash\ngit clone https://github.com/ay-bh/chat-history.git\ncd chat-history\ncargo install --path .\n```\n\n## Quick start\n\n```bash\nchat-history                               # list all sessions, newest first\nchat-history --from yesterday -s           # yesterday's sessions, grouped by day\nchat-history search \"auth error\"           # fast index search (sub-second)\nchat-history search \"auth error\" --deep    # full transcript search (thorough)\nchat-history inspect --last                # session summary with accomplishments\nchat-history view --last --plain | head    # pipe transcript to other tools\n```\n\n`ch` works as a drop-in alias for `chat-history`:\n\n```bash\nch search \"docker config\"\nch inspect --last\n```\n\n## Commands\n\n### List sessions (default)\n\n```bash\nchat-history                               # all sessions\nchat-history -L                            # current workspace only\nchat-history --source claude               # Claude Code sessions only\nchat-history --source cursor               # Cursor sessions only\nchat-history --from 2026-03-01 --to 2026-03-20\nchat-history --from yesterday              # natural language dates\nchat-history --from \"3 days ago\"           # relative dates\nchat-history --from \"last week\" --to today\nchat-history --branch feature-xyz          # filter by git branch\nchat-history -k \"auth\" -v                  # keyword filter, show IDs/paths\nchat-history -s                            # group by day\n```\n\n### Scored search\n\nBy default, search checks session metadata (summary, first prompt, branch) without parsing transcript files. This is fast — sub-second. Weak index results (★ \u003c 5.0) automatically fall through to deep transcript search. Use `--deep` to force full transcript search, or `--scope` for specialized searches.\n\n```bash\n# Fast index search (sub-second, checks summary/prompt/branch)\nchat-history search \"docker auth\"\nchat-history search \"trade_assets\"         # _ treated as word separator\nchat-history search \"auth\"                 # prefix: matches \"authentication\"\n\n# Deep transcript search (searches inside messages)\nchat-history search \"docker auth\" --deep\nchat-history search \"fix\" --scope errors   # only error patterns\nchat-history search \"trade\" --scope similar  # find similar past queries\nchat-history search \"Edit\" --scope tools   # tool usage patterns\nchat-history search \"config\" --scope files # file operations\nchat-history search \"e7d318b1-...\"         # UUID direct lookup\nchat-history search \"auth\" --timeframe week  # time window: today/week/month/Nd\n\n# Structured output for programmatic/agent use\nchat-history search \"cache fix\" --json\nchat-history search \"auth\" --deep --json\n```\n\nSearch results include an 8-char session UUID prefix (e.g. `[e363d98d]`) so you can immediately drill into a result with `chat-history inspect e363d98d` or `chat-history view e363d98d`.\n\n### Inspect\n\nSession summary showing accomplishments, key decisions, tools used, files touched, model name, and token count.\n\n```bash\nchat-history inspect --last                # most recent session\nchat-history inspect 2df5                  # by partial UUID\n```\n\n### View transcript\n\n```bash\nchat-history view --last                   # full transcript\nchat-history view 2df5 --tools             # include tool call names\nchat-history view --last --plain           # plain text (pipe-friendly)\n```\n\n### Export / Resume / Find\n\n```bash\nchat-history export 2df5 -o session.md     # export as markdown\nchat-history resume 2df5                   # resume Claude Code session\nchat-history find e912                     # print file path (for scripting)\n```\n\n### Install agent skill\n\n```bash\nchat-history install-skill                 # installs SKILL.md for Claude Code + Cursor\n```\n\n## Data sources\n\n| Source | Path | What it contains |\n|---|---|---|\n| Claude Code index | `~/.claude/projects/*/sessions-index.json` | Summary, dates, branch, message count |\n| Claude Code JSONL | `~/.claude/projects/*/*.jsonl` | Full conversations with tool calls |\n| Cursor agent transcripts | `~/.cursor/projects/*/agent-transcripts/` | JSONL or plain-text transcripts |\n\n## Search scoring\n\n### Index search (default)\n\nSearches `sessions-index.json` metadata with field-weighted scoring:\n\n- **Summary match** — 3x weight\n- **First prompt match** — 2x weight\n- **Branch / project match** — 1x weight\n- **Recency multiplier** — 3x today, 2x this week, 1.5x this month\n- All query words must match (AND logic)\n- Shows which field matched (`[summary]`, `[first_prompt]`, etc.)\n\n### Deep search (`--deep`)\n\nDeep search parses transcript files in parallel using [rayon](https://github.com/rayon-rs/rayon). Snippets show context **around the match**, not the first N characters.\n\nFull transcript scoring combines signals from multiple open-source projects:\n\n- **Core tech term matching** — exact match on framework/tool names (10pts)\n- **Word-level scoring** — exact word boundary match (2pts), substring fallback (1pt)\n- **Supporting terms** — 5+ character non-generic terms (3pts)\n- **Exact phrase bonus** — full query appears verbatim (5pts)\n- **Prefix matching** — `auth` matches `authentication` at word boundaries\n- **Separator normalization** — `_`, `-`, `/` treated as spaces\n- **Recency multiplier** — 3x today, 2x this week, 1.5x this month\n- **Importance boost** — decisions (2.5x) \u003e bugfixes (2x) \u003e features (1.5x)\n- **Semantic boosts** — error queries boost error content (3x), fix queries boost solutions (2.8x)\n- **Content deduplication** — normalized signatures prevent duplicate results\n- **Per-session cap** — max 3 matches per session to prevent domination\n\n## Filtering\n\nThe following are automatically filtered out:\n\n- Warmup/handshake messages (`Warmup`, `/clear`)\n- Noise patterns (`\"I'm Claude\"`, `\"ready to help\"`, etc.)\n- Clear-only conversations\n- Structural config content (settings listings)\n- Full-text capped at 4MB per conversation to prevent lag\n\n## Credits\n\nSearch and scoring logic ported from:\n- [claude-historian-mcp](https://github.com/Vvkmnn/claude-historian-mcp) — multi-signal relevance scoring, query similarity, importance heuristics\n- [claude-history](https://github.com/raine/claude-history) — prefix matching, separator normalization, recency multiplier, cwd-based project path resolution\n- [search-sessions](https://github.com/sinzin91/search-sessions) — two-tier index/deep search, field-weighted scoring, natural language dates, per-session cap\n- [cursor-history](https://github.com/S2thend/cursor-history) — multi-format Cursor transcript parsing\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fay-bh%2Fchat-history","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fay-bh%2Fchat-history","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fay-bh%2Fchat-history/lists"}