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.
npx skills add ay-bh/chat-history --skill chat-historygit clone --depth 1 https://github.com/ay-bh/chat-historyWrote 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.
[](https://agentmods.dev/skills/ay-bh/chat-history/chat-history)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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..."):
chat-history search "<query>" --compact— one line per conversation: short id, date, source, directory,#ordinalof the best match (-for a title or first-prompt match), title, then— Role: excerptand(also #a #b)for its other matches. Role isYou(the person),AssistantorTool(command output or file contents). BM25 searches metadata and transcripts together. Use--jsoninstead only when a script parses the results: each hit then carriessession_id,score,snippet,role,ordinal,timestamp,tools,files, andadditional_matcheswith the same message fields.- Shortlist by title and excerpt (see "Choosing the best hit").
- Read the hit in context, not the whole transcript:
chat-history view <id> --plain --around <ordinal>(2 messages each side;-C Nto widen,--max-chars 1500to cap long messages), or--aroundone of thealsoordinals. A title/prompt match has no ordinal — useinspectfor those.view --jsongives the same selection as data for scripts. - To find something inside one session, use
chat-history view <id> --plain --grep "<regex>" --max-chars 600 --head 12instead of pipingviewthroughgrep/sed/head. To read just the conversation, add--role user,assistant(tool output is most of a transcript);--role userlists what the person asked. chat-history inspect <id> <id> <id> --briefon 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--brieffor one session's full detail. Fullview/exportonly if the user needs the whole conversation.
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.
- 1mo ago Changed · +1 lines 278eedeed530
- 1mo ago Changed · +8 lines e9eca50638f2
- 1mo ago Changed · +1 lines 56a3981bad60
- 1mo ago Changed · +2 lines 0a5fa0b85ecd
- 1mo ago Changed · +2 lines ae1907a135b4
- 1mo ago First seen · 83 lines · 93 tokens per session scan A ac740b613afd
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.
Other skills, from other repositories
ai-history
Search and browse AI coding assistant chat history across providers (Claude Code, Codex CLI, Cursor). Find past conversations, inject historical context into the current session, and search across all chat records. Powered by the ai-history CLI tool.
ai-history
Search and browse AI coding assistant chat history across providers (Claude Code, Codex CLI, Cursor). Find past conversations, inject historical context into the current session, and search across all chat records. Use when asked to find past conversations, load context from previous sessions, or search chat history.
mnemon
Persistent memory CLI for LLM agents. Store facts, recall past knowledge, link related memories, manage lifecycle.
mnemon
Persistent graph-based memory. Recall context before responding, remember insights after. Each group has private memory; global memory is read-only.
mnemon
Persistent memory CLI for LLM agents. Store facts, recall past knowledge, link related memories, manage lifecycle.
mnemon
Persistent memory CLI for LLM agents. Store facts, recall past knowledge, link related memories, manage lifecycle.