Token Economy – Claude Code/Codex usage, limits and token savings A developer released Token Economy, a local dashboard and Windows tray app that tracks token usage and plan limits for AI coding agents including Claude Code, Codex and OpenCode. The tool reads logs already stored on the machine — such as Claude Code's `~/.claude/projects/**/*.jsonl` and Codex's `~/.codex/sessions/**/rollout-*.jsonl` — and queries Anthropic's and OpenAI's official usage endpoints to show 5-hour and weekly plan windows, with forecasts such as "at this pace you reach 81% when it resets." Token Economy runs on `127.0.0.1` with no account or telemetry, requires Windows 10/11 and Python 3.10+, and measures savings from token-saving tools like RTK, Headroom, Context Mode and Graphify without inventing numbers for tools that do not record them. See how many tokens your AI coding agents burn, how close you are to your Claude Code and Codex plan limits, and how much your token-saving tools RTK, Headroom, Context Mode, Graphify… actually save. A local dashboard and Windows tray app. No account, no telemetry: it reads the logs already on your machine. Português https://github.com/Baeta78/token-economy/blob/main/README.pt-BR.md · Español https://github.com/Baeta78/token-economy/blob/main/README.es.md · Support the project support-the-project Claude Code, Codex, OpenCode and friends spend millions of tokens a week, and each one hides its numbers in a different place. Token Economy puts them side by side: - Plan limits in real time. Claude Code 5-hour and weekly windows including per-model weekly quotas , Codex 5-hour and weekly windows, with a forecast: "at this pace you reach 81% when it resets", or "runs out in 3 days, before the reset". - Token usage per agent, model, project and session. Input, output, cache reads and cache writes, by day. - What your usage would cost on the API , compared with what you actually pay for your subscriptions, prorated to the period you are looking at. - Token-saving tools, measured honestly. It detects which tools you have installed and shows only those. Tools that record their savings show tokens and US$; tools that don't say so, and show where they are set up and how often your agents used them. It never invents a number. - An optimization score with the criteria behind it, automatic tips, and an optional AI analysis using the CLI subscription you already pay for. Everything runs on 127.0.0.1 . The dashboard is in English, Portuguese and Spanish. | Plan limits | Token-saving tools | |---|---| | Usage by agent and model | What to optimize | Screenshots use the built-in demo data python server.py --demo , not a real account. Requirements: Windows 10/11 and Python 3.10+ python.org https://www.python.org/downloads/ , tick "Add to PATH" . git clone https://github.com/Baeta78/token-economy.git cd token-economy pip install pystray pillow Or download the ZIP from the green Code button and unzip it anywhere. Double-click Token Economy.vbs . An icon appears in the Windows tray: - Hover: your current plan limits and today's tokens, per agent. - Click: opens the dashboard in its own window. - Right-click: the same summary, plus "Refresh now", "Start with Windows" and "Quit". - Icon color: follows your tightest limit across all agents: green below 50%, yellow from 50%, orange from 70%, red from 90%, gray with no data. Windows 11 hides new tray icons behind the ^ arrow. To keep it visible, drag it to the taskbar, or turn it on in Settings Personalization Taskbar Other system tray icons . Browser only: run python server.py or double-click start.bat and open http://127.0.0.1:8765 http://127.0.0.1:8765 . Options: --port 8765 , --interval 60 seconds between reads , --no-browser , --demo . Updating: Settings Check for updates tells you when a new version is out. Your settings and history live in .cache/ and are kept. Everything is read locally and read-only. | Source | Where | What you get | |---|---|---| | Claude Code | ~/.claude/projects/ / .jsonl | tokens per call, model, project, tools used | | Claude plan limits | Anthropic's official usage endpoint, with the login Claude Code already keeps in ~/.claude/.credentials.json | 5-hour, weekly and per-model weekly windows whatever your plan has , plan name, extra usage. The token goes only to Anthropic and is never saved or shown. Can be turned off in Settings | | Codex | ~/.codex/sessions/ /rollout- .jsonl and the official usage endpoint the Codex CLI uses | tokens per turn, 5-hour and weekly windows, plan | | OpenCode | ~/.local/share/opencode/opencode.db | tokens and cost per response, including local Ollama models | | Ollama | %LOCALAPPDATA%/Ollama/server .log | requests and generation time Ollama doesn't log tokens | | Token-saving tools | each tool's own database or log table below | tokens saved, per agent and per day | Tools and agents you don't have are simply left out. Token Economy looks at programs on your PATH, hooks and MCP servers registered in Claude Code, Codex, OpenCode and Gemini CLI, installed skills and plugins, and each tool's data folder. It reads names and commands only, never secrets. Tools that store their savings show tokens and US$: a minimum saved output counted once, at the input price of the agent's model and an estimate that also counts the cache re-reads the saved output would have caused until compaction or the end of the session. The same math is used for every tool, so the numbers are comparable. Tools that don't store their savings show which projects they are set up in and how many times your agents queried them in each project. | Tool | Kind | Savings measured | Read from | |---|---|---|---| | RTK https://github.com/rtk-ai/rtk | command output | yes | history.db | | Headroom https://github.com/headroomlabs-ai/headroom | API proxy | yes | ~/.headroom/savings events.jsonl | | token-saver https://github.com/ppgranger/token-saver | command output | yes | savings.db | | squeez https://github.com/claudioemmanuel/squeez | command output | yes |