claude-carbon 1.1.2 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +38 -5
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -104,7 +104,7 @@ install claude-carbon into that same directory by passing `CLAUDE_CONFIG_DIR` to
104
104
  curl -fsSL https://raw.githubusercontent.com/gwittebolle/claude-carbon/main/install.sh | CLAUDE_CONFIG_DIR=~/.claude-work bash
105
105
  ```
106
106
 
107
- The status line, the Stop hook, 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.
107
+ 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.
108
108
 
109
109
  </details>
110
110
 
@@ -114,9 +114,10 @@ The status line, the Stop hook, the database and the `/carbon-*` commands all li
114
114
  ```bash
115
115
  git clone https://github.com/gwittebolle/claude-carbon.git ~/code/claude-carbon
116
116
  bash ~/code/claude-carbon/scripts/setup.sh
117
+ bash ~/code/claude-carbon/scripts/configure-settings.sh
117
118
  ```
118
119
 
119
- Then add to `~/.claude/settings.json`:
120
+ 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:
120
121
 
121
122
  ```json
122
123
  {
@@ -135,11 +136,24 @@ Then add to `~/.claude/settings.json`:
135
136
  }
136
137
  ]
137
138
  }
139
+ ],
140
+ "SessionStart": [
141
+ {
142
+ "matcher": "",
143
+ "hooks": [
144
+ {
145
+ "type": "command",
146
+ "command": "~/code/claude-carbon/scripts/safety-rescan.sh"
147
+ }
148
+ ]
149
+ }
138
150
  ]
139
151
  }
140
152
  }
141
153
  ```
142
154
 
155
+ The `Stop` hook records the session that just ended. The `SessionStart` one re-scans for sessions that hook missed (crash, kill) and drives the daily update check the status line reads; without it you are never told a new version exists.
156
+
143
157
  Restart Claude Code.
144
158
 
145
159
  </details>
@@ -148,9 +162,9 @@ Restart Claude Code.
148
162
 
149
163
  claude-carbon measures one developer's sessions, locally. If the question comes from your CTO, a client RFP or a CSR committee, the same methodology exists as a hosted layer:
150
164
 
151
- - [Free calculator and per-model factor sheets](https://tokenclimate.com/calculator) - the exact versioned factors of this repo, browsable.
152
- - [Bilan IA](https://tokenclimate.com/bilan/en?ref=github) - a self-serve, shareable report of your organisation's real Claude usage (cost, CO2e, water, energy), generated in minutes from an Anthropic admin key. The key is never stored; the methodology annex is citation-ready.
153
- - [TokenClimate](https://tokenclimate.com) - hosted team dashboards. Both sides share this repo's golden vectors, verified weekly in CI.
165
+ - [Free calculator](https://tokenclimate.com/en/calculator?ref=github) and [per-model factor sheets](https://tokenclimate.com/en/models?ref=github) - the exact versioned factors of this repo, browsable.
166
+ - [AI usage report](https://tokenclimate.com/bilan/en?ref=github) - a self-serve, shareable report of your organisation's real Claude usage (cost, CO2e, water, energy), generated in minutes from an Anthropic admin key. The key is never stored; the methodology annex is citation-ready.
167
+ - [TokenClimate](https://tokenclimate.com/en?ref=github) - hosted team dashboards. Both sides share this repo's golden vectors, verified weekly in CI.
154
168
 
155
169
  The only places the OSS points there are a one-line footer in `/carbon-report` and a small credit on the `/carbon-card` PNGs. No status-line promo, no email capture: nothing leaves your machine.
156
170
 
@@ -234,6 +248,8 @@ Factors from [Jegham et al. 2025](https://arxiv.org/abs/2505.09598), an arXiv pr
234
248
  - Carbon intensity uses the AWS region grid (location-based, 0.287 kgCO2e/kWh), not real-time grid data. This sits at the low end of the location-based range; the US national average is ~380 g/kWh.
235
249
  - Anthropic does not publish Scope 1, 2, or 3 emissions. These estimates are independent and based on academic research, not provider data.
236
250
 
251
+ Report equivalences follow your locale, since a car and a kWh differ by ~2x between countries: ADEME/SNCF factors on a French or undetected locale, EPA ones in miles on a US locale, world-average ones otherwise (200 gCO2/km by car, 8.7 g per smartphone charge). Force a set with `CLAUDE_CARBON_LOCALE` (`fr`, `us`, `world`, or any locale string). The factors live in `data/factors.json` under `equivalences`.
252
+
237
253
  Factors are editable in `data/factors.json`. See [METHODOLOGY.md](METHODOLOGY.md) for the full scientific basis, formula, and equivalences.
238
254
 
239
255
  ### Golden vectors
@@ -322,6 +338,16 @@ By default, Claude Code compacts context at 95% usage. Compacting earlier keeps
322
338
  }
323
339
  ```
324
340
 
341
+ ### Disconnect unused MCP servers
342
+
343
+ Every connected MCP server ships its full tool schemas into the context window with every request, whether the session uses them or not. Most of that overhead is served from prompt cache after the first turn, and cache reads carry a much lower energy factor (see METHODOLOGY.md), so the saving per turn is modest; the gain comes from repetition across every turn of every session.
344
+
345
+ ```bash
346
+ claude mcp list
347
+ ```
348
+
349
+ Keep the servers the project actually uses, remove the rest with `claude mcp remove <name>`.
350
+
325
351
  ### Write concise instructions
326
352
 
327
353
  Add to your project's CLAUDE.md:
@@ -344,6 +370,13 @@ These reductions are indicative estimates, not measurements on a benchmark workl
344
370
  | Haiku subagents | -75% vs Opus, -50% vs Sonnet |
345
371
  | **All combined** | **-50 to 70% total** |
346
372
 
373
+ ### Related projects
374
+
375
+ - [EcoLogits](https://ecologits.ai) - Python library estimating the footprint of GenAI API calls across providers.
376
+ - [CodeCarbon](https://github.com/mlco2/codecarbon) - measures the emissions of compute you run yourself (training, local inference).
377
+ - [ImpactIA](https://github.com/SNCFdevelopers/ImpactIA) - AI impact calculator and guide by SNCF, Wavestone and Resilio.
378
+ - [green-claude](https://github.com/Institut-du-Numerique-Responsable/green-claude) - Claude Code skill that steers generated code toward eco-design rules (RGESN, GR491).
379
+
347
380
  ### Further reading
348
381
 
349
382
  - [IEA - Energy and AI (2025)](https://www.iea.org/reports/energy-and-ai/) - data center projections
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-carbon",
3
- "version": "1.1.2",
3
+ "version": "1.3.0",
4
4
  "description": "Track the carbon footprint of your Claude Code sessions",
5
5
  "bin": {
6
6
  "claude-carbon": "bin/claude-carbon.js"