Catalog PyPI
PACKAGE EXPLORERView in registry

agent-tally

PyPI

Real-time cost tracking for AI coding agents with budget limits, kill switch, and TUI dashboard.

agentsaiclaude-codeclicodexcost-trackingopenclaw
Versions collected1
Direct dependencies5From release 0.9.0
Last observed20 Oct, 23:32 UTC

README

Version 0.9.0 documentation

agent-tally

PyPI version Python 3.9+ License: MIT GitHub stars

Real-time cost tracker for AI coding agents. Wrap any CLI agent, see a live cost ticker while it runs, and enforce budgets with an automatic kill switch.

Install

pip install agent-tally

Quick Start

# Track a Claude Code session
agent-tally run claude "refactor auth module"

# Set budgets
agent-tally budget set --daily 5.00 --session 1.00

# Watch costs live
agent-tally dashboard

Output while your agent runs:

$ agent-tally run claude "fix the login bug"
⠋ Running claude...  $0.42 │ 2.1k tokens │ 14s elapsed

Features

  • Live cost ticker — dollar amount updates in real-time as the agent runs, like a taxi meter
  • Budget enforcement — set daily and per-session limits; auto-kills the process at 100%, warns at 80% and 95%
  • Shell-level interception — wraps subprocess calls. No API hooks, no SDK changes, no config files
  • Cross-agent — works with Claude Code, Codex CLI, Gemini CLI, OpenClaw, Cursor, and any CLI tool
  • TUI dashboard — agent-tally dashboard for a live overview of all tracked sessions
  • Webhook alerts — get Discord or Slack notifications when you hit budget thresholds
  • Export — dump cost history as JSON or CSV for your own analytics

CLI Reference

CommandDescription
agent-tally run <command> [args...]Wrap and track an agent
agent-tally budget set --daily 5.00 --session 1.00Set budget limits
agent-tally budget showShow current budget and usage
agent-tally dashboardLive TUI cost dashboard
agent-tally summary [--by-agent|--by-model] [--since 7d]Usage summary
agent-tally export [--format json|csv]Export cost data
agent-tally agentsList supported agents

How It Works

┌─────────────────────────────────────────────────────┐
│                   agent-tally                        │
│                                                      │
│  ┌──────────┐   ┌──────────────┐   ┌─────────────┐ │
│  │  CLI run  │──▶│   Wrapper    │──▶│  Subprocess  │ │
│  │  command  │   │  intercepts  │   │  (agent CLI) │ │
│  └──────────┘   │  stdout/err  │   └──────┬───────┘ │
│                  └──────┬───────┘          │         │
│                         │                  │         │
│                         ▼                  │         │
│                  ┌──────────────┐          │         │
│                  │ Token parser │◀─────────┘         │
│                  │ counts tokens│  (reads agent      │
│                  │ from output  │   output stream)   │
│                  └──────┬───────┘                    │
│                         │                            │
│              ┌──────────┴──────────┐                 │
│              ▼                     ▼                 │
│     ┌──────────────┐    ┌────────────────┐          │
│     │  Live ticker │    │ Budget checker │          │
│     │  $X.XX ████  │    │ warn @ 80/95%  │          │
│     └──────────────┘    │ kill @ 100%    │          │
│                         └───────┬────────┘          │
│                                 ▼                    │
│                    ┌────────────────────┐            │
│                    │  Webhook alerts    │            │
│                    │  Discord / Slack   │            │
│                    └────────────────────┘            │
└─────────────────────────────────────────────────────┘

agent-tally wraps your agent command as a subprocess. It parses the agent's output stream to count tokens in real-time, calculates cost using model-specific pricing, and displays a live ticker. If spending hits your budget limit, it kills the process automatically.

Supported Agents

AgentStatus
Claude Code✅ Supported
Codex CLI✅ Supported
Gemini CLI✅ Supported
OpenClaw✅ Supported
Cursor✅ Supported
Any CLI agent✅ Generic support

Why agent-tally over tokscale?

agent-tallytokscale
ApproachActive — wraps commands in real-timePassive — reads session logs after the fact
Live cost display✅ Ticker updates as the agent runs❌ Post-hoc only
Budget enforcement✅ Kill switch at budget limit❌ No enforcement
Kill switch✅ Auto-terminates runaway agents❌ Not possible (after the fact)
SetupWrap your command, doneParse exported logs

tokscale is great for retroactive analysis. agent-tally is for when you want to control spend while it's happening.

Contributing

  1. Fork the repo
  2. Create a branch: git checkout -b feat/my-feature
  3. Make changes and add tests
  4. Run pytest
  5. Open a PR

Bug reports and feature requests welcome in Issues.

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.9.014 Apr 20265

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
thakoreh/agent-tally

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 23:32 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:ad5ed540d999d52d40ba02b9f26115275a1d8961c2be189750bab41b06b4e765