
claude-carbon is an open source Claude Code plugin that tracks the carbon footprint of your sessions: a live CO2 estimate computed locally from your token usage, in the terminal status line and in the Code tab of the Claude desktop app, next to the session's API-equivalent cost. In the desktop app, /carbon-panel opens a pane with a pixel molecule coloured by this session's CO2 against the median of your past sessions, your usage over the period you pick, its warming stripes, and a button for your yearly card.
What claude-carbon does
/carbon-panel: a pane in the Claude desktop app with your CO2 molecule, your usage and the warming stripes of your sessions (in a terminal, the session in the band above the prompt). See the mod
- Adds a live CO2 estimate to the Claude Code status line, and the session's CO2 under the prompt in the Claude desktop app, each next to the session's API-equivalent cost
- Persists each session to a local SQLite database, so history survives the 30-day transcript purge
- Backfills historical data from existing
~/.claude transcripts
- Slash commands:
/carbon-report (text), /carbon-card (PNG), /carbon-pr (footprint of a pull request)
- A README badge with your all-time total, and a public methodology with every factor sourced
About the $ figure. It is an API equivalent: what your session would cost at Anthropic's pay-as-you-go API list prices. On a Pro, Max or Ultra subscription you do not pay it; it shows the value of what you used, next to its CO2. See How it works.
Install
In Claude Code, type:
/plugin install claude-carbon --marketplace gwittebolle/claude-carbon
Claude Code asks you to confirm the marketplace, shows what the plugin installs, then asks where to install it: pick Install for you. The same line works on macOS, Linux and Windows. In the Code tab of the Claude desktop app, if the line is not taken, paste this message instead and accept when Claude asks:
Install the claude-carbon plugin for me: claude plugin install claude-carbon --marketplace gwittebolle/claude-carbon
Then quit Claude Code completely, open it again and start a new session. Your CO2 now shows next to the session's cost:
- in a terminal, in the status line:
$0.50 · 65gCO₂
- in the desktop app, under the prompt:
This session: 3.6 gCO₂ · $0.12
The plugin sets that status line once, at its first session start, and only when you have none: another tool's status line is left as it is (to add the CO2 to it, see ccstatusline). /carbon-report gives your totals, and /carbon-panel opens the pane in the desktop app. The $ is an API-equivalent cost, not what your subscription bills. To update later, run /carbon-update.
If the install stops
- macOS opens a window about "command line developer tools". That is
git, which Claude Code needs to fetch the plugin and a Mac without developer tools does not have yet. Click Install, wait until it finishes (a few minutes), then install again.
- "jq is not installed" or "sqlite3 is not installed". Tell Claude: "Install what is missing.", then restart Claude Code. Every Mac has
sqlite3, and macOS 15 and later also have jq. On an older Mac, Claude can install jq with Homebrew, or the installer (under Other ways to install) fetches the official jq itself, checked against its published checksum. On Windows, /carbon-panel names the one missing and Claude can install it with winget. If winget answers "Access is denied", security software on the PC is blocking it: allow winget there, then try again.
- Windows says Git Bash is missing. Install Git for Windows (Claude Code needs it on Windows anyway), quit the app completely and reopen it, then install again in a new session. Claude Code looks for Git Bash when a session starts, so a session open during the Git install still runs without it.
- Installed from Anthropic's community marketplace and the plugin fails to load? The
co2-tracker@claude-community entry is pinned to a release from August 2026 that current Claude Code rejects ("Duplicate hooks file detected"). Run /plugin uninstall co2-tracker@claude-community, then install as above.
Other ways to install
-
The installer, a script that clones this repository and wires everything into ~/.claude/settings.json itself. Paste this message into Claude Code, or run the command after the colon yourself in a terminal:
Install claude-carbon for me by running this command:
curl -fsSL https://raw.githubusercontent.com/gwittebolle/claude-carbon/main/install.sh | bash
On Windows, in PowerShell (it needs Git for Windows and two packages first, see Windows):
Install claude-carbon for me by running this command in PowerShell:
irm https://raw.githubusercontent.com/gwittebolle/claude-carbon/main/install.ps1 | iex
If the mode selector under the prompt shows Auto, pick Manual first: auto mode blocks a command that downloads a script and runs it. You can read install.sh before running it.
-
With Node.js: npx claude-carbon runs the same installer.
Use one way only: the plugin and the installer together would run every hook twice. Already installed with the installer? Nothing to change, /carbon-update keeps it up to date.
Not covered: the chat and Cowork tabs and the web app (claude.ai/code). Their sessions run on Anthropic's servers, so nothing reaches your machine to count.
Example report

