--- title: Local CLI to analyze tokens and costs of AI tools url: https://blog.krasovskiy.team/en/local-cli-to-analyze-tokens-and-costs-of-ai-tools/ date: 2026-08-20 lang: en source: blog.krasovskiy.team --- # Local CLI to analyze tokens and costs of AI tools With each new request to Claude, Gemini, or other AI models, the token costs increase imperceptibly—and often go unnoticed until the bill arrives. Tokentab solves this problem at the root: a local CLI tool analyzes logs from code chats, breaks down costs by models, projects and days, and even generates reports with graphs - without API keys and cloud services. All you need is to run `tokentab web`, enter the prices in the table - and the data will remain only on your computer, and the cached tokens will not be counted twice. ## What is Tokentab and how does it work **Tokentab** is a CLI tool that helps you analyze token costs in AI tools right on your computer. It parses logs from **[Claude Code](https://blog.krasovskiy.team/en/claude-code-what-it-is-and-how-it-s-changing-development/)**, **Codex** and **[Gemini CLI](https://blog.krasovskiy.team/en/customizing-claude-code-for-your-own-workflow/)**, counting the number of tokens and the cost of requests without the need for API keys or online accounts. Everything works locally: data does not go beyond your machine, and cached tokens are not recalculated - savings are guaranteed. Main features: Ideal for those who want to control their AI budget without sharing data with third parties. Fast, safe, without unnecessary settings - just run it, get a number. ## How Tokentab helps control AI costs Tokentab is your local accountant for AI expenses. It analyzes logs from Claude, Codex or Gemini directly on the computer, without sending the data somewhere to the cloud. Breaks costs down into four key areas: models (eg Claude 3.5 Sonnet vs Gemini 1.5 Pro), projects (if you're working on multiple tasks), days (to see dynamics), and types of work (code generation, text analysis, chat). All this without API keys or accounts, just parsing logs. The `tokentab web` command turns raw numbers into easy-to-understand graphical reports. For example, you'll see that 60% of the spend last week was spent on frontend development in the Alpha project, with 80% of that spent on the model with the highest price per token. You adjust the prices manually in the table to reflect the current tariffs of the providers. Another feature is caching. If you resubmit the same request, Tokentab does not count tokens a second time. This is especially useful for testing or debugging, where the same prompts may run dozens of times. The data stays with you on disk, so no one can see how much you've spent on AI experiments. ## Data security and privacy in Tokentab Tokentab works where you are - on your computer, without cloud services or third-party APIs. No accounts, no access keys: all logs from Claude, Codex or Gemini CLI are analyzed locally. This means your data is yours and yours alone. No one can see how many tokens you've spent, what models you're using, or how costs are distributed across projects. Autonomous work is not just a convenience, but a guarantee of privacy. Even if you run `tokentab web` to generate graph reports, the web interface only works in your browser. Data doesn't leave the machine and cached tokens aren't recalculated — risk-free savings. You set the prices manually, and the breakdown of costs by models, days or types of work helps you control the budget without unnecessary intermediaries. In 2026, when each request to AI can cost pennies or hundreds of dollars, local control is not a luxury, but a necessity. Tokentab gives it without compromise. ## Why Tokentab is important for AI and SEO professionals In 2026, spending on AI tools will become a critical factor for business. Tokentab solves the headache of AI and SEO specialists: it locally analyzes Claude, Codex or Gemini query logs, counting tokens and value without API keys or third-party services. The data does not leave your computer, and the `tokentab web` command instantly generates a report with graphs — from cost distribution by model to daily dynamics. This is a gold mine for SEO specialists. You see which AI requests cost the most, which models are more effective for content or analytics, and where you can save. For example, if Gemini consumes 30% of the metatag generation budget, and the result is no different from Claude, the solution is obvious. Cached tokens are not recalculated, so you only pay for unique requests. The price table is customized for your contracts, and the breakdown by project shows where the AI "eats" resources unnecessarily. Productivity increases because you stop guessing. Instead of focusing on abstract limits, have concrete numbers: how much each request costs, what type of tasks are the most expensive, and how to optimize work processes. Local analysis means that data is always at hand — even without the Internet or access to cloud dashboards.