claude-carbon
Open source Claude Code plugin that estimates the CO2 and API-equivalent cost of your sessions locally, in the terminal and the Claude desktop app.
At a Glance
About claude-carbon
claude-carbon is an MIT-licensed Claude Code plugin by Gaëtan Wittebolle that estimates the carbon footprint of Claude Code sessions from token usage, computed locally on the developer's machine. It shows a live CO2 figure next to the session's API-equivalent cost in the terminal status line and in the Code tab of the Claude desktop app. The latest listed release is v1.20.1.
What It Is
claude-carbon is a carbon-tracking layer for Claude Code. Hooks record each session to a local SQLite database, so history survives Claude Code's roughly 30-day transcript purge, and the plugin can backfill from existing transcripts. CO2 is estimated by applying per-model emission factors, based on Jegham et al. 2025, to token counts. Input, cache write, cache read and output tokens are weighted differently, and the grid intensity used is the AWS region value. The README states these are order-of-magnitude estimates, not precise measurements. The dollar figure is an API list-price equivalent, not what a subscription bills.
Reports, Cards and the Desktop Pane
Slash commands cover the main outputs: /carbon-report gives a text report with totals and equivalences, /carbon-card generates shareable PNG cards, /carbon-badge prints a shields.io badge, and /carbon-pr posts the development footprint of the current branch as a sticky comment on its pull request. In the desktop app, /carbon-panel opens a pane with a pixel molecule coloured by the session's CO2 against the median of past sessions, usage tiles, and warming stripes over a chosen period. A mod also shows the CO2 of each answer when it ends.
Setup Path
Install from inside Claude Code with /plugin install claude-carbon --marketplace gwittebolle/claude-carbon, or use the curl, PowerShell or npx claude-carbon installers. It needs jq and sqlite3; PNG cards additionally use Node.js and a Chromium-family browser. On native Windows it runs through Git Bash. Chat, Cowork and the claude.ai/code web app are not covered, because their sessions run on Anthropic's servers.
From Solo Tool to Team Dashboards
The same methodology backs TokenClimate, a hosted offering for teams that tracks AI cost, CO2 and water by team and model. TokenClimate says it connects Anthropic, OpenAI and OpenRouter usage using read-only keys and does not read conversation content. claude-carbon itself measures one developer's sessions and sends nothing off the machine.
Community Discussions
Be the first to start a conversation about claude-carbon
Share your experience with claude-carbon, ask questions, or help others learn from your insights.
Pricing
Open Source (MIT)
claude-carbon plugin, free and open source under the MIT License; runs locally with no data leaving the machine.
- Live CO2 estimate in Claude Code status line and desktop app
- /carbon-panel, /carbon-report, /carbon-card, /carbon-pr slash commands
- Local SQLite session history
- Backfill from existing ~/.claude transcripts
- The $ figure is an API-equivalent cost, not a charge by the plugin
Capabilities
Key Features
- Live CO2 estimate in the Claude Code status line
- Session CO2 shown in the Claude desktop app Code tab
- API-equivalent cost next to CO2
- Local SQLite history with backfill from transcripts
- /carbon-report text reports
- /carbon-card shareable PNG cards
- /carbon-badge README badge
- /carbon-pr pull request footprint comment
- /carbon-panel desktop pane with pixel molecule and warming stripes
- Per-answer CO2 figure via Claude Code mod
- Public sourced methodology and editable emission factors
- ccstatusline segment mode
