Agent skill

Carbon Report

by gwittebolle in gwittebolle/claude-carbon

Display CO2 emissions report for Claude Code sessions. An agent skill from gwittebolle/claude-carbon.

MITAuto-check passed

Install Carbon Report

skills CLI
$ npx skills add gwittebolle/claude-carbon --skill carbon-report -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install gwittebolle/claude-carbon carbon-report --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/gwittebolle/claude-carbon.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/carbon-report .claude/skills/carbon-report && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
carbon-report
GitHub stars
211
Token cost
~1.9k tokens
SKILL.md length
22 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
MIT

At a glance

Display CO2 emissions report for Claude Code sessions. An agent skill from gwittebolle/claude-carbon.

  • Calls sqlite3 and jq

What it does

Carbon Report is an agent skill from gwittebolle/claude-carbon. Display CO2 emissions report for Claude Code sessions

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: claude-carbon: track the carbon footprint of your Claude Code sessions. The licence is MIT.

Example prompts

  • “/carbon-report”

What it can do on your machine

Read from SKILL.md and the folder at commit d7313ff. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • sqlite3
    • jq

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Carbon Report loads about 1.9k tokens when it runs. Until then it costs about 17 tokens; SKILL.md has 22 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~17
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from gwittebolle/claude-carbon at commit d7313ff, republished under its MIT licence (© gwittebolle). 22 words, ~1,885 tokens.

Download SKILL.mdSave it as .claude/skills/carbon-report/SKILL.md (or your agent's skills folder).
name
carbon-report
description
Display CO2 emissions report for Claude Code sessions

Run the following bash script exactly as written and present the output to the user. Do not paraphrase or reformat the results.

bash
#!/usr/bin/env bash

# Locate the install (equivalence factors + shared locale lib live in the repo),
# mirroring /carbon-card: status line wiring first, then plugin root, then default.
# Windows (Git Bash): CLAUDE_* variables and the paths stored in settings.json can
# arrive in the native "C:\Users\..." spelling, which bash cannot open. cygpath
# ships with Git for Windows; everywhere else this is the identity function.
ccp() {
  case "${OSTYPE:-}" in msys*|cygwin*) ;; *) printf '%s' "$1"; return 0 ;; esac
  case "$1" in
    [A-Za-z]:[\\/]*|*\\*) cygpath -u "$1" 2>/dev/null || printf '%s' "$1" ;;
    *) printf '%s' "$1" ;;
  esac
}
CFG="$(ccp "${CLAUDE_CONFIG_DIR:-$HOME/.claude}")"
REPO_DIR=""
if command -v jq >/dev/null 2>&1 && [ -f "$CFG/settings.json" ]; then
  SL_CMD="$(jq -r '.statusLine.command // empty' "$CFG/settings.json" 2>/dev/null)"
  # statusLine.command stores a shell-escaped path: expand ~ and unescape spaces
  SL_CMD="${SL_CMD//\\ / }"; SL_CMD="${SL_CMD/#\~/$HOME}"; SL_CMD="$(ccp "$SL_CMD")"
  [ -n "$SL_CMD" ] && [ -f "$SL_CMD" ] && REPO_DIR="$(cd "$(dirname "$SL_CMD")/.." 2>/dev/null && pwd)"
