Tokimeter: Open-Source Local Token Usage & Cost Analyzer for AI Coding Tools

Open-source local tool that unifies token usage and cost tracking across multiple AI coding tools.
Tokimeter is an open-source, privacy-first tool that aggregates token usage data from AI coding tools like Claude, Cursor, Codex, and others into a unified local report. It reads existing local logs without intercepting traffic, provides multi-dimensional cost breakdowns by project, session, day, and model, and includes budget alerts with rate-limit window tracking. No account or telemetry required—everything stays on your machine.
When AI Coding Tools Multiply, But Billing Remains a Black Box
As AI coding tools like Claude, Codex, Cursor, and Grok become part of daily development workflows, a new problem is plaguing developers: How many tokens am I actually consuming? Which project is eating up my budget? These tools operate in silos, with usage data scattered across different log files, configuration directories, and caches, making a unified cost overview nearly impossible.
It's worth explaining the token billing mechanism here. Tokens are the fundamental unit of measurement for how large language models process text—one token roughly equals 3/4 of an English word, or 1-2 Chinese characters. AI service providers typically charge separately for input tokens and output tokens, with dramatic price differences between models. For example, GPT-4's per-token cost can be tens of times higher than GPT-3.5, and there's a significant price gap between Claude 3.5 Sonnet and Claude 3 Haiku. In coding scenarios, because code context tends to be lengthy (entire files or even project structures need to be passed as context), token consumption per interaction is far higher than ordinary conversation, making cost management especially critical.
The open-source tool Tokimeter, recently launched on Product Hunt, targets exactly this pain point. Its positioning is straightforward—it aggregates the usage records already written locally by your AI coding tools into a unified report, making token consumption and costs clearly visible.

What Tokimeter Is: A Local Log Aggregation Tool for Token Statistics
Tokimeter's core logic is quite clever: it doesn't intercept or proxy your API requests. Instead, it reads the usage logs these tools have already generated locally, then parses, aggregates, and presents them in a unified view.
The technical principle behind this design is worth elaborating on. When mainstream AI coding tools run locally, they write interaction records to specific directories. For example, Claude CLI saves detailed information about each session (including token usage) in JSON format under ~/.claude/projects/, while Cursor maintains usage logs in its application data directory. Tokimeter works by scanning log files at these known paths, parsing the token count fields within them, and then combining this with each model's published pricing information to calculate actual costs. This "read existing data" rather than "intercept traffic" approach avoids both the latency and security risks that a man-in-the-middle proxy could introduce, and doesn't require users to modify any existing tool configurations.
Supported AI Coding Tools
According to official documentation, Tokimeter currently supports a comprehensive lineup of tools:
- Claude — covering both CLI and desktop applications
- Codex — supporting both CLI and desktop versions
- Cursor — the popular AI code editor
- Grok Build, Hermes, opencode, Cline, Copilot CLI
This coverage means that whether you prefer command-line tools or AI assistants integrated into your editor, Tokimeter can most likely include their usage in its statistics.
Multi-Dimensional Token Cost Breakdown
Tokimeter doesn't just provide a single total number—it offers precise token counts and costs broken down across multiple dimensions:
- By project
- By session
- By day
- By tool and model
For developers managing multiple projects simultaneously, or those who need to account for AI costs to teams or clients, this level of granularity is extremely practical.
Budget Control: Preventing Token Overages from Catching You Off Guard
Another highlight of Tokimeter is its rate limit window tracking and budget alerts. It has built-in tracking for 5-hour windows and weekly limit windows—directly corresponding to the actual billing/rate-limiting mechanisms of tools like Claude.
Some background on this 5-hour window mechanism: Anthropic implements a sliding window rate-limiting mechanism for Claude Pro/Max subscribers, rather than a simple daily usage cap. Specifically, the system tracks cumulative token consumption over the most recent 5-hour period, and once a threshold is hit, it temporarily reduces available quota or switches to a lower-performance model. The characteristic of this mechanism is that if you engage in heavy, intensive interactions over a short period (such as having AI refactor a large codebase), you can easily trigger rate limiting without realizing it, potentially hours before the next "quota reset." Tokimeter's tracking of this window lets developers pace their usage appropriately, avoiding sudden loss of AI assistance during critical work periods.
Even more thoughtfully, it can display budget warnings directly in your status line. This means you don't need to actively check reports—you'll be alerted when approaching limits, preventing accidental rate-limiting or budget overruns from an intensive coding session.
Privacy-First, Fully Local Design
In an era of increasing data privacy concerns, one of Tokimeter's key selling points is its fully local philosophy:
No account, no telemetry, nothing leaves your machine.
No account registration required, no telemetry data, nothing ever leaves your machine. All log parsing and statistics are completed locally. For developers and enterprises handling sensitive projects or concerned about data leakage, this is a highly compelling design choice.
Installation & Usage: Get Started with a Single Command
Tokimeter has an extremely low barrier to entry. Generating a report requires just one command:
npx tokimeter report
The npx command used here is a package execution tool in the Node.js ecosystem, automatically installed with npm 5.2+. Its core advantage is the ability to directly execute packages from the npm registry without global installation—it temporarily downloads the package to a cache directory during runtime and doesn't pollute the global environment afterward. For reporting tools like Tokimeter that are used occasionally, the npx approach means users don't need to maintain additional global dependencies and ensures they're always running the latest version.
The tool itself is open-source under the MIT license, meaning you can freely inspect the source code, audit its behavior, or even modify it for your own needs—further reinforcing the credibility of its "no data leaves your machine" promise.
Why Developers Need AI Cost Observability
Tokimeter's numbers on Product Hunt are still early-stage (8 upvotes, 6 comments, ranked #14 for the day), but its positioning reflects a rapidly growing real need.
As AI coding transitions from "experimentation" to "productivity tool," cost observability is becoming a new essential requirement. We're accustomed to using APM tools to monitor server resources; now AI token consumption equally needs to be quantified, tracked, and optimized.
This analogy deserves deeper exploration. APM (Application Performance Monitoring) tools like Datadog and New Relic collect metrics such as CPU, memory, and request latency from servers, helping teams identify performance bottlenecks and optimize resource allocation. AI cost observability is essentially the same concept extended to a new dimension: when AI API calls become "infrastructure" in the development workflow, their consumption needs to be monitored like cloud computing resources. In enterprise scenarios, this also involves cost attribution (how much AI spending did each team/project generate), budget planning (how much should be allocated for AI tools next quarter), and ROI assessment (whether the efficiency gains from AI-assisted programming justify the costs)—all critical business decisions.
The value of tools like Tokimeter lies precisely in transforming scattered data into actionable insights.
For developers who heavily use multiple AI coding tools, Tokimeter is worth trying—it doesn't change your workflow, it simply surfaces costs that were previously invisible. And on the fronts of privacy and open source, it makes reassuring choices.
Related articles

Running the 1.56TB Kimi K3 Model on 8GB RAM with Pure C
A developer built a pure C99 inference engine that runs the 1.56TB Kimi K3 model on 8GB RAM using MoE sparsity and NVMe on-demand loading—no GPU, 176KB binary.

AI Coding Disaster: Fable Deleted 2.2 Million Files from a Server
A developer's AI coding tool Fable 5 ultracode accidentally deleted 2.2M server files. Learn what happened and how to protect yourself with backups, least privilege, and sandbox isolation.

Building a Local AI Agent Architecture: From Scattered Scripts to Your Personal Jarvis
A practical guide to consolidating scattered automation scripts into a local AI Agent hub. Covers Function Calling, Ollama+Qwen2.5 deployment, tool orchestration architecture, and a complete implementation roadmap.