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

ailimits

v0.3.0

Published

Show your current Claude Code subscription usage limits

Readme

ailimits

A small TypeScript CLI that reports your current Claude Code subscription usage limits — the same 5-hour and 7-day rate-limit windows shown by Claude Code's built-in /usage command.

How it works

  1. Reads your Claude Code OAuth token from the OS credential store — macOS Keychain or Windows Credential Manager (target Claude Code-credentials) — and falls back to ~/.claude/.credentials.json (also %APPDATA%\.claude\.credentials.json on Windows) when no OS store entry is present.
  2. Calls GET https://api.anthropic.com/api/oauth/usage — the endpoint Claude Code itself uses — and prints the utilization of each window.

No credentials are stored or transmitted anywhere except to Anthropic's API.

Requirements

  • Node.js 20+ (uses the built-in fetch)
  • Claude Code installed and logged in (run claude once)

Use as a CLI

npx ailimits          # one-off, no install
npx ailimits --json   # raw JSON from the API

npm install -g ailimits   # or install the `ailimits` command
ailimits
ailimits --json

Use as a dependency

npm install ailimits
import { getUsage } from 'ailimits';

// Convenience: read local credentials and return the raw usage payload.
const usage = await getUsage();
console.log(usage.five_hour?.utilization);
// Or compose the building blocks yourself (e.g. a custom renderer).
import {
  UsageApp,
  KeychainCredentialsProvider,
  AnthropicUsageProvider,
  PrettyRenderer,
} from 'ailimits';

await new UsageApp(
  new KeychainCredentialsProvider(),
  new AnthropicUsageProvider(),
  new PrettyRenderer(),
).run();

Importing the package is side-effect-free — nothing runs until you call it, and the library throws on error instead of calling process.exit. The tool only works where Claude Code credentials exist locally (e.g. a dev machine).

Local development

npm install            # install dev dependencies (TypeScript)
npm run build          # compile src/ → dist/
npm start              # pretty output
npm run dev            # build + run in one step

Architecture

The project follows a hexagonal layout under src/:

  • core/ — domain types, ports (interfaces) and the UsageApp use case. Contains no I/O.
  • adapters/ — driven adapters that implement the ports: reading credentials from the Keychain/file and fetching usage from the API.
  • presentation/ — driving adapters that render output (PrettyRenderer, JsonRenderer).
  • index.ts — the library entry point: side-effect-free re-exports plus the getUsage() convenience function.
  • cli.ts — the CLI entry point (bin): the composition root that wires adapters into UsageApp. Consumes the public API from index.ts.

Example output:

Claude Code usage limits

  5-hour window          [██░░░░░░░░░░░░░░░░░░]   8%  (resets 5/18/2026, 8:20:00 PM)
  7-day window           [██░░░░░░░░░░░░░░░░░░]  12%  (resets 5/22/2026, 8:00:00 PM)