chat-history

chat-history is a skill for Claude Code, Codex from ay-bh/chat-history. It costs 93 tokens per session (2,635 once invoked), scanned A, original, MIT.

A skill for searching, inspecting, and exporting conversation history from Claude Code, Cursor, and Codex. It can search full transcripts, list sessions by date, and inspect matching conversations.

In plain words
What is it for?
Use it to find a previous discussion, review what was done in an earlier session, summarize past work, resume a session, or export conversation content.
Why use it?
It helps recover information from earlier coding sessions without manually opening each chat or relying on memory.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents; mentions Claude Code; mentions Codex.

Good fit Use it to find a previous discussion, review what was done in an earlier session, summarize past work, resume a session, or export conversation content.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ay-bh/chat-history/chat-history
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ay-bh/chat-history --skill chat-history
Clone the repo
git clone --depth 1 https://github.com/ay-bh/chat-history

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for chat-history

README.md
[![agentmods](https://agentmods.dev/badge/skills/ay-bh/chat-history/chat-history/github.svg)](https://agentmods.dev/skills/ay-bh/chat-history/chat-history)
Your own site
<a href="https://agentmods.dev/skills/ay-bh/chat-history/chat-history"><img src="https://agentmods.dev/badge/skills/ay-bh/chat-history/chat-history/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for chat-history

Your own site · 80×15
<a href="https://agentmods.dev/skills/ay-bh/chat-history/chat-history"><img src="https://agentmods.dev/badge/skills/ay-bh/chat-history/chat-history.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,635 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00093 $0.02635
Opus 5.5 $0.00037 $0.01054
Sonnet 5.5 $0.00019 $0.00527
Haiku 4.5 $0.00009 $0.00264

Measured 1mo ago against content hash 278eedeed530, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

chat-history scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

SKILL.md · 97 lines

How it starts

The opening of the file, as written. The whole thing — 97 lines — stays where its author put it; the contents beside it link to each section on GitHub.

chat-history

Search, inspect, and export Claude Code, Cursor, and Codex conversation history. The short alias ch works identically. If the command is not found: cargo install chat-history.

When to use

  • User asks about past conversations or sessions
  • User wants to find something they discussed before
  • User needs a summary of recent work / accomplishments
  • User wants to resume or export a previous session

Process

Keyword question ("find that conversation where I..."):

  1. chat-history search "<query>" --compact — one line per conversation: short id, date, source, directory, #ordinal of the best match (- for a title or first-prompt match), title, then — Role: excerpt and (also #a #b) for its other matches. Role is You (the person), Assistant or Tool (command output or file contents). BM25 searches metadata and transcripts together. Use --json instead only when a script parses the results: each hit then carries session_id, score, snippet, role, ordinal, timestamp, tools, files, and additional_matches with the same message fields.
  2. Shortlist by title and excerpt (see "Choosing the best hit").
  3. Read the hit in context, not the whole transcript: chat-history view <id> --plain --around <ordinal> (2 messages each side; -C N to widen, --max-chars 1500 to cap long messages), or --around one of the also ordinals. A title/prompt match has no ordinal — use inspect for those. view --json gives the same selection as data for scripts.
  4. To find something inside one session, use chat-history view <id> --plain --grep "<regex>" --max-chars 600 --head 12 instead of piping view through grep/sed/head. To read just the conversation, add --role user,assistant (tool output is most of a transcript); --role user lists what the person asked.
  5. chat-history inspect <id> <id> <id> --brief on the top 2–3 candidates to confirm before answering: one call, a few lines each (what was asked, the latest substantive result, files it read or edited — the project's first). Drop --brief for one session's full detail. Full view / export only if the user needs the whole conversation.

Read the full file on GitHub · 97 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +1 lines 278eedeed530
  2. 1mo ago Changed · +8 lines e9eca50638f2
  3. 1mo ago Changed · +1 lines 56a3981bad60
  4. 1mo ago Changed · +2 lines 0a5fa0b85ecd
  5. 1mo ago Changed · +2 lines ae1907a135b4
  6. 1mo ago First seen · 83 lines · 93 tokens per session scan A ac740b613afd

Subscribe to this mod's changes

chat-history is a skill published in the GitHub repository ay-bh/chat-history (13 stars, last pushed 1mo ago), licensed MIT. It adds 93 tokens to every session and 2,635 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.