claude-carbon

claude-carbon is an open source plugin for Claude Code. It adds a live CO₂ estimate to the status line, next to the session cost, and keeps a local history of every session. It reads the transcripts Claude Code already writes on your machine. No account, no server, no prompt sent anywhere. MIT licence, source on GitHub.

Install in one command

macOS, Linux and WSL:

curl -fsSL https://raw.githubusercontent.com/gwittebolle/claude-carbon/main/install.sh | bash

Windows, in PowerShell, with Git for Windows installed:

irm https://raw.githubusercontent.com/gwittebolle/claude-carbon/main/install.ps1 | iex

Or anywhere Node.js runs:

npx claude-carbon

The same command updates an existing install. Restart Claude Code and the CO₂ appears in the status line:

claude-carbon ⌥ main | 🟢 Opus 5 ▓▓▓░░░░░░░ 35% | $0.50 · 65g CO₂ | Use 24% ↻13:00

What it shows

How the estimate is made

Tokens are counted per model and per kind (input, output, cache writes, cache reads). Each kind gets an energy factor, then a data centre overhead and a grid carbon intensity. Cache reads are priced far below fresh input because they skip most of the compute. Every factor carries its source, a confidence level and a review date. The full derivation lives in METHODOLOGY.md and in the TokenClimate methodology, which is the same document.

claude-carbon and TokenClimate

Same author, same equations. claude-carbon measures one developer on one machine. TokenClimate does the same for an organisation, from the Anthropic admin API, with cost and footprint per team, per project and per person. The two are checked against each other every week in CI on shared golden vectors, so a number from the plugin and a number from the SaaS agree for the same tokens.

Links