Skip to main content

Track the cost, usage, and ROI of your AI coding agents across every tool.

Project description

Agent-ROI

Track the cost, usage, and ROI of your AI coding agents — across every tool.

License: MIT Python 3.10+ CI

English · 繁體中文


What is Agent-ROI?

When you use multiple AI coding tools — Claude Code, Codex CLI, GitHub Copilot, Cursor, and others — your token spend is scattered everywhere and impossible to evaluate. Agent-ROI unifies all of it.

It reads the local session logs each tool already writes, uses a model-free semantic classifier to discover what topic / task each session was about, and then shows you how many tokens each topic consumed — so you can measure the return on investment of your agents, not just raw token counts.

The core question Agent-ROI answers: "For this feature / bug / topic, how many tokens did my agents burn — and was it worth it?"

Features

  • 🔌 Tool-agnostic collectors — parse local logs from Claude Code, Codex CLI, GitHub Copilot, and Gemini CLI (no proxy, no workflow change).
  • 🧠 Topic classification — a model-free semantic classifier groups sessions by topic so you see cost per subject, not per request. Runs fully offline, costs nothing, requires no external service.
  • 💰 Cost & ROI tracking — token usage mapped to per-model pricing, aggregated by topic, tool, or model, over a custom time window.
  • 🔎 Drill-down & trust — click any topic to see which tools and models its tokens came from; every figure is backed by a viewable pricing table, and estimated numbers are clearly badged vs exact ones.
  • 🖥️ CLIreport, per-topic drill-down, and a pricing command straight from the terminal.
  • 🌐 Web UI — a modern React dashboard with dimension/time controls, breakdowns, and drill-downs.
  • 🗄️ Local-first — everything stays on your machine (SQLite); fully offline; classification never sends data anywhere.

Architecture

┌──────────────┐   ┌──────────────┐   ┌──────────────┐
│  Collectors  │──▶│  Classifier  │──▶│   Storage    │
│ (parse logs) │   │  (semantic)  │   │  (SQLite)    │
└──────────────┘   └──────────────┘   └──────┬───────┘
                                             │
                          ┌──────────────────┼──────────────────┐
                          ▼                                      ▼
                   ┌────────────┐                        ┌────────────┐
                   │    CLI     │                        │  REST API  │──▶ Web UI (React)
                   └────────────┘                        └────────────┘

See docs/architecture.md for details.

Install

One line (macOS / Linux / WSL). Installs uv if needed, then the agent-roi command:

curl -LsSf https://raw.githubusercontent.com/Agent-ROI/agent-roi/main/scripts/install.sh | sh
Other ways to install
# With pipx
pipx install agent-roi

# With uv
uv tool install agent-roi

To install the latest from source before a release is published, set AGENT_ROI_FROM_GIT=1 before running the install script.

Quick Start

# Ingest logs from all detected tools
agent-roi ingest

# Discover topics from your sessions (model-free, fully local)
agent-roi classify

# Cost breakdown — group by topic, tool, or model, over a time window
agent-roi report --by tool --since 7d

# Drill into one topic: which tools/models did its tokens come from?
agent-roi topic "auth refactor"

# Inspect the pricing table behind every cost figure
agent-roi pricing

# Launch the web dashboard (API + React UI), then open http://127.0.0.1:8000
agent-roi serve

Developing Agent-ROI itself? See CONTRIBUTING.md — local dev uses uv and runs the frontend on a separate Vite dev server.

Configuration

Agent-ROI looks for config at ~/.config/agent-roi/config.toml. See docs/configuration.md.

[classifier]
similarity_threshold = 0.18   # higher = more, smaller topics
label_terms = 3               # words used to name each topic

[collectors]
enabled = ["claude_code", "codex", "copilot", "gemini"]

Documentation

Doc English 繁體中文
Architecture architecture.md architecture.zh.md
Configuration configuration.md configuration.zh.md
Collectors collectors.md collectors.zh.md
Contributing CONTRIBUTING.md CONTRIBUTING.zh.md

Contributing

Contributions are welcome! Please read CONTRIBUTING.md and our Code of Conduct.

License

MIT © Agent-ROI contributors

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_roi_tracker-0.1.0.tar.gz (216.3 kB view details)

Uploaded Source

Built Distribution

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

agent_roi_tracker-0.1.0-py3-none-any.whl (43.5 kB view details)

Uploaded Python 3

File details

Details for the file agent_roi_tracker-0.1.0.tar.gz.

File metadata

  • Download URL: agent_roi_tracker-0.1.0.tar.gz
  • Upload date:
  • Size: 216.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.14

File hashes

Hashes for agent_roi_tracker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1d87414b8466f9a961030421cb3431498c3995b989f34fa5ab9be3ee88cf2901
MD5 db77e02ceae588d1553b713d3f66aef1
BLAKE2b-256 ba799ecf054ddabd40a4cef402559ab93d9015c97c394bdf1366a115deb1a535

See more details on using hashes here.

File details

Details for the file agent_roi_tracker-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_roi_tracker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65153481a6ee296be58627c6b67dd37c1bfe7719875635b3333f057fb0a428ab
MD5 bc30e779b197b1c28eb8761d62cd1e79
BLAKE2b-256 18165f0c34748db865e4612d037f065682ce7b38f1054e0d48c7fafe57f4fe5e

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