agent-history
CLI tool to explore and inspect past Claude Code and Codex conversation histories from a single unified interface.
Performance
Project-aware commands keep a lightweight metadata cache so repeated runs do not need
to re-parse every conversation file. By default the cache lives in the platform cache
directory (~/Library/Caches/agent-history on macOS, ~/.cache/agent-history on
Linux). Set AGENT_HISTORY_CACHE_DIR to override it.
The first full-project scan still has to build that cache, but repeated projects,
list --here, and project-summary --here runs should be dramatically faster.
Installation
# Recommended: install globally with uv
uv tool install agent-history
# Or with pip
pip install agent-history
To install the agent skill (for Claude Code, Codex, etc.):
# Default: installs to ~/.claude/skills/
agent-history install-skill
# Custom location
agent-history install-skill -d ~/.codex/skills
Source Tagging
Results are tagged with their source:
[c]= Claude Code (~/.claude/projects/)[x]= Codex (~/.codex/sessions/)
When drilling down on a specific session, you can prefix the ID to force a source:
c:a1b2c3d4— force Claudex:e5f6g7h8— force Codexa1b2c3d4— auto-detect (errors if ambiguous)
Usage
List projects
agent-history projects [--source claude|codex|all]
Shows all projects with conversation history across both backends, merged by project path.
List conversations
agent-history list [PROJECT] [-n LIMIT] [--here] [--source claude|codex|all]
PROJECT: filesystem path, relative path (.), or name suffix--here: scope to the current directory's project- Without argument: lists recent conversations across all projects
View a conversation
agent-history view SESSION_ID [-f|--full] [--no-tools] [-n LIMIT] [-o OFFSET] [--tail]
SESSION_ID: full/partial ID, optionally prefixed withc:orx:-f: show full message content--no-tools: hide tool use details-n: limit messages shown-o: skip first N messages--tail: show the last N messages (use with-n)
Quick summary
agent-history summary SESSION_ID
Shows conversation metadata and a compact flow of user/assistant exchanges with tools used.
Search conversations
agent-history search QUERY [-p PROJECT] [-n LIMIT] [--here] [--source claude|codex|all]
Search conversations for a text string across both backends.
-p PROJECT: limit search to a specific project--here: scope to the current directory's project
Generate catchup context
agent-history catchup SESSION_ID [-c MAX_CHARS] [--include-tools] [--from-start]
Generates a markdown summary suitable for pasting into a new session to restore context.
By default it prioritizes recent conversation content and includes the final assistant message in full.
Use --from-start to use start-first truncation behavior.
Project summary
agent-history project-summary [PROJECT] [-n LIMIT] [-c MAX_CHARS] [--here] [--source claude|codex|all]
Summarizes recent conversations in a project across both backends.
Export
agent-history export SESSION_ID [-f text|json]
Export conversation to simplified text or JSON format. JSON output includes a "source" field.
Print bundled skill
agent-history skill
Prints the packaged SKILL.md contents.
Common Workflows
Catching up on a previous session
# Find the session in the current project
agent-history list --here -n 10
# Get a catchup summary to paste into new context
agent-history catchup abc123def
Finding where something was discussed
# Search current project across both Claude and Codex
agent-history search "authentication bug" --here
# Search all projects
agent-history search "authentication bug"
# Search only Claude history
agent-history search "authentication bug" --source claude
Understanding project history
# Summarize current project's recent sessions
agent-history project-summary --here -n 5
# Or specify a path
agent-history project-summary /path/to/project -n 5
License
MIT
Metadata
Release files for agent-history 0.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agent_history-0.10.0.tar.gz | 48.9 kB | Without provenance | Details for agent_history-0.10.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_history-0.10.0-py3-none-any.whl | Python 3 | none | any | Details for agent_history-0.10.0-py3-none-any.whl |
Total release size: 100.5 kB
Release files / agent_history-0.10.0.tar.gz
| Download URL | agent_history-0.10.0.tar.gz |
|---|---|
| Size | 48.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ab8e303ff0bf78fde1230817fa6f54c1763772352eb60b5d7e6fa357dcb5c33
|
|
BLAKE2b-256 checksum How to use checksums |
1c60fa1e0552ec19ff0eb6fd5b979cd8e26ce768ac250d5dec032dc08f07f0fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.0
|
Release files / agent_history-0.10.0-py3-none-any.whl
| Download URL | agent_history-0.10.0-py3-none-any.whl |
|---|---|
| Size | 51.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
67c0674af2b15a39712e8f716b8647948f135992f9b2267603957215fdc787da
|
|
BLAKE2b-256 checksum How to use checksums |
0ef1c7863bcdb626704510291686c594efedd2ff7d26f3c76c8c4fdef688b824
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.0
|
Security for agent-history 0.10.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.