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

codenomics

v0.4.0

Published

Decode the true economics of your AI coding agents — outcome-normalized cost analytics for Claude Code, Codex CLI, and Gemini CLI.

Readme

Codenomics

Decode the true economics of your AI coding agents.

Every token dashboard tells you what you burned. Codenomics tells you what you got — the true cost of each shipped change, across Claude Code, Codex CLI, and Gemini CLI, computed entirely on your machine.

TRUE $/COMMIT = (compute $ + prompts × attention $ + active time × hourly $) / commits

A model that burns more tokens but needs fewer corrections and less babysitting wins on this number. That's the comparison that actually matters when you pick a model or an agent — and a token counter alone won't show it.

Quick start

npx codenomics init     # detect agents, write config
npx codenomics index    # scan local agent logs (incremental, seconds)
npx codenomics serve    # dashboard at http://127.0.0.1:3737

No account. No upload. Zero runtime dependencies. Your transcripts never leave your machine (PRIVACY.md).

What you get

  • Local dashboard — true $/commit, API-equivalent burn, model-vs-model economics, daily burn chart, per-session drill-down with cache and context-bloat diagnostics, human vs machine (headless/CI) split.
  • Multi-agent collectors — Claude Code transcripts, Codex CLI rollouts (per-turn token accounting validated against cumulative totals), Gemini CLI OTEL telemetry (best-effort; requires telemetry enabled).
  • Economic drivers you control — what's a prompt of your attention worth? What's your loaded hourly rate? Set them in config or the dashboard; every metric updates instantly. Per-model pricing overrides included.
  • Budgets — $ or token limits per day/week/month, globally or per project/agent. npx codenomics index --check-budgets exits nonzero on breach, so cron alerting is one line.
  • Canned reportsnpx codenomics report weekly|monthly renders Markdown + self-contained HTML with prior-period deltas, top sessions, budget status, and rule-based observations (e.g. "your headless jobs ran on a premium model; same tokens at haiku pricing = $X saved"). Optional Slack digest via webhook. npx codenomics report schedule --install-cron automates it.
  • AI recaps (optional) — one-line session summaries via your own claude CLI, cached forever.

Commands

| command | what it does | |---|---| | init | detect agents, write user config; --from <dir> imports old claude-stats recaps | | index | incremental scan of agent logs; --check-budgets for cron | | serve | local dashboard (127.0.0.1 only by default) | | report weekly\|monthly | md/html artifacts; --slack posts a digest; schedule for cron | | config get\|set\|unset\|list\|path | dotted-path config editing | | summarize | AI recaps for recent sessions | | doctor | collector status, quarantined files, format-drift stats | | sync | preview of the future (opt-in, aggregates-only) team sync |

Configuration

~/.config/codenomics/config.json (user) and .codenomics.json (per-project), merged with flags > env > project > user > defaults:

{
  "drivers": { "attentionUsdPerPrompt": 5, "engHourlyRateUsd": 0 },
  "pricing": { "gpt-5.5": { "in": 1.25, "out": 10 } },
  "limits": [
    { "id": "daily-burn", "metric": "costUsd", "period": "day", "max": 50, "scope": "global" }
  ],
  "report": { "slackWebhookUrl": null },
  "server": { "port": 3737, "host": "127.0.0.1" }
}

$ figures are API-equivalent compute cost (cache-aware: read/write rates modeled per vendor). On a subscription plan your marginal $ is 0 — read them as a normalized compute meter that makes models and agents comparable. Built-in pricing drifts as vendors change it; override any model in config.

How it reads your data

| agent | source | notes | |---|---|---| | Claude Code | ~/.claude/projects/**/*.jsonl | full fidelity: cache 5m/1h split, commits, human/machine, prompts | | Codex CLI | ~/.codex/sessions/**/rollout-*.jsonl | per-turn tokens incl. reasoning; commits; subagent detection | | Gemini CLI | ~/.gemini OTEL telemetry | requires telemetry enabled; no commit/source signals (shown as —) |

These are undocumented, fast-moving formats. Parsers are tolerant by design: malformed lines are skipped, unknown event types are counted (doctor shows drift), and a file that fails to parse is quarantined without killing the run.

On first use, codenomics prints a one-time disclosure listing exactly which directories it scans (read-only), where it stores its own data, and that nothing is uploaded — then records your acknowledgement under the data dir. In non-interactive contexts (CI, service managers) it discloses and proceeds without prompting; set CODENOMICS_ACCEPT_DISCLOSURE=1 to accept up front and silence it.

Development

npm install
npm test        # tsc build + node:test (fixtures are scrubbed real transcripts)

Licensed FSL-1.1-MIT (Functional Source License): use it, read it, modify it, self-host it for anything except offering a competing product — and every release becomes plain MIT two years after it ships.

Contributions welcome — especially fixtures from agent versions we haven't seen. scripts/scrub-fixture.mjs redacts a transcript so you can share its shape without sharing its content.