ai-history

ai-history is a skill for Claude Code, Codex from jiantao88/ai-history. It costs 64 tokens per session (690 once invoked), scanned C, original, MIT.

A command-line tool for searching and viewing past conversations with AI coding assistants such as Claude Code, Codex CLI, and Cursor. It can also load a past session’s summary into the current work.

In plain words
What is it for?
It helps list projects and sessions, search old chats, inspect full conversations, and restore useful context from previous coding work.
Why use it?
It removes the need to manually remember which earlier session contained a decision, code change, or unresolved issue.

Skill for Claude CodeCodex

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

Good fit It helps list projects and sessions, search old chats, inspect full conversations, and restore useful context from previous coding work.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jiantao88/ai-history/codex
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 jiantao88/ai-history --skill codex
Clone the repo
git clone --depth 1 https://github.com/jiantao88/ai-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 ai-history

README.md
[![agentmods](https://agentmods.dev/badge/skills/jiantao88/ai-history/codex/github.svg)](https://agentmods.dev/skills/jiantao88/ai-history/codex)
Your own site
<a href="https://agentmods.dev/skills/jiantao88/ai-history/codex"><img src="https://agentmods.dev/badge/skills/jiantao88/ai-history/codex/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 ai-history

Your own site · 80×15
<a href="https://agentmods.dev/skills/jiantao88/ai-history/codex"><img src="https://agentmods.dev/badge/skills/jiantao88/ai-history/codex.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 690 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00064 $0.00690
Opus 5 $0.00032 $0.00345
Sonnet 5 $0.00013 $0.00138
Haiku 4.5 $0.00006 $0.00069

Measured 9d ago against content hash 6c9027bc5b16, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade C, and why

ai-history scanned grade C with 1 finding 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 9d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

git clone https://github.com/jiantao88/ai-history.git /tmp/ai-history && /tmp/ai-history/setup && rm -rf /tmp/ai-history
skills/codex/SKILL.md · 100 lines

How it starts

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

ai-history

Search and browse AI chat history across Claude Code, Codex CLI, and Cursor.

Prerequisites

The ai-history binary must be installed at ~/.cargo/bin/ai-history.

If not found, guide the user:

Run this to install:
  git clone https://github.com/jiantao88/ai-history.git /tmp/ai-history && /tmp/ai-history/setup && rm -rf /tmp/ai-history

Available Commands

List all projects

~/.cargo/bin/ai-history list --json

List sessions for a project (fuzzy match)

~/.cargo/bin/ai-history sessions "<project>" --json

Show a session's messages

~/.cargo/bin/ai-history show "<session-id>" --compact --json

Session IDs support prefix matching (e.g. a247accc matches the full UUID).

Search across all history

~/.cargo/bin/ai-history search "<query>" --limit 10 --json

Load a session as context (digest — compressed summary)

~/.cargo/bin/ai-history context "<session-id>"

Outputs a structured digest: intent, key decisions, code changes, remaining issues, conclusion. For full uncompressed conversation, add --full.

Generate a standalone digest

~/.cargo/bin/ai-history digest "<session-id>" --json

Export a session (full text)

~/.cargo/bin/ai-history export "<session-id>" --format prompt

The prompt format outputs clean User: / Assistant: blocks with no tool calls or timestamps — ready to inject into the current conversation as context.

How to Use

  1. Find: Use listsessionsshow to drill down to a specific conversation
  2. Search: Use search to find conversations by keyword across all providers
  3. Inject context: Use context to load a compressed digest of a past session, or context --full for the complete conversation

Output Formatting

  • Always use --json flag to get structured data, then format it into readable tables
  • Abbreviate session IDs to 8 characters in display
  • Abbreviate home directory as ~ in displayed paths
  • Truncate long text to keep output scannable

Read the full file on GitHub · 100 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. 9d ago First seen · 100 lines · 64 tokens per session scan C 6c9027bc5b16

Subscribe to this mod's changes

ai-history is a skill published in the GitHub repository jiantao88/ai-history (3 stars, last pushed 2mo ago), licensed MIT. It adds 64 tokens to every session and 690 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.