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

ccusage-eco

v1.0.2

Published

Claude Code usage with estimated energy and water columns.

Readme

ccusage-eco

Your Claude Code usage table with two extra columns: estimated energy and water.

It runs ccusage and costs each row's tokens against a table of per-model energy rates.

┌────────────┬─────────────┬─────────┬───────────┬────────────┬─────────────┬─────────────┬─────────┬─────────────┬────────┬──────────┐
│ Date       │ Model       │   Input │    Output │      Cache │       Cache │       Total │    Cost │      Energy │  Water │   Fridge │
│            │             │         │           │     Create │        Read │      Tokens │   (USD) │        (Wh) │    (L) │    (hrs) │
├────────────┼─────────────┼─────────┼───────────┼────────────┼─────────────┼─────────────┼─────────┼─────────────┼────────┼──────────┤
│ 2026-09-16 │ - opus-5    │   4,202 │ 3,130,104 │  8,600,845 │ 251,729,332 │ 263,464,483 │ $263.17 │ 2,172.67 Wh │ 3.69 L │ 21.7 hrs │
│            │ - sonnet-5  │         │           │            │             │             │         │             │        │          │
├────────────┼─────────────┼─────────┼───────────┼────────────┼─────────────┼─────────────┼─────────┼─────────────┼────────┼──────────┤
│ 2026-09-17 │ - opus-5    │ 135,367 │ 2,316,932 │  7,806,555 │ 235,457,855 │ 245,724,396 │ $204.63 │ 1,741.85 Wh │ 2.96 L │ 17.4 hrs │
│            │   gpt-5.4 * │         │           │            │             │             │         │             │        │          │
├────────────┼─────────────┼─────────┼───────────┼────────────┼─────────────┼─────────────┼─────────┼─────────────┼────────┼──────────┤
│ TOTAL      │             │ 139,569 │ 5,447,036 │ 16,407,400 │ 487,187,187 │ 509,188,879 │ $467.80 │ 3,914.52 Wh │ 6.65 L │ 39.1 hrs │
└────────────┴─────────────┴─────────┴───────────┴────────────┴─────────────┴─────────────┴─────────┴─────────────┴────────┴──────────┘

Total: $467.80 · 3.91 kWh · 6.7 L water
* 2,101,455 tokens (0.4%) ran on non-Claude models. No published energy rate, so they
count towards tokens and cost only.
Rates: latest published table (2026-09-03). Cache reads charged at 10% of the input rate.

Each column sizes itself to its widest value, so nothing is truncated. A row that used several models lists them one per line.

Install

Nothing to install. Run it with npx:

npx ccusage-eco

Or install it once for a shorter command:

npm install -g ccusage-eco
ccusage-eco

Needs Node 18 or newer.

Usage

ccusage-eco                   # by day
ccusage-eco weekly            # by week
ccusage-eco monthly           # by month
ccusage-eco session           # by session
ccusage-eco --since 20260301  # other flags go to ccusage
ccusage-eco --check-rates     # compare shipped rates against upstream
ccusage-eco --help            # usage

The first argument can be daily (the default), weekly, monthly or session. --since, --until, --project and anything else ccusage takes are passed straight through. Only the subcommand and --check-rates are read here.

Columns

| Column | Meaning | | --- | --- | | Model | Every model that ran in that period, one per line. A * marks one with no energy rate | | Input / Output | Non-cached tokens in and out | | Cache Create / Cache Read | Cache-creation and cache-read tokens | | Total Tokens / Cost (USD) | Straight from ccusage | | Energy (Wh) | Estimated, see below | | Water (L) | Energy x 1.7 mL/Wh | | Fridge (hrs) | Energy / 100, a running fridge averaging ~100W |

How energy is estimated

Per million tokens:

(input + cache create + cache read x 0.1) x input rate + output x output rate

Cache reads are charged at a tenth of the input rate because they skip the prefill. Each model is costed at its own rate, so a day that mixed Opus and Haiku is not flattened into one average.

These are rough figures from published research, not measurements of Anthropic's hardware. Compare one week against another with them. Do not audit anything with them.

Non-Claude models

ccusage reports every agent it finds, including Codex, Gemini and Copilot. The rate table only covers Claude, so other models are listed with a * and left out of the energy columns. Their tokens and dollars still count. A row with no Claude usage at all has empty Energy, Water and Fridge cells.

Costing a Gemini call at Claude Sonnet's rate would produce a number, and that number would mean nothing.

Rates

The rates ship with the package, so a given version always produces the same output. Two tables are included, in Wh per million tokens as input / output:

| Family | 2026-03-16 | 2026-09-03 | | --- | --- | --- | | fable | | 90 / 447 | | opus | 50 / 250 | 45 / 223 | | sonnet | 30 / 150 | 27 / 134 | | haiku | 10 / 50 | 9 / 45 |

Every row is costed with the table in force on its date, so last month's numbers do not move when new rates arrive. Session rows have an id rather than a date, so they use the current table.

ccusage-eco --check-rates fetches the upstream skill, compares it to what shipped, and prints what differs. That is the only command that reaches the network on its own account, and it is meant for maintaining the package rather than daily use.

Credit

Energy rates come from environmental-impact-tracker by Zachary Rosen, MIT licensed.

Licence

MIT.