← Back to Leaderboard
Cgwittebolle

gwittebolle/claude-carbon

A Claude Code plugin that estimates session emissions locally from token usage.

Engineering Health (Methodology)
A+ · 88/100
Maintenance Activity
● Updated 3d ago
Latest Release
v1.21.0
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption13/25
Release Cadence20/20
License Clarity20/20
CLILocal AI
Total Stars
★ 259
24h Growth
+0
7d Growth
+3
Forks
24

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

gwittebolle/claude-carbon Star History (2026-04-05 - 2026-12-03) ALL-TIME STAR HISTORY (2026-04 – 2026-12) +258 in 242d · avg +1/day 273 137 0 2026-04-05: ★ 12026-04-25: ★ 712026-05-16: ★ 862026-06-06: ★ 992026-06-27: ★ 1362026-07-18: ★ 1442026-08-08: ★ 1552026-08-29: ★ 1662026-09-19: ★ 1952026-10-10: ★ 2092026-10-31: ★ 2332026-11-15: ★ 2492026-12-03: ★ 259 ★ 259 2026-04 2026-08 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

claude-carbon is a Shell-based Claude Code plugin with a claude-carbon CLI entry point. Its integration uses Claude Code hooks, slash commands, and status-line settings. persist-session.sh runs on Stop and SessionEnd, while backfill.sh imports retained JSONL transcripts. Both process the main session, subagents, and workflow agents, deduplicating assistant records by (message.id, requestId) before saving token counts to local SQLite.

On the hot path, statusline.sh reads the session row in carbon.db instead of rescanning transcripts every turn. The main transcript is read in full during persistence; completed agent totals can be reused if the transcript's file metadata is unchanged. An agent transcript with a partially written line is not cached. Set CLAUDE_CARBON_NO_USAGE_CACHE=1 to disable cache reads and writes.

Key Capabilities & Differentiators

The accounting engine applies per-model emission factors to Anthropic Claude usage, recording input, cache writes, cache reads, and output separately. Cache reads count toward total tokens and use an 8% energy factor in the model. The terminal status line and Claude desktop Code tab show estimated session emissions alongside API list-price equivalents. SQLite preserves recorded history after transcript cleanup, while backfill can recover only logs still on disk.

/carbon-report produces text totals; /carbon-panel compares the current session with the user's historical median and shows period usage and warming stripes. /carbon-card generates shareable cards. /carbon-pr aggregates sessions by project and branch, can attribute qualifying worktree-agent usage to another branch, and creates or updates one sticky comment using the developer's gh authentication.

Trade-offs & Limitations

The strongest use is comparing personal usage over time, not measuring absolute emissions. The CO₂ figures are factor-based estimates rather than metered energy or verified emissions, and the dollar figure is API list-price equivalence, not a subscription charge. Compared with ccusage, the plugin uses the same deduplication approach but adds carbon factors, desktop visualization, and PR reporting. The live display trades freshness for a simpler read path and can lag by one turn.

PR figures describe the developer's recorded Claude Code activity, not the full footprint of a PR. Attribution can follow the branch where a session ends, and sessions recorded under a subdirectory can be left out. Older records without branch metadata can be repaired only while their transcripts survive. The MIT-licensed plugin is a fit for individual local tracking; centralized team reporting is a separate hosted offering. Optional PR publication sends a summary to GitHub and should be treated separately from local accounting.

Hardware & Deployment Guide

Install the plugin through Claude Code's plugin marketplace on macOS, Linux, or Windows, then fully restart and begin a new session. The Shell-based integration needs jq and sqlite3, plus Git Bash on Windows; the package manifest declares Node.js >=18. GitHub PR posting uses gh, and PNG cards need Playwright and Chromium; without that rendering stack, the summary falls back to HTML.

For manual setup, scripts/setup.sh and scripts/configure-settings.sh install and wire the hooks and commands. CLAUDE_CONFIG_DIR can isolate separate Claude environments, including their databases. Accounting runs locally without a hosted service. v1.20.0 introduced first-session status-line registration only when none exists; v1.20.1 moved the command for Homebrew packaging without changing its interface; v1.21.0 defaults to English and the world car factor when no locale is detected.

Persistence: Stop and SessionEnd hooks write transcript-derived totals to local SQLite; backfill imports still-retained sessions.
Accounting: Deduplicates assistant records by (message.id, requestId) and stores separate input, cache-write, cache-read, and output counts.
Responsiveness: The per-turn status line reads carbon.db, trading freshness for a simpler read path and a one-turn lag.
Reporting: /carbon-panel compares the session with its historical median; /carbon-card exports PNGs or an HTML summary when browser rendering is unavailable.
PR attribution: /carbon-pr aggregates local sessions by project and branch, with SubagentStop capturing eligible worktree branches before they disappear.
Publication controls: Optional automatic PR posting requires local, per-repository consent and does not post automatically to fork PRs.
Best For

Claude Code developers who want local emissions estimates, usage trends that survive transcript cleanup, and optional PR summaries.

Skip If

You need audited emissions, actual subscription charges, or a centralized inventory across developers and AI tools.

Reviewed on 2026-12-01 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

CLILocal AI
curl -fsSL https://raw.githubusercontent.com/gwittebolle/claude-carbon/main/install.sh | CLAUDE_CARBON_DIR=~/my-path/claude-carbon bash

Comparison vs. Top Coding, Skills & MCP Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
claude-carbon ★259+3ShellMITA Claude Code plugin that estimates session emissions locally from token usage.
ECC316.1k+4.2kJavaScriptMITPlugins and CLI workflows for planning, reviewing, and verifying agent-written c
caveman124.8k+1.4kGoApache-2.0Coding-agent skill and local Go proxy for shorter replies and smaller tool outpu
rtk88.7k+684RustApache-2.0A local Rust CLI wrapper that trims command output before coding agents read it.

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/gwittebolle/claude-carbon.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

gwittebolle/claude-carbon Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about claude-carbon

What updates the live total, and will it replace an existing status line?

The Stop and SessionEnd hooks parse transcripts and persist session totals locally. The status line reads the saved SQLite row each turn rather than parsing transcripts itself, so the displayed total can lag by one turn. On first start, the plugin registers a status line only if none is configured.

Does it need a GPU, and what drives local resource use?

No GPU or local model is required for accounting. The core workload is Shell-based JSONL parsing and SQLite reads and writes, so backfill work depends on the volume of retained transcripts and subagent activity. The package manifest declares Node.js 18 or later. PNG export needs Playwright and Chromium; without them, the summary is saved as HTML.

Can a company use it locally without subscribing to a hosted service?

The MIT license permits commercial use and modification of the plugin, subject to its notice requirements when redistributing it. The plugin computes and stores each developer's history locally without requiring a hosted dashboard. GitHub PR posting is a separate, optional publication path; TokenClimate's hosted dashboards are not part of the MIT-licensed plugin.

When would I choose claude-carbon over ccusage?

Choose ccusage if token counts and API-equivalent cost answer your question. Choose claude-carbon if you also want per-model emissions estimates, a Claude Code status line or desktop panel, and branch-attributed PR summaries. Both use the same assistant-message deduplication approach, but the added CO₂ figures are modeled estimates, not direct measurements.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining gwittebolle/claude-carbon? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature gwittebolle/claude-carbon on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare