chat-history

chat-history is a skill for Claude Code, Codex from ay-bh/chat-history. It costs 93 tokens per session (1,557 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 1,557 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.01557
Opus 5 $0.00046 $0.00779
Sonnet 5 $0.00019 $0.00311
Haiku 4.5 $0.00009 $0.00156

Measured 12d ago against content hash ac740b613afd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, 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 12d 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 · 83 lines

How it starts

The opening of the file, as written. The whole thing — 83 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>" --deep --json — always --deep --json from agents. --deep searches full transcript content; --json returns structured results (session_id, score, snippet, tools, files). Note --json exists only on search.
  2. Shortlist by snippet, not by raw score (see "Choosing the best hit").
  3. chat-history inspect <partial-uuid> on the top 2–3 candidates to confirm before answering.
  4. view / export only if the user needs the actual content.

Temporal question ("what did I work on yesterday?") — list, don't search:

  1. chat-history --from yesterday --to yesterday — every row shows a short session ID; -s groups by day for multi-day overviews.
    • --from X alone means X through today. Always pair with --to when the user means a specific day.
    • Short IDs work everywhere a session ID is accepted (inspect, view, export, find); -v adds full IDs and file paths. resume works for claude / codex rows and for Cursor Agent CLI chats; cursor-ide rows (and Agent transcripts without a CLI store) print the title and DIR: — tell the user to open that folder in Cursor and pick the chat in the sidebar.
  2. chat-history inspect <id> for accomplishments, tools, files touched.

Choosing the best hit

  • Scores rank keyword density, not intent. Use scores only to shortlist; decide from snippets and inspect.
  • The conversation you are currently in can match its own query and score highest. Ignore hits whose session is the current one.
  • When candidates are close, inspect each before picking — don't answer from the top score alone.

Read the full file on GitHub · 83 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. 12d 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 (11 stars, last pushed 2d ago), licensed MIT. It adds 93 tokens to every session and 1,557 once invoked, about $0.0005 per session on Opus 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.