damejan80/tokentab: A CLI that reads Claude Code, Codex, and Gemini CLI session logs and works out how much they cost, by model, project, and day.

damejan80/tokentab: A CLI that reads Claude Code, Codex, and Gemini CLI session logs and works out how much they cost, by model, project, and day.

In This Article

    TokenTab vs. The Status Quo: The Best Way to Track Your AI Coding Costs

    Your AI coding assistant bills you by the token, but you have no idea what that bill actually looks like. Sure, you might get an email from OpenAI, Anthropic, or Google at the end of the month—but that bill arrives as a lump sum. It doesn't tell you which project burned through $80, which model is bleeding you dry, or which day your CI pipeline went rogue and racked up a week's worth of spend in eight hours.

    That lack of visibility is a real problem. Enter tokentab, a new open-source tool designed to solve it. By parsing session logs from the three major AI coding CLIs—Claude Code, Codex, and Gemini CLI—it transforms scattered data into clear, actionable cost reports.

    But is it worth adding another tool to your stack? In this article, I'll compare tokentab against the three main alternatives: manual tracking, built-in CLI reporting, and commercial cost management platforms. We'll examine the pros and cons, explore practical use cases, and assess whether this early-stage project is ready for your workflow.


    What Is tokentab?

    Tokentab is a command-line tool that reads the local session logs generated by Claude Code, Codex, and Gemini CLI. It parses token usage data from those logs, applies current API pricing rates, and outputs cost summaries grouped by model, project, and day.

    The core pitch is simple: you already have the data on your machine. The CLI tools write logs locally. Tokentab just reads them and does the math.

    How it works:

    1. You use Claude Code, Codex, or Gemini CLI as normal.
    2. Those tools write session logs locally (typically as JSON or text files).
    3. You run a tokentab command.
    4. It parses the logs, calculates token costs, and prints a summary.

    The output is terminal-friendly. You can run tokentab --project my-app to see what a specific project cost, or tokentab --day 2025-03-15 to check a specific date. Because everything runs locally and no data is sent anywhere, you get privacy by default.

    Tokentab is an open-source project by GitHub user damejan80. As of early 2025, it's still in its early stages—fewer than 100 stars, minimal documentation, and a small community. That matters, and we'll get into why shortly.


    The Contenders

    Before we go head-to-head, let's set the stage.

    Contender 1: Manual Tracking — You keep a spreadsheet. You copy token counts from logs, paste them into a sheet, and multiply by pricing rates. Or you just look at your monthly invoice and guess.

    Contender 2: Built-in CLI Features — Claude Code, Codex, and Gemini CLI all have some form of usage reporting. Each is native to its own tool, and each has limitations.

    Contender 3: Commercial Cost Management Tools — Products like Vantage, CloudZero, or cloud provider native tools that track AI spend alongside your broader infrastructure costs.

    Contender 4: tokentab — The new open-source option.


    tokentab vs. Manual Tracking

    Ease of Setup and Use

    Manual tracking requires no setup—you already have a spreadsheet app. The problem is the ongoing effort. Every time you want to know what you've spent, you have to hunt through log files, extract token counts, and do arithmetic.

    Tokentab, by contrast, requires a one-time install. If you're comfortable with a terminal, it's a quick process. After that, the effort drops to a single command. The difference isn't marginal—it's the difference between "I'll check my AI spend later" and "let me see it right now."

    Accuracy and Reliability

    Manual tracking is error-prone. You'll miss logs, miscount tokens, use outdated pricing rates, or make arithmetic mistakes. The more you use AI tools, the worse this gets.

    Tokentab applies consistent pricing logic across all logs. It won't make arithmetic errors. However, its accuracy depends on two things: the completeness of your session logs and the accuracy of the pricing data baked into the tool. If you delete logs regularly, your reports will be incomplete. If API prices change, you'll need to update the tool or the config.

    Time Savings

    This is where tokentab wins decisively. If you spend 15 minutes a week manually tracking AI costs, that's 13 hours a year. Tokentab reduces that to near zero. For a freelancer who bills AI costs back to clients, this is real money. For a team lead who needs weekly reports, it's the difference between a 10-minute chore and a 45-minute slog.

    Granularity of Insights

    Manual tracking gives you whatever you're willing to write down. Most people track at the "monthly invoice total" level, which is nearly useless for optimization.

    Tokentab gives you model-level, project-level, and day-level breakdowns automatically. That's the difference between "we spent too much last month" and "we spent $42 on Claude Sonnet for the data-migration project on March 12th."

    Privacy and Data Security

    Manual tracking is fully private—your spreadsheet never leaves your machine (assuming you don't use Google Sheets). Tokentab is also fully local. It reads logs, does calculations, and prints results. No data is sent to any server.

    Cost

    Manual tracking is "free" if you value your time at $0. Tokentab is also free, open-source, and doesn't require a subscription.

    Key Takeaway: If you're tracking AI costs manually on a regular basis, tokentab is a strict upgrade. It's more accurate, faster, and gives you deeper insights for zero monetary cost.


    tokentab vs. Built-in CLI Features

    Cross-Tool Compatibility

    This is the biggest weakness of built-in features. Claude Code knows about Claude Code. Codex knows about Codex. Gemini CLI knows about Gemini CLI. None of them know about each other.

    If you use more than one AI coding assistant—which is increasingly common as developers shop around for the best model for specific tasks—you have no unified view. Tokentab was built specifically to bridge this gap.

    Cost Calculation Accuracy

    Built-in features typically report token usage, but they don't always calculate cost. Claude Code, for instance, shows token counts in its UI but doesn't give you a running dollar figure. Codex shows usage but leaves the cost math to you. Gemini CLI is similar.

    Tokentab does the cost calculation for you, applying the relevant pricing per model. That's a meaningful difference. Token counts are abstract; dollar figures are actionable.

    Customization and Flexibility

    Built-in features are fixed—you get what the vendor gives you. Tokentab, being open-source, can be modified. If you have custom pricing (via an API proxy or a special enterprise agreement), you can adjust the rates. If you want a different output format, you can fork the repo and change it.

    Integration with Workflows

    Built-in features are already in your workflow—you don't have to do anything extra. Tokentab adds a step, but it also adds the ability to script that step. You can run tokentab in a CI pipeline to generate weekly reports, or set up a cron job to email yourself a daily spend summary.

    Learning Curve

    Built-in features have zero learning curve because they're already there. Tokentab requires you to learn a new CLI. That's a small hurdle, but for some users, it's enough to skip the tool entirely.

    Key Takeaway: Built-in features are fine if you use exactly one AI tool and only need vague awareness. If you want actual dollar figures, cross-tool visibility, or any customization, tokentab fills a gap the vendors don't.


    tokentab vs. Commercial Cost Management Tools

    Pricing and Affordability

    Commercial tools like Vantage and CloudZero are built for infrastructure teams. They track AWS, GCP, Azure, Kubernetes, and increasingly AI API spend. They're powerful, but they're priced for businesses, not individuals. Even the entry tiers typically run into the hundreds of dollars per month.

    Tokentab is free. That's not a small difference—it's the difference between "let me try it" and "I need to get budget approval."

    Feature Set and Depth

    Commercial tools offer far more. They provide dashboards, alerts, anomaly detection, budget forecasting, and integrations with dozens of services. Tokentab is a CLI that prints text tables.

    But here's the thing: commercial tools are designed for a different problem. They're about managing cloud infrastructure costs, with AI spend as one category. Tokentab is specifically about AI coding assistant costs. For that specific use case, tokentab gives you 80% of the useful functionality at 0% of the cost.

    Scalability for Teams

    Commercial tools win this category decisively. They have multi-user support, role-based access control, and centralized dashboards. Tokentab is a local CLI—everyone on your team would need to run it themselves, and there's no shared view.

    If you're a team lead who needs to see everyone's AI spend in one place, tokentab isn't there yet. You'd need to build a script to collect outputs from each developer's machine.

    Support and Community

    Commercial tools have support teams, documentation, and onboarding. Tokentab has a GitHub repo with minimal docs and a small community. If you run into issues, you're largely on your own.

    Data Privacy and Control

    Commercial tools require you to send your usage data to their servers. For some organizations, that's a non-starter. Tokentab is fully local—your data never leaves your machine.

    Key Takeaway: Commercial tools are the right choice for enterprises with complex infrastructure and team-wide visibility needs. For individuals, freelancers, and small teams, they're overkill. Tokentab covers the core need at a fraction of the cost.


    Pros and Cons Summary

    tokentab

    Pros: - Free and open-source - Fully local—no data leaves your machine - Works across Claude Code, Codex, and Gemini CLI - Granular breakdowns by model, project, and day - Customizable pricing rates

    Cons: - Early-stage project with limited documentation - No real-time tracking—you have to run the command - Requires CLI tools to be installed and logs to be generated - No team-level dashboard or shared view

    Manual Tracking

    Pros: - Full control over what you track - No extra tools to install

    Cons: - Time-consuming and error-prone - Rarely granular enough to be useful - Relies on your discipline to keep up with it

    Built-in CLI Features

    Pros: - Native to the tools you already use - Zero additional setup

    Cons: - Limited to a single vendor - Typically report token counts, not dollar costs - No customization

    Commercial Tools

    Pros: - Polished with dashboards, alerts, and forecasting - Professional support and documentation - Designed for team-wide visibility

    Cons: - Expensive—priced for businesses - Requires sending usage data to external servers - Overkill for individual developers


    Use Cases and Scenarios

    When tokentab Is the Best Choice

    • Individual developers who use multiple AI coding assistants and want to know what they're actually spending.
    • Privacy-conscious users who don't want usage data sent to third-party servers.
    • Freelancers who need to itemize AI costs per client project for billing.
    • Budget-trackers who want daily or weekly spend visibility without manual effort.

    When Manual Tracking Might Suffice

    • You use AI coding assistants rarely—a few times a month.
    • You don't care about the cost because it's negligible.
    • You're only tracking a single tool and a single project.

    When Built-in Features Are Enough

    • You use exactly one AI coding assistant.
    • You only need rough token counts, not dollar figures.
    • You don't want to install anything new.

    When Commercial Tools Are Worth the Investment

    • You're managing a team of 10+ developers with significant AI spend.
    • You need centralized dashboards and alerts.
    • You're already using a commercial cost management platform for cloud infrastructure.

    Getting Started with tokentab

    If you want to try tokentab, here's the basic flow.

    Installation:

    # Clone the repository
    git clone https://github.com/damejan80/tokentab.git
    cd tokentab
    
    # Install dependencies (assuming a Node.js or Python project—check the repo)
    npm install  # or pip install -r requirements.txt
    
    # Make it executable (if needed)
    chmod +x tokentab
    

    Basic commands:

    # Show all costs for the current month
    tokentab
    
    # Show costs for a specific project
    tokentab --project my-app
    
    # Show costs for a specific day
    tokentab --day 2025-03-15
    
    # Show costs by model
    tokentab --by-model
    

    Configuration:

    The tool likely has a config file where you can adjust pricing rates. Check the repository README for specifics. If your organization has custom API pricing, you'll want to update this.

    Tips for effective cost tracking:

    • Run tokentab on a schedule (cron job or CI pipeline) so you don't have to remember.
    • Don't delete your session logs—the tool depends on them.
    • Check the repo regularly for updates, as pricing changes and new features are likely.

    Limitations and Considerations

    Tokentab is honest about what it is: an early-stage open-source project. Here's what you should know before relying on it.

    Early-stage project. Fewer than 100 stars on GitHub. Minimal documentation. No dedicated support. If you hit a bug, you're likely filing an issue and waiting.

    Accuracy depends on log completeness. If you clear your CLI logs regularly, tokentab will underreport your spend. The tool can only analyze what's on disk.

    Pricing data can go stale. AI API pricing changes. If the tool's built-in rates aren't updated, your cost calculations will be off. You can fix this by updating the config, but it's a manual step.

    No real-time tracking. Tokentab is a batch tool. You run it, it reports. There's no live counter or alert system.

    Requires CLI tools to be installed. If you use Claude Code through some other interface, or if your team uses a managed service, tokentab won't help.


    Verdict

    Tokentab is a genuinely useful tool that fills a real gap. If you're an individual developer or freelancer using multiple AI coding assistants, it gives you cost visibility that's otherwise unavailable without paying for enterprise software. It's free, local, and granular.

    The main caveats are the early-stage nature of the project and the lack of team features. If you're a solo developer who wants to know what your AI tools are costing you, tokentab is worth trying today. If you're managing a team and need centralized visibility, you'll want to wait for more features or invest in a commercial tool.

    Who should use tokentab: - Developers who use 2+ AI coding assistants - Freelancers who bill AI costs to clients - Privacy-conscious users who want local-only tracking - Anyone who's tired of guessing what their AI bill looks like

    Who should consider alternatives: - Teams needing centralized dashboards - Users who want zero-configuration tools - Enterprises with compliance requirements around third-party data


    Conclusion

    AI coding assistants are becoming a significant line item in development budgets. The tools that generate those costs don't make it easy to understand them. Tokentab steps in with a simple, local, free solution that turns scattered session logs into clear cost reports.

    The comparison is straightforward: it beats manual tracking on every axis except "I already have a spreadsheet." It beats built-in CLI features by providing cross-tool support and actual dollar figures. It beats commercial tools on price and privacy, while losing on polish and team features.

    If you're a developer who cares about where your money goes, give tokentab a shot. It's a small tool that solves a real problem, and it's early enough that your feedback and contributions could shape its direction.

    Visit the tokentab GitHub repository to try it out, contribute, or star the project to support its development.


    FAQ

    What is tokentab?

    Tokentab is an open-source CLI tool that reads session logs from Claude Code, Codex, and Gemini CLI, then calculates how much your AI usage costs. It breaks down spend by model, project, and day.

    How does tokentab calculate costs?

    It parses token usage data from local session logs and applies API pricing rates for each model. The rates are configurable, so you can adjust them if your pricing differs from standard rates.

    Which AI tools are supported?

    Tokentab supports Claude Code (Anthropic), Codex (OpenAI), and Gemini CLI (Google).

    Do I need to install anything else?

    Yes—you need the respective CLI tools installed and generating logs. Tokentab reads those logs; it doesn't generate them.

    Is tokentab free?

    Yes. It's open-source and available on GitHub at no cost.

    Can I use tokentab to track costs for my team?

    Not directly. Tokentab runs locally on each machine. You'd need to collect outputs from each developer to get a team-wide view.

    Does tokentab send my data to external servers?

    No. Everything runs locally. Your session logs and cost data never leave your machine.

    How accurate are the cost calculations?

    Accuracy depends on complete session logs and current pricing data. If logs are missing or pricing has changed, the numbers will be off. You can update pricing rates manually.

    Can I customize the pricing rates?

    Yes. The tool is open-source and supports configuration. You can adjust rates to match your specific API agreements.

    Is there a graphical interface?

    No. Tokentab is a command-line tool. Output is text-based.

    D
    Dr. Soren Vale
    AI Research Director
    Former research scientist at DeepMind. 15 years in machine learning. Believes the best AI writing explains concepts so clearly that anyone can understand them. Based in London.

    📬 Get new articles by email

    No spam. Just new articles from AI Insights.