Originally published on centrail.org. Want to try it? Check out the demo.
When Coding agents first became a thing, humans witnessed Artificial Intelligence get insanely good at reasoning and writing code in a matter of months. I’ll never forget when Anthropic released Opus for the first time and being blown away by what it could achieve in somebody's code base directly inside their Visual Studio Code or other chosen harnesses like Cursor.
As the world started using AI extensively, I watched a number of my friends adopt Claude Code and Codex to build a great many projects. Today, this is still the case and is a really exciting time to experience everyone's backlog of side projects finally becoming tangible within a few prompts.
Something annoyed me though. The sheer amount of projects coming out was not being tracked! “How much AI did you use for this?” quickly answered by “I don’t know” or “A lot hahaha”. What the hell, I thought. “I want to know the actual answer!?”
This led me to finding and using ccusage.
ccusage is a free, MIT-licensed tool that reads local coding-agent logs. Run npx ccusage@latest daily to see daily token counts and estimated costs. It also offers monthly and session reports, Claude’s five-hour usage windows, and statusline reporting. Today, its provider coverage is insanely broad compared to when I first picked it up.
The reports use local agent logs and require no account. Official releases can send a separate, optional usage ping as well. See ccusage’s commands and telemetry documentation.
I loved making my friends run the ccusage command and seeing their token counts for that day, or the last month.
I’m sure you’ve heard in the media about the amount of energy or water that AI data centers use and how “horrible it is for the environment”. As a software developer this was definitely a concern of mine as I both wanted to use AI but be wary of its impact. AI should be tracked more extensively. I wanted the environmental numbers, and I wanted it tracked to MY usage.
I had a question and wanted to create the answer. “How much AI did I or my friends use for any specific project? How much water and energy did we use, what was the actual API cost, how many tokens did we generate and how many projects do we even have?”
I was determined to answer this, and more.
I spent months researching AI data centers' environmental impact and you can read many of my findings across Centrails available documentation.
This led me to build Centrail. It started out as an AI environmental tracker for individual developers to becoming a centralized place where you can view all adjacent metrics that your AI ACTUALLY produces. Total cost, token counts, energy/water/carbon usage, by project by timeline or by individual, team or even organization.
Fast forward today and my friends and I created something we’re very proud of. GreenAI - by Centrail.
We built Centrail using itself, so that we could publish our own numbers and show people exactly what you would get when you use it.
In the first sample we shared from our work, we used 2.86 billion tokens which was about $4,099 in estimated cost with work across 944 commits. That worked out to about $4.34 per commit. (There are a number of more metrics we are getting ready to share just not yet)
GreenAI brings usage from paired devices into one account. Team members choose which work to share, and the dashboard shows estimated cost, commits, and environmental footprint by shared repository. Centrail matches Claude Code and Codex usage to commits using timing, branch, and authorship. It also captures Copilot CLI, Gemini CLI, and Pi usage, which today - remains outside of commit attribution.
The Centrail CLI reads logs on the device without sitting between the agent and its model provider. It syncs usage and Git metadata. Prompts, completions, source code, and diffs stay out of the uploads.
We love where we are at today and will continue to push for being the best centralized tool anyone can pick up quickly to start tracking their AI.
The tools can be used together. Centrail can import earlier Claude Code daily or session JSON from ccusage.
Want to try the demo? Check it out here: https://centrail.org/demo
原文来源:dev.to