Generate yours with /carbon-card in Claude Code. The summary and detailed PNGs land in
~/Downloads/claude-carbon/ (the Windows Downloads folder follows the system setting, so a
OneDrive-redirected one is honoured) and the folder opens in your file manager, with the
card selected on macOS. CLAUDE_CARBON_EXPORT_DIR picks another folder;
CLAUDE_CARBON_NO_OPEN=1 skips the opening.
Without Playwright or Chromium there is no PNG and the command still finishes: the summary
card is saved as an HTML page in the same folder and opens in your browser, scaled to fit the
window, and a screenshot of it does the job.
The token count on the card is every token Claude processed, cache reads included, as ccusage counts them; the grey line under it gives the share of cache reads. The card's footer says where to find the tool, claude-carbon sur GitHub / claude-carbon on GitHub, with the address below it.
From the 1st to the 10th of each month the status line ends with 📊 September: 84.2kgCO₂ · /carbon-card:
the total of the month just closed, the bar the card draws for it, in the same format as the
session figure. It is read from carbon.db once a day while the nudge shows, and kept in
~/.claude/claude-carbon/last-month-total. A month with fewer than 7 days of sessions gets no
nudge, so a fresh install is not pushed to share a near-empty card. Generating a card
clears it for the month; it goes quiet on its own after the 10th. In December it gives the year
so far instead, 📊 2026: 1444.4kgCO₂ · /carbon-card, and stays the whole month, the card covering
the calendar year. From the 1st to the 10th of January it gives the year just ended, and over those
days /carbon-card covers that year, whole, unless you pass a period or that year has no session (the
card keeps those ten days even when the reminder is turned off). CLAUDE_CARBON_CARD_NUDGE_UNTIL_DAY
moves the cut-off (0 removes the nudge, December included), CLAUDE_CARBON_NO_CARD_NUDGE=1 removes the nudge. Nothing is posted anywhere:
sharing stays a human decision.
Advanced options (CLI)
# Since a specific date
bash ~/code/claude-carbon/scripts/generate-report.sh --since 2026-03-01
# All time
bash ~/code/claude-carbon/scripts/generate-report.sh --all
# A closed period (--until is an exclusive upper bound: this one stops at June 30th)
bash ~/code/claude-carbon/scripts/generate-report.sh --since 2026-01-01 --until 2026-07-01
Custom install directory
curl -fsSL https://raw.githubusercontent.com/gwittebolle/claude-carbon/main/install.sh | CLAUDE_CARBON_DIR=~/my-path/claude-carbon bash
The env var has to sit on the bash side of the pipe, not the curl side, or the installer never sees it.
Second Claude environment (CLAUDE_CONFIG_DIR)
If you run a second Claude Code environment out of its own config directory, e.g.
alias claude-work="CLAUDE_CONFIG_DIR=~/.claude-work claude"
install claude-carbon into that same directory by passing CLAUDE_CONFIG_DIR to the installer:
curl -fsSL https://raw.githubusercontent.com/gwittebolle/claude-carbon/main/install.sh | CLAUDE_CONFIG_DIR=~/.claude-work bash
The status line, the hooks, the database and the /carbon-* commands all live under that config dir, so each environment tracks its own sessions independently. When CLAUDE_CONFIG_DIR is unset everything falls back to ~/.claude as before.
Manual install
git clone https://github.com/gwittebolle/claude-carbon.git ~/code/claude-carbon
bash ~/code/claude-carbon/scripts/setup.sh
bash ~/code/claude-carbon/scripts/configure-settings.sh
The second script merges the block below into ~/.claude/settings.json (additively: an existing status line or third-party hooks are left alone) and symlinks the /carbon-* commands. To wire it by hand instead, skip it and add: