Skip to main content

Analyze local Codex, Claude Code, and OpenCode sessions

Project description

agentrecap

Get deeper insights into your local coding agents beyond cost.

An agentrecap report showing usage metrics and charts

Generate a local, metadata-only HTML report from your Codex, Claude Code, and OpenCode sessions.

uvx agentrecap
# or
pipx run agentrecap

If you do not have uvx or pipx installed, clone the repository and run it with Python:

git clone https://github.com/bansalarnav/agentrecap.git
cd agentrecap
python3 -m venv .venv && .venv/bin/pip install .
.venv/bin/python -m agentrecap.cli

The local virtual environment keeps agentrecap and its dependencies separate from your existing Python installation.

Overview

agentrecap only reads your session data and writes its report to a separate output directory. It will not modify your existing environment or any existing session data.

By default, agentrecap reads active and archived sessions from ~/.codex, Claude Code sessions from ~/.claude/projects, and OpenCode sessions from ~/.local/share/opencode, then writes the report to ~/.agentrecap/reports/<timestamp>/index.html. When it finishes, it asks whether you want to open the report in your browser. Use --open to open it immediately without the prompt.

agentrecap \
  --codex-input /path/to/codex/home \
  --claude-input /path/to/claude/projects \
  --opencode-input /path/to/opencode/data \
  --from 2026-01-01 \
  --to 2026-06-30 \
  --output-dir /path/to/report \
  --title "My agent usage report"

Use --from and --to to limit the analysis by local calendar date. Both dates are inclusive, and either flag can be used on its own. Omit both flags to analyze all available sessions.

The report includes:

  • Headline recent, month-to-date, and all-time estimated API costs alongside usage metrics.
  • Codex, Claude, and OpenCode comparisons.
  • Model usage, cache ratios, reasoning-token metrics, and monthly estimated API costs.
  • Run-duration, response-gap, thread-length, token, cache, and tool-call charts.
  • Human-readable, metadata-only CSV files under the report's data/ directory.

The generated report does not include transcript contents, only metadata. Thread, run, event, agent, and tool-call identifiers are hashed before they are written.

Cost estimates

For cost estimation, agentrecap uses the pricing catalog from models.dev.

Every request is priced before model and month totals are aggregated. Estimates distinguish uncached input, cache reads, five-minute cache writes, one-hour cache writes, unclassified cache creation, output, and separately priced reasoning when available. Generic models.dev context tiers are selected from each request's complete input footprint, so model-specific 200K, 256K, 272K, and future thresholds can be honored. A bounded fallback supplies the former Anthropic long-context rates for logged Sonnet 4 and 4.5 calls over 200K before Anthropic retired that 1M-context beta on April 30, 2026.

Explicit historical fast/priority metadata uses the provider's fast-mode price from models.dev; default is treated as standard. When a historical record has no speed metadata, it remains unknown and is estimated at the standard API rate as a clearly marked fallback—today's local configuration is never applied retroactively. Claude's raw top-level costUSD, when present, is retained only as reported_cost_usd provenance. All report cards, tables, monthly totals, and displayed exports use the independently calculated estimated_cost_usd.

These are API-equivalent token estimates, not ChatGPT, Codex, Claude, or Claude Code subscription spend or credit consumption. They do not include negotiated discounts, batch pricing, or provider/platform charges not represented in the logs. Unknown model IDs and fast modes without an explicit catalog price remain unpriced rather than receiving a guessed rate.

Development

The project requires Python 3.10 or newer and uses uv for dependency and environment management.

uv sync
uv run agentrecap --help

To generate a report from local session data while developing:

uv run agentrecap --output-dir ./report

Build the source distribution and wheel with:

uv build

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

agentrecap-0.4.0.tar.gz (626.0 kB view details)

Uploaded Source

Built Distribution

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

agentrecap-0.4.0-py3-none-any.whl (49.1 kB view details)

Uploaded Python 3

File details

Details for the file agentrecap-0.4.0.tar.gz.

File metadata

  • Download URL: agentrecap-0.4.0.tar.gz
  • Upload date:
  • Size: 626.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.13

File hashes

Hashes for agentrecap-0.4.0.tar.gz
Algorithm Hash digest
SHA256 a097944226e54bd99b08262a02603b7185b1b1e0cf628103d728a6d4b2ff0bf0
MD5 3022d10c998434674dc205c6f41e621d
BLAKE2b-256 e6171c4a75908d395ddbee8a4e11958ee95abeebda232c090f5720a8a0f7da8c

See more details on using hashes here.

File details

Details for the file agentrecap-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: agentrecap-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 49.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.13

File hashes

Hashes for agentrecap-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96e8bbee6838180476071c4a1c86289286c3dbf78fb842e856b257b466b69c88
MD5 2bbc0900d330696631af34151d407db2
BLAKE2b-256 f579d8d0f3fa1ea3596a1ae8ef9455cb4eb30ab904d1c56616dee36fe7244489

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