npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

wattmark

v0.1.1

Published

Measure the energy footprint of your Claude Code sessions

Downloads

293

Readme

wattmark

License: MIT

Measure the energy and carbon footprint of your Claude Code sessions — all processing local.

wattmark reads your local Claude Code session logs, estimates how much energy and CO₂ your AI usage represents, and renders it as an interactive terminal dashboard or a shareable card.

Quick start

Zero install — just run it:

npx wattmark

Or install permanently:

npm install -g wattmark

Commands

| Command | Description | | --- | --- | | wattmark | Launch the interactive TUI dashboard (default). | | wattmark summary | Print a shareable card to stdout, no TUI. | | wattmark config | Interactively update grid intensity, default model, and GitHub handle. | | wattmark export | Write an SVG card to ~/Desktop/wattmark-card.svg. |

Inside the TUI: q quit · r refresh · s export card · ←→ navigate weeks · ? methodology.

Methodology

Read this before quoting a number. The token counts are exact (read straight from your logs). The energy and carbon figures are estimates — and deliberately imprecise ones. Treat the relative signals (trends over time, model mix, week-over-week change) as the trustworthy output, and the absolute Wh / CO₂ totals as order-of-magnitude.

Each assistant turn in your Claude Code logs records token usage. wattmark multiplies those token counts by per-token energy coefficients (in watt-hours), matched to the model tier:

| Tier | output | fresh input | cache read | | --- | --- | --- | --- | | haiku | 0.0001 | 0.00002 | 0.000002 | | sonnet | 0.0006 | 0.00012 | 0.000012 | | opus | 0.0015 | 0.00030 | 0.000030 |

Cache-creation tokens use the fresh-input coefficient (cache writes are a prefill pass); cache-read tokens use the much cheaper cache-read coefficient.

energy_Wh = output·c_out + input·c_in + cacheCreate·c_in + cacheRead·c_cacheRead
carbon_g  = (energy_Wh / 1000) · grid_g_per_kWh

Where the coefficients come from (not invented):

  • Output (decode) tokens are anchored to Epoch AI's measured ~0.0006 Wh/output-token for a GPT-4o-class (~100B active-parameter) model; haiku and opus scale within Epoch's observed 0.0001–0.002 Wh/token band.
  • Fresh input (prefill) tokens0.2× output. Prefill is compute-bound and far more energy-efficient per token than memory-bandwidth-bound decode.
  • Cache-read tokens0.1× input, following Anthropic's own published pricing ratio (input : cache-write : cache-read = 1 : 1.25 : 0.1) as a citable proxy for relative cost.

The big caveat: for heavy Claude Code usage, cache-read tokens vastly outnumber every other kind, so the cache-read term usually dominates the estimate — and it's also the least certain coefficient (Anthropic's price covers cache memory, not just compute energy, so it likely overstates the true energy). This is exactly why nothing is reported as a single number.

Why a range? True per-token energy is unknowable from logs alone — it depends on hardware, datacenter efficiency (PUE), and especially request batching (one GPU serving many concurrent requests divides its power across all of them). Every figure is shown as low – high, where low = mid × 0.2 and high = mid × 4.0.

output_tokens in Claude Code logs already includes extended thinking/reasoning tokens, so reasoning is counted without any extra parsing.

Grid intensity defaults to 400 g CO₂/kWh (US average is ≈ 386 g/kWh per EPA eGRID) and is configurable via wattmark config.

Sources:

Privacy

All processing is local. wattmark reads ~/.claude/projects/ on your machine and writes its config and parse cache to ~/.wattmark/. Nothing leaves your computer unless you explicitly run wattmark login (leaderboard sharing — coming soon, not yet active).

License

MIT