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

tak-cc-statusline

v0.4.0

Published

A minimal, colorful statusline for Claude Code

Readme

tak-cc-statusline

A minimal, colorful statusline for Claude Code.

Opus 4.6 · high | prepare-deploy-3a • feature/louis-prepare-deploy | █░░░░░░░░░ 7% | 5h 21% (3h 12m) • 7d 3% (6d 9h) • Fable 12%

Install

npx -y tak-cc-statusline@latest

That's it. Restart Claude Code. First render shows blank usage stats — they appear on the second.

The installer prompts before overwriting any existing statusLine config or scripts. Existing fields like padding are preserved when updating.

Workspace trust required. Claude Code only runs statusline commands in directories you've accepted the workspace trust dialog for. If you see statusline skipped · restart to fix, open Claude Code in that directory and accept the trust prompt.

Requirements

jq, curl, Node 14+ (for the installer only). Works on macOS and Linux. Honors $CLAUDE_CONFIG_DIR if you've set it.

What it shows

| Segment | Source | |---|---| | Model · effort | Claude Code, with (1M context) etc. stripped; reasoning effort (.effort.level) appended when reported | | Session · branch | Claude Code's own session name (debegi-fa, or whatever you set with /rename), else the folder name; branch from git symbolic-ref | | Context bar + % | Claude Code's context_window.used_percentage | | 5h / 7d % | Anthropic OAuth usage endpoint (cached 60s) | | Per-model weekly % | Same endpoint's model-scoped weekly limits (e.g. Fable 12%); shown only when your plan has them, and labeled with whatever name the API reports |

Bar color: green < 50%, yellow ≥ 50%, rose ≥ 75%, red ≥ 90%.

Session name

The first row names the session rather than the folder, since the folder is the one thing you already know — the same name Claude Code shows for the session elsewhere: debegi-fa derived from the folder, fix-voice-session-detector if you set it with /rename.

Claude Code keeps one record per live session in ~/.claude/sessions/<pid>.json and puts its name there, so that is where the label comes from, matched on the session id. Two fallbacks behind it: session_name from the statusline payload, which Claude Code sends once you have run /rename, and then the folder name.

Labels are cut to 24 columns with an ellipsis, counting CJK characters as the two columns they occupy. Raise LABEL_MAX in statusline.sh for longer ones.

Narrow terminals

Claude Code truncates each status line rather than wrapping it, so on a narrow terminal the right-hand segments would simply disappear. Instead the line splits once, into identity and metrics:

Opus 4.6 · high | encl-7d • main | █░░░░░░░░░ 7% | 5h 21% (3h 12m) • 7d 3% (6d 9h) • Fable 12%   ← wide

Opus 4.6 · high | encl-7d • main                                                                 ← narrow
█░░░░░░░░░ 7% | 5h 21% (3h 12m) • 7d 3% (6d 9h) • Fable 12%

Two rows at most. On a narrow pane vertical space is scarcer than horizontal, and a third row costs more than the truncation it avoids — so past that point the tail gets cut (a branch name you already know, or the last usage figure) rather than a whole segment.

Width comes from $COLUMNS, which Claude Code sets for the statusline process. If it is missing everything stays on one line, which is also the exact output you get on a wide terminal — the split never changes a line that already fits.

Note that Claude Code re-runs the statusline on message and state changes, not on terminal resize, so after resizing the split catches up on the next turn. Add "refreshInterval": 2 to the statusLine block in settings.json if you want it to track the window immediately.

Customize

Both scripts live in ~/.claude/ after install — edit them in place.

  • Colors: pick_color() in statusline.sh
  • Bar width: BAR_WIDTH near the top of statusline.sh
  • Split threshold: WIDTH_MARGIN — columns held back from $COLUMNS; raise it to split earlier
  • Bar characters: █ and ░ in build_bar() — try ▓/▒, ■/□, ▰/▱
  • Session label length: LABEL_MAX near the top of statusline.sh
  • Model / session / branch colors: search for \033[38;2; near the bottom

Troubleshooting

statusline skipped · restart to fix

You haven't accepted the workspace trust dialog for the current directory. Restart Claude Code in that folder and accept the trust prompt — statusLine commands run shell scripts, so they require the same trust as hooks.

Usage stats don't appear

sh ~/.claude/fetch-usage.sh
cat ~/.claude/.statusline_usage_cache

A healthy cache is five lines: the 5h and 7d percentages, their two reset timestamps, and the per-model weekly limits (empty if your plan has none). If the file is empty, your OAuth token couldn't be read. macOS: check Keychain for Claude Code-credentials. Linux: check ~/.claude/.credentials.json exists.

API returns 401

The hardcoded user-agent: claude-code/2.1.11 may need bumping. Edit fetch-usage.sh.

Reset the caches

rm ~/.claude/.statusline_usage_cache ~/.claude/.statusline_token_cache

Uninstall

rm ~/.claude/statusline.sh ~/.claude/fetch-usage.sh
rm -f ~/.claude/.statusline_usage_cache ~/.claude/.statusline_token_cache

Then remove the statusLine block from ~/.claude/settings.json.

Credits

Forked from xleddyl/claude-watch — most of the heavy lifting (rate-limit fetching, color scheme, original layout) is theirs. This package adds:

  • npm one-liner install with conflict-aware prompts
  • macOS + Linux portability
  • $CLAUDE_CONFIG_DIR support
  • Background fetch with locking, atomic writes, and retry throttling
  • Per-model weekly limits from the usage endpoint's limits array
  • Width-aware layout that splits into two rows instead of being truncated
  • Session name in place of the folder name, read from Claude Code's session registry

License

MIT