fi
[ -z "$REPO_DIR" ] && [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && REPO_DIR="$(ccp "$CLAUDE_PLUGIN_ROOT")"
[ -z "$REPO_DIR" ] && [ -n "${CLAUDE_CARBON_DIR:-}" ] && REPO_DIR="$(ccp "$CLAUDE_CARBON_DIR")"
if [ -z "$REPO_DIR" ]; then
  # Pure marketplace installs reach here: settings.json carries no statusLine.command
  # (the status line is wired through plugin.json) and CLAUDE_PLUGIN_ROOT is not in the
  # env of a skill's bash. Pick the newest cached plugin copy, the same scan as
  # statusline.sh CACHE_LATEST, keeping only candidates that ship the equivalence lib.
  CACHE_LATEST=""
  for D in "$CFG/plugins/cache"/*/claude-carbon/*/; do
    [ -f "${D}scripts/equiv-lib.sh" ] || continue
    if [ -z "$CACHE_LATEST" ] || [ "$(printf '%s\n%s\n' "$CACHE_LATEST" "$D" | sort -V | tail -1)" = "$D" ]; then
      CACHE_LATEST="$D"
    fi
  done
  [ -n "$CACHE_LATEST" ] && REPO_DIR="${CACHE_LATEST%/}"
fi
[ -z "$REPO_DIR" ] && REPO_DIR="$HOME/code/claude-carbon"
FACTORS_FILE="$REPO_DIR/data/factors.json"

if ! command -v jq >/dev/null 2>&1 || [ ! -f "$FACTORS_FILE" ] || [ ! -f "$REPO_DIR/scripts/equiv-lib.sh" ]; then
  echo "Error: jq and $REPO_DIR/data/factors.json are required (equivalence factors)." >&2
  exit 1
fi

# Pick the equivalence set from the user locale BEFORE LC_ALL=C below masks it:
# the factors are country-specific (a French car and a US car differ by ~1.7x).
. "$REPO_DIR/scripts/equiv-lib.sh"
EQUIV_SET="$(detect_equiv_set)"

# Force C locale: comma-decimal locales (de_DE, fr_FR) make awk mis-parse
# "431.7045" as 431 and print "431,0" instead of "431.7"
export LC_ALL=C

DB_PATH="$(ccp "${CLAUDE_CARBON_DB:-${CLAUDE_CONFIG_DIR:-$HOME/.claude}/claude-carbon/carbon.db}")"

if [ ! -f "$DB_PATH" ]; then
  echo "Database not found. Run setup.sh first:"
  echo "  bash ${CLAUDE_CARBON_DIR:-$HOME/code/claude-carbon}/scripts/setup.sh"
  exit 1
fi

CURRENT_YEAR="$(date +%Y)"
TODAY="$(date +%Y-%m-%d)"

# Ensure the excluded column exists on pre-existing DBs (idempotent).
# Excluded sessions (non-Anthropic models, e.g. local models) are left out of all aggregates.
sqlite3 "$DB_PATH" "ALTER TABLE sessions ADD COLUMN excluded INTEGER DEFAULT 0;" 2>/dev/null || true
NOT_EXCLUDED="COALESCE(excluded, 0) = 0"

# --- Aggregates ---
TODAY_CO2="$(sqlite3 "$DB_PATH" "SELECT COALESCE(SUM(co2_grams), 0) FROM sessions WHERE ${NOT_EXCLUDED} AND started_at LIKE '${TODAY}%';" | awk '{printf "%.1f", $1}')"
TODAY_SESSIONS="$(sqlite3 "$DB_PATH" "SELECT COUNT(*) FROM sessions WHERE ${NOT_EXCLUDED} AND started_at LIKE '${TODAY}%';")"

YEAR_CO2="$(sqlite3 "$DB_PATH" "SELECT COALESCE(SUM(co2_grams), 0) FROM sessions WHERE ${NOT_EXCLUDED} AND started_at LIKE '${CURRENT_YEAR}%';" | awk '{printf "%.1f", $1}')"
YEAR_SESSIONS="$(sqlite3 "$DB_PATH" "SELECT COUNT(*) FROM sessions WHERE ${NOT_EXCLUDED} AND started_at LIKE '${CURRENT_YEAR}%';")"

ALL_CO2="$(sqlite3 "$DB_PATH" "SELECT COALESCE(SUM(co2_grams), 0) FROM sessions WHERE ${NOT_EXCLUDED};" | awk '{printf "%.1f", $1}')"
ALL_SESSIONS="$(sqlite3 "$DB_PATH" "SELECT COUNT(*) FROM sessions WHERE ${NOT_EXCLUDED};")"
ALL_COST="$(sqlite3 "$DB_PATH" "SELECT COALESCE(SUM(cost_usd), 0) FROM sessions WHERE ${NOT_EXCLUDED};" | awk '{printf "%.2f", $1}')"

# --- Equivalences (all-time total) ---
# Factors: data/factors.json "equivalences" (single source, shared with the cards);
# derivations and sources: METHODOLOGY.md "Equivalences used in reports". France and
# undetected locales get the ADEME/SNCF set, a US locale the EPA one, everyone else
# the world average: a car, a kWh and a kilo of beef each differ by 2x+ between
# countries, so a single set would be wrong for most readers.
EQUIV_ROWS="$(jq -r --arg set "$EQUIV_SET" \
  '.equivalences[$set][] | "\(.divisor)|\(.decimals)|\(.label)|\(.source)"' "$FACTORS_FILE" \
  | while IFS='|' read -r divisor decimals label source; do
      count="$(echo "$ALL_CO2" | awk -v d="$divisor" -v p="$decimals" '{ fmt = "%." p "f"; printf fmt, $1 / d }')"
      printf '%s|%s|%s\n' "$count" "$label" "$source"
    done)"
