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

@mingrath/claude-code-statusline

v1.0.0

Published

Real-time rate limit %, context window %, session cost, and git status in your Claude Code statusline

Readme

Claude Code Statusline

npm version License: MIT

Custom statusline for Claude Code that shows real-time rate limit usage percentages with progress bars.

Demo

What you see:

  • Line 1: Git branch + path + model name
  • Line 2: S: Session (cost, tokens, context %) L: 5-hour rate limit % W: Weekly all-models limit %

Quick Start

Option A: npm install (recommended)

npm i -g @mingrath/claude-code-statusline

Add to ~/.claude/settings.json:

{
  "statusLine": {
    "type": "command",
    "command": "bun -e \"import '@mingrath/claude-code-statusline'\"",
    "padding": 0
  }
}

Option B: Clone manually

git clone https://github.com/mingrath/claude-code-statusline.git ~/.claude/scripts/statusline
cd ~/.claude/scripts/statusline && bun install
cp statusline.config.example.json statusline.config.json

Add to ~/.claude/settings.json:

{
  "statusLine": {
    "type": "command",
    "command": "bun ~/.claude/scripts/statusline/src/index.ts",
    "padding": 0
  }
}

Features

  • Git branch with dirty indicator and staged/unstaged counts
  • Session cost ($) and duration
  • Context tokens used with progress bar (% of 200k window)
  • 5-hour rate limit utilization % with reset countdown (from Claude API)
  • Weekly all-models limit % with reset countdown (from Claude API)
  • Configurable progress bar styles (braille, filled, rectangle)
  • Progressive color coding (gray < 50%, yellow < 70%, orange < 90%, red 90%+)

How It Works

The statusline fetches real utilization percentages from Claude's OAuth API using the same authentication as Claude Code itself. The key is the anthropic-beta: oauth-2025-04-20 header.

Data flow:

Claude Code Hook (stdin JSON) --> index.ts
                                    |
                    +---------------+---------------+
                    |               |               |
              [Git Status]   [Context Data]   [Usage Limits API]
                    |               |               |
                    +-------+-------+-------+-------+
                            |
                    [Render Statusline]
                            |
                        stdout

Configuration

Edit statusline.config.json to customize:

| Section | Options | |---------|---------| | session | cost, duration, tokens, context % with progress bar | | limits | 5-hour utilization %, progress bar, reset countdown | | weeklyUsage | Weekly utilization %, progress bar, reset countdown | | git | branch, dirty indicator, staged/unstaged counts |

Progress Bar Styles

braille:    ⣿⣿⣿⣿⣿⣤⣀⣀⣀⣀
filled:     ████████░░░░░░░
rectangle:  ▰▰▰▰▰▰▱▱▱▱

Color Modes

  • progressive - Changes color based on usage (gray → yellow → orange → red)
  • green, yellow, red, peach - Fixed color

Project Structure

src/
├── index.ts              # Main entry - orchestrates data + render
└── lib/
    ├── config-types.ts   # TypeScript config interfaces
    ├── config.ts         # Config loader
    ├── context.ts        # Context token calculation
    ├── features/
    │   └── limits.ts     # OAuth API usage limits fetcher
    ├── formatters.ts     # Colors, progress bars, formatting
    ├── git.ts            # Git branch + changes
    ├── render-pure.ts    # Pure renderer (data + config → string)
    └── types.ts          # Hook input types

Requirements

  • Bun runtime
  • Claude Code with OAuth authentication (subscription plan)
  • macOS (uses Keychain for OAuth token) or Linux (~/.claude/.credentials.json)

Development

bun install
bun run test
bun run lint

Related

  • claude-code-notify — Get push notifications on Mac, iPhone, and Apple Watch when Claude Code needs your input. Uses terminal-notifier + ntfy.sh. Great companion for autonomous "walk away" sessions.

License

MIT