agent-retrospective is a Rust CLI that turns local Claude Code and Codex
history into a polished retrospective you can read, share, and learn from.
It scans your local session archives, reconstructs substantive working sessions, aggregates patterns across them, and writes:
- an HTML report for browsing
- a JSON export for downstream analysis
The tool is designed for people who want something closer to a personal
/insights page for their coding-agent work.
- Scans Claude Code history from
~/.claude/projects - Scans Codex history from
~/.codex/sessions - Reconstructs branches and keeps the most substantive path
- Caches parsed session metadata for faster reruns
- Extracts per-session facets such as goals, friction, outcomes, and helpfulness
- Aggregates usage patterns across projects, tools, languages, and workflows
- Produces a standalone HTML retrospective and a machine-readable JSON export
From source:
git clone https://github.com/jimmystridh/agent-retrospective.git
cd agent-retrospective
cargo build --releaseThen run:
./target/release/agent-retrospective --openIf you prefer an installed binary:
cargo install --path .
agent-retrospective --openTagged GitHub releases are also configured to publish prebuilt binaries for supported platforms.
Generate a report from both Claude Code and Codex history and open it in your browser:
agent-retrospective --openOr without installing first:
cargo run --release -- --openScan both sources:
agent-retrospective --source allOnly scan Claude Code:
agent-retrospective --source claudeOnly scan Codex:
agent-retrospective --source codexParse more uncached sessions on a run:
agent-retrospective --max-new-sessions 500Rebuild caches from scratch:
agent-retrospective --force-refreshWrite outputs somewhere else:
agent-retrospective --output-dir /tmp/agent-retrospectiveOverride the source locations:
agent-retrospective \
--claude-projects-dir /path/to/.claude/projects \
--codex-sessions-dir /path/to/.codex/sessionsagent-retrospective supports three analysis modes:
auto: Use Claude-backed analysis when a local Claude runtime is available, otherwise fall back to heuristicsheuristic: Keep analysis fully local and rule-basedclaude: Require Claude-backed analysis and fail if Claude is unavailable
Examples:
agent-retrospective --insight-mode heuristic
agent-retrospective --insight-mode claude --claude-model opusClaude-backed analysis uses the local Claude login or ANTHROPIC_API_KEY when
available. In that mode, transcript excerpts and derived summaries may be sent
through the Claude SDK to generate richer session facets and the final
retrospective narrative.
By default, files are written to ~/.agent-retrospective/:
- HTML report:
~/.agent-retrospective/report.html - JSON export:
~/.agent-retrospective/report.json - Session cache:
~/.agent-retrospective/cache/session-meta/ - Facet cache:
~/.agent-retrospective/cache/facets/
The CLI also prints a short run summary including source paths, number of sessions scanned, number analyzed, date range, skipped malformed files, and the output paths.
- Discover session files from Claude Code and/or Codex.
- Reuse cached metadata when possible.
- Parse uncached transcripts up to
--max-new-sessions. - Filter down to substantive sessions.
- Derive session facets with heuristics or Claude-backed analysis.
- Aggregate cross-session patterns and render the report.
The first run is usually the slowest. Later runs are much faster because both session metadata and extracted facets are cached.
- Session caches are namespaced by source, so Claude Code and Codex sessions do not collide.
- Large histories are intentionally processed incrementally to keep first-run latency reasonable.
claudemode is strict and errors if Claude access is not available.automode prints a fallback notice when it cannot use Claude.
Generate a retrospective report from local Claude Code and Codex session history
Usage: agent-retrospective [OPTIONS]
Options:
--claude-projects-dir <CLAUDE_PROJECTS_DIR>
[default: ~/.claude/projects]
--codex-sessions-dir <CODEX_SESSIONS_DIR>
[default: ~/.codex/sessions]
--output-dir <OUTPUT_DIR>
[default: ~/.agent-retrospective]
--source <SOURCE>
[default: all] [possible values: all, claude, codex]
--max-new-sessions <MAX_NEW_SESSIONS>
[default: 200]
--force-refresh
--insight-mode <INSIGHT_MODE>
[default: auto] [possible values: auto, heuristic, claude]
--claude-model <CLAUDE_MODEL>
[default: opus]
--open
-h, --help
-V, --version