# A malformed or hand-edited factors.json must fail loudly, not print an empty section
if [ -z "$EQUIV_ROWS" ]; then
  echo "Error: could not read the '$EQUIV_SET' equivalence set from $FACTORS_FILE" >&2
  exit 1
fi

# --- Top 5 sessions by CO2 ---
TOP5="$(sqlite3 -separator '|' "$DB_PATH" \
  "SELECT DATE(started_at), project, ROUND(co2_grams, 2), model, ROUND(cost_usd, 4)
   FROM sessions
   WHERE ${NOT_EXCLUDED}
   ORDER BY co2_grams DESC
   LIMIT 5;")"

# --- By project ---
BY_PROJECT="$(sqlite3 -separator '|' "$DB_PATH" \
  "SELECT project, ROUND(SUM(co2_grams), 2), COUNT(*), ROUND(SUM(cost_usd), 4)
   FROM sessions
   WHERE ${NOT_EXCLUDED}
   GROUP BY project
   ORDER BY SUM(co2_grams) DESC;")"

echo "==============================="
echo "  claude-carbon report"
echo "==============================="
echo ""
echo "Today (${TODAY})"
echo "  CO2       : ${TODAY_CO2}g"
echo "  Sessions  : ${TODAY_SESSIONS}"
echo ""
echo "${CURRENT_YEAR}"
echo "  CO2       : ${YEAR_CO2}g"
echo "  Sessions  : ${YEAR_SESSIONS}"
echo ""
echo "All time"
echo "  CO2       : ${ALL_CO2}g"
echo "  Sessions  : ${ALL_SESSIONS}"
echo "  Cost      : \$${ALL_COST}"
echo ""
echo "--- Equivalences (all-time) ---"
while IFS='|' read -r count label source; do
  [ -z "$count" ] && continue
  printf "  %10s %-20s (%s)\n" "$count" "$label" "$source"
done <<< "$EQUIV_ROWS"
echo ""
echo "--- Top 5 sessions by CO2 ---"
echo "Date        | Project                 | CO2 (g) | Model                          | Cost"
echo "------------|-------------------------|---------|--------------------------------|--------"
while IFS='|' read -r date project co2 model cost; do
  printf "%-11s | %-23s | %-7s | %-30s | \$%s\n" "$date" "$project" "$co2" "$model" "$cost"
done <<< "$TOP5"
echo ""
echo "--- By project ---"
echo "Project                  | CO2 (g)  | Sessions | Cost"
echo "-------------------------|----------|----------|--------"
while IFS='|' read -r project co2 sessions cost; do
  printf "%-25s | %-8s | %-8s | \$%s\n" "$project" "$co2" "$sessions" "$cost"
done <<< "$BY_PROJECT"
echo ""
echo "Team view (same methodology): tokenclimate.com"
echo ""

© gwittebolle, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/carbon-report of gwittebolle/claude-carbon.

Open the folder on GitHubat commit d7313ff

Compare with similar skills

Carbon Report next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Carbon Report compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Carbon Report this skillgwittebolle/claude-carbon211—~1.9kAutomated safety check: PassMIT
Session Handoffsickn33/agentic-awesome-skills47k—~1.8kAutomated safety check: NotesMIT
Sessionanthropics/claude-for-legal9.6k3 repos~478Automated safety check: PassApache-2.0
Session History Searchslopus/happy24k—~3.1kAutomated safety check: PassMIT
Session Handoffdavila7/claude-code-templates33k2 repos~1.6kAutomated safety check: PassMIT
Read Sessionasgeirtj/system_prompts_leaks69k—~2.4kAutomated safety check: PassCC0-1.0

