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

claude-budget

v1.1.0

Published

Stop burning Opus tokens. Makes Opus the orchestrator, delegates tool work to Sonnet/Haiku subagents. One command install.

Readme

claude-budget

Stop burning Opus tokens on subagents. One command to install model routing for Claude Code.

The Problem

Claude Code runs everything on Opus by default — including subagent tasks like searching files, running tests, and git operations that work perfectly on Sonnet or Haiku. On the Max plan, this means you hit session limits with 0% Sonnet usage while Opus is maxed out.

Haiku is ~95% cheaper than Opus. Sonnet is ~80% cheaper. Most subagent tasks don't need Opus.

The Fix

npx claude-budget

That's it. This installs:

  1. 9 model-routed agents in ~/.claude/agents/ — each has an explicit model: field so Claude Code uses the right tier
  2. Routing rules appended to ~/CLAUDE.md — instructions that every Claude session reads
  3. Post-compact hook — reminds Claude about routing after context compaction (when it tends to forget)

What gets routed where

| Agent | Model | Savings vs Opus | |-------|-------|-----------------| | researcher | Haiku | ~95% cheaper | | test-runner | Haiku | ~95% cheaper | | git-ops | Haiku | ~95% cheaper | | code-writer | Sonnet | ~80% cheaper | | pr-fixer | Sonnet | ~80% cheaper | | scaffolder | Sonnet | ~80% cheaper | | doc-writer | Sonnet | ~80% cheaper | | security-auditor | Sonnet | ~80% cheaper | | web-researcher | Sonnet | ~80% cheaper |

Opus stays reserved for the main conversation thread, architecture decisions, and complex reasoning — the stuff that actually needs it.

Commands

npx claude-budget              # Install everything
npx claude-budget status       # Check what's installed + estimated savings
npx claude-budget doctor       # Diagnose routing issues
npx claude-budget uninstall    # Remove everything cleanly
npx claude-budget install --force  # Overwrite existing agents

How it works

Claude Code supports custom subagents with a model: field in their frontmatter. When Claude spawns a subagent using the Agent tool, it uses the model specified in the agent definition instead of inheriting the parent's model.

The problem is that without these definitions, every Agent() call defaults to inheriting the parent model (Opus). And there's no built-in enforcement or reminder system.

claude-budget solves this by:

  • Installing agents with explicit model: haiku or model: sonnet in their frontmatter
  • Adding routing rules to ~/CLAUDE.md (loaded into every session) that instruct Claude to always specify a model and to delegate work to subagents
  • Installing a hook that fires after context compaction to re-inject the routing reminder (Claude forgets instructions when context is compressed)

Typical savings

Most users running Claude Code on the Max plan see:

  • 60-80% reduction in Opus token usage
  • Significantly more headroom before hitting session limits
  • No quality loss — Haiku and Sonnet handle search/test/git/code tasks perfectly

License

MIT