Skip to main content

CLI tool to explore and inspect past Claude Code and Codex conversation history

Project description

agent-history

CLI tool to explore and inspect past Claude Code and Codex conversation histories from a single unified interface.

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 Claude
  • x:e5f6g7h8 — force Codex
  • a1b2c3d4 — 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 with c: or x:
  • -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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_history-0.9.0.tar.gz (39.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_history-0.9.0-py3-none-any.whl (41.7 kB view details)

Uploaded Python 3

File details

Details for the file agent_history-0.9.0.tar.gz.

File metadata

  • Download URL: agent_history-0.9.0.tar.gz
  • Upload date:
  • Size: 39.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for agent_history-0.9.0.tar.gz
Algorithm Hash digest
SHA256 f81862a9dd076ab04ee7e8614acb0019aab8195ff75d89fdee80208db13e3dc5
MD5 09908ec6b260d284bb79c12df700d689
BLAKE2b-256 f2ce527995c5ce7dbc661b901081b6e14ab42a5a04fc4508e69c9c154615d0b8

See more details on using hashes here.

File details

Details for the file agent_history-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: agent_history-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 41.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for agent_history-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 576fa8646f88a107a8b7716e9f66fe83e6b0ab11d0dc2bb451124e98b41c04e8
MD5 655fcb3d0b4604098d58548029e82dab
BLAKE2b-256 fedc45a5cb412abfe1d3aadb85cea991c2f4ae117832dd49bdf6c2a2ee4c7d22

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page