Similar skills

  • Session Handoff

    sickn33/agentic-awesome-skills

    A skill your agent uses when context approaches capacity, before /clear or /compact, when switching tasks, or when ending a coding session: produces a structured handoff artifact for the next session.

    47k GitHub stars~1.8k tokensUpdated 2 days ago
    Agent WorkflowsAuto-check: notes
  • Session

    anthropics/claude-for-legal

    Official

    Run a focused N-question study session on a subject — MBE, essay, or flashcards.

    9.6k GitHub starsUsed in 3 repos~478 tokens
    EducationAuto-check passed
  • Searches past Claude Code, Codex and Cursor sessions and summarizes what was worked on, tried or decided, using extraction scripts instead of reading raw logs.

    24k GitHub stars~3.1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Session Handoff

    davila7/claude-code-templates

    Creates comprehensive handoff documents for seamless AI agent session transfers.

    33k GitHub starsUsed in 2 repos~1.6k tokens
    Agent WorkflowsAuto-check passed
  • Read Session

    asgeirtj/system_prompts_leaks

    Locate and read Muse Code's OWN session logs — the current session or a prior one.

    69k GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed
  • Coding Agent Session Finder

    code-yeongyu/oh-my-openagent

    Finds, reads and reconstructs past coding-agent sessions across Codex, Claude, OpenCode, Senpi and many other local agent logs.

    70k GitHub stars~2.8k tokensUpdated today
    Agent WorkflowsAuto-check passed

More from gwittebolle/claude-carbon

  • Carbon Badge

    gwittebolle/claude-carbon

    Generate a shields.io badge of your Claude Code carbon footprint for your READMEs

    211 GitHub stars~712 tokensUpdated yesterday
    Auto-check passed
  • Carbon Card

    gwittebolle/claude-carbon

    Generate shareable PNG report cards of your Claude Code carbon footprint

    211 GitHub stars~967 tokensUpdated yesterday
    Auto-check passed
  • Carbon PR

    gwittebolle/claude-carbon

    Post the development footprint of the current branch as a sticky PR comment

    211 GitHub stars~745 tokensUpdated yesterday
    Auto-check passed

Questions about Carbon Report

What does Carbon Report do?

Display CO2 emissions report for Claude Code sessions. An agent skill from gwittebolle/claude-carbon. Carbon Report is an agent skill from gwittebolle/claude-carbon.

How do I install Carbon Report in Claude Code?

Run `npx skills add gwittebolle/claude-carbon --skill carbon-report -a claude-code`. Or copy the skill folder (skills/carbon-report in gwittebolle/claude-carbon) into .claude/skills/carbon-report in your project. Claude Code loads it when a task matches its description.

How do I install Carbon Report in Codex?

Run `npx skills add gwittebolle/claude-carbon --skill carbon-report -a codex`. Or copy the skill folder (skills/carbon-report in gwittebolle/claude-carbon) into .agents/skills/carbon-report in your project. Codex loads it when a task matches its description.

Can I use Carbon Report in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add gwittebolle/claude-carbon --skill carbon-report -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/carbon-report, .gemini/skills/carbon-report, .github/skills/carbon-report and .opencode/skills/carbon-report in your project.

What does Carbon Report need to run?

Going by SKILL.md and its folder, Carbon Report needs the command-line tools its instructions call (sqlite3 and jq).

Does Carbon Report access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Carbon Report safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Carbon Report use?

Carbon Report is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Carbon Report use?

About 1.9k tokens (SKILL.md is roughly 7.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Carbon Report?

Skills that share tags, products or a category with Carbon Report: Session Handoff (sickn33/agentic-awesome-skills, 47k stars), Session (anthropics/claude-for-legal, 9.6k stars), Session History Search (slopus/happy, 24k stars) and Session Handoff (davila7/claude-code-templates, 33k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Carbon Report?

gwittebolle (a GitHub user) maintains it in gwittebolle/claude-carbon, which has 211 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on October 9, 2026.

Source: gwittebolle/claude-carbon on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.