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-ration

v0.1.14

Published

Automatically stops Claude Code when it hits your custom usage threshold

Readme

🛡️ claude-ration

Automatically stops Claude Code when it hits your custom usage threshold.

npm version npm downloads license


If you're on Claude Pro, you know this feeling:

You kick off a big refactor. Claude's deep into it. Then — silence.
Usage hit 100%. Session dead. Files half-edited. Nothing you can do for hours.

claude-ration stops Claude at your threshold — 70%, 80%, whatever — so it wraps up cleanly before the wall hits.

Set daily limit to 70% → Claude finishes what it's doing, then stops on its own.

Demo

(demo GIF coming soon)

Status line (always visible at the bottom of your terminal):

daily 5% ██░░░░░░░░ /70%  weekly 13% █░░░░░░░░░ /80%  reset 1h 42m

When you try to start a new task over the limit:

🛡️  claude-ration: daily usage 71% — limit (70%) exceeded
Cannot start new task. Reset in 82 minutes.
To override: claude-ration override

When the limit is hit mid-task:

[claude-ration] Daily limit 70% reached (current: 71%).
Please wrap up the current task and stop. New tool calls are now blocked.

Slash commands (built into Claude Code):

/ration-status     → show current usage + limits
/ration-set daily.stop 75  → update threshold
/ration-override 30        → disable limits for 30 min

Who this is for

Claude Pro users. The 5-hour usage window resets every 5 hours — and on Pro, it's easy to burn through it mid-task without realizing it.

This tool lets you reserve a buffer. Set your stop at 70% and you'll always have headroom left for follow-up questions, quick fixes, or emergencies — instead of hitting a wall at the worst moment.

On Claude Max? You probably hit limits less often, but claude-ration still works if you want tighter control.

Why this exists

Every existing tool only shows usage. None of them stop anything.

| Tool | Shows usage | Blocks work | Custom limit | |---|:---:|:---:|:---:| | claude-hud | ✅ | ❌ | ❌ | | ccstatusline | ✅ | ❌ | ❌ | | claude-ration | ✅ | | |

Install

npx claude-ration install

Restart Claude Code. That's it.

Note: Run this from each project directory where you use Claude Code.
Claude Code loads the nearest .claude/settings.local.json first, so the install command updates both your home directory and the current project automatically.

How it works

claude-ration hooks into three Claude Code lifecycle events:

StatusLine        → fetches live usage from Anthropic's OAuth API, displays it, saves state
UserPromptSubmit  → blocks new tasks when over the limit
PreToolUse        → blocks tool calls mid-task when the limit is hit

Graceful stop (default): tells Claude to finish what it's doing, then stop.
Hard stop: kills the next tool call immediately.

Reads your existing Claude Code credentials — no separate login, no API key needed.

Configure

# View current config
claude-ration config

# Change thresholds
claude-ration config set daily.stop 75
claude-ration config set weekly.stop 85

# Temporarily disable limits (default: 60 min)
claude-ration override
claude-ration override 30

Or use slash commands directly in Claude Code:

/ration-set daily.stop 75
/ration-override 30
/ration-status

Or edit ~/.claude/ration/config.json directly:

{
  "daily":  { "warn": 60, "stop": 70 },
  "weekly": { "warn": 70, "stop": 80 },
  "graceful": true
}

| Key | Default | Description | |---|---|---| | daily.warn | 60 | Yellow warning threshold (daily %) | | daily.stop | 70 | Hard stop threshold (daily %) | | weekly.warn | 70 | Yellow warning threshold (weekly %) | | weekly.stop | 80 | Hard stop threshold (weekly %) | | graceful | true | true = finish current task first, false = stop immediately |

Uninstall

npx claude-ration uninstall

License

MIT