Skip to main content

agentabacus

agentabacus — local-first analytics for AI coding agents

PyPI CI Python License

Local-first analytics for AI coding agents.

AI coding agents generate session logs, but each agent stores them differently. agentabacus brings those logs into one local database so you can see:

  • What did I spend?
  • Which models are doing the work?
  • Which projects or sessions cost the most?
  • How much of the usage comes from subagents?
  • Where are tokens being spent?

No server. No account. No telemetry. Your data stays on your machine.

Install

Try it without installing:

uvx agentabacus report

Or install it permanently:

pipx install agentabacus

Then check what agentabacus can find:

agentabacus doctor

Collect your agent logs:

agentabacus collect

Collection is incremental, so you can safely run it again as new sessions are created.

Reports

Get a cost and usage report:

agentabacus report

Filter by time:

agentabacus report --since 30d

Group the results:

agentabacus report --by model

Available groupings include:

source
project
branch
model
day
effort
speed
thread

For example, --by thread separates your main agent from its subagents.

Other commands

Find expensive sessions

agentabacus top --limit 10

Understand cache usage

agentabacus cache

Analyse tool calls

agentabacus tools

Export your data

Export to Parquet for use with your own analytics tools:

agentabacus export --format parquet

Query the data directly

The underlying data is stored in DuckDB:

agentabacus sql "SELECT * FROM turns LIMIT 10"

Supported agents

Agent Status
Claude Code ✅ Supported
Codex CLI ⚠️ Experimental — collected, excluded from totals
Gemini CLI Open for contribution
Cursor Open for contribution
Aider Open for contribution
Cline Open for contribution

More adapters are being added.

Experimental means the adapter has never been checked against real logs from that tool. Its rows are collected and stored, but left out of your totals — a missing number prompts a question, a wrong number gets believed. report and doctor tell you what was found and skipped, and --source codex shows those numbers anyway.

The Codex adapter currently reports implausible figures (billions of input tokens per session), most likely because it sums cumulative token counters instead of per-request usage. Fixing it needs someone with real Codex transcripts — see CONTRIBUTING.md.

How it works

agentabacus discovers session logs on your machine, parses them into a common schema, and stores the results in DuckDB.

Agent logs
    ↓
Discovery
    ↓
Adapters
    ↓
Normalized schema
    ↓
DuckDB
    ↓
Reports / SQL / Parquet

It also handles a few problems that can make agent usage data misleading:

  • Duplicate usage records in agent transcripts
  • Different cache pricing tiers
  • Subagent transcripts stored separately from the main session
  • Model pricing that changes over time

Data & privacy

Everything stays local.

By default, the database is stored at:

~/.agentabacus/agentabacus.duckdb

You can change the location with:

export AGENTABACUS_HOME=/path/to/data

agentabacus does not upload your prompts, responses, code, or usage data.

Prompt and response text is not stored. The database only keeps metadata such as hashes, counts, tokens, costs, and session information.

Claude Code auto-collection

Claude Code transcripts can be archived automatically when a session ends.

Install the plugin:

/plugin marketplace add tripleaceme/agentabacus
/plugin install agentabacus@agentabacus

Make sure agentabacus is available on your PATH:

pipx install agentabacus

No daemon or cron job is required.

For contributors

Agent logs are not stable APIs, so adapters are designed to tolerate format changes.

A new adapter generally needs:

  1. A parser
  2. Discovery support
  3. Registration in the adapter package

See the existing adapters for examples.

Install the development dependencies and run the tests with:

pip install -e ".[dev]"
python -m pytest

Roadmap

  • More agent adapters
  • Local dashboard
  • Edit-survival metrics
  • Warehouse exports
  • dbt integration
  • GitHub Actions for usage rollups

License

MIT

Download files

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

Source Distribution

agentabacus-0.1.3.tar.gz (34.1 kB view details)

Uploaded Source

Built Distribution

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

agentabacus-0.1.3-py3-none-any.whl (34.4 kB view details)

Uploaded Python 3

File details

Details for the file agentabacus-0.1.3.tar.gz.

File metadata

  • Download URL: agentabacus-0.1.3.tar.gz
  • Upload date:
  • Size: 34.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for agentabacus-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8795b524094f6804d389c7ce7b8f023e5b799bf5d37d3fe7c640697cd6ad042e
MD5 7d9ae5c145a880fa1958d43683d01ef9
BLAKE2b-256 b1d9b5c46642f7b1b900f6a8d28a3e661a3135494404a19850c486ef3baeb4a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentabacus-0.1.3.tar.gz:

Publisher: release.yml on tripleaceme/agentabacus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentabacus-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: agentabacus-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 34.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for agentabacus-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 455981246a7d400b979abed98f8cd90a17d059ec021766c3165f31e72acdbad5
MD5 c301d6ac6a28229752e3ece5926d1cf7
BLAKE2b-256 31694fe2cc6ffdba2e71de9a9e7dbf9bf5bba35059b942bf7d8eafe661808c3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentabacus-0.1.3-py3-none-any.whl:

Publisher: release.yml on tripleaceme/agentabacus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.3.0

2 files

0.2.0

2 files

This release

0.1.3 This release

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

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