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-context-window

v0.2.1

Published

Real-time context window usage bar for Claude Code

Readme

Claude: Context Window

CI npm version Downloads License

Real-time context window usage bar for Claude Code.

Shows a two-line status bar in Claude Code with project info on the first line and a color-coded context window progress bar on the second.

[user] [project]:[repo-name]/[main] [+3 ~2]
[Opus 4.6] [100K/1M tokens] █░░░░░░░░░ [10%]     ← green

The first line shows the OS username, project directory, a clickable link to the git repo (Cmd/Ctrl+click), branch name, and staged/modified file counts. The second line shows the model (with effort level if available), token usage, and a color-coded progress bar.

Installation

There are three ways to install, depending on your setup. Restart Claude Code after installing.

Option 1: npx (standalone)

The quickest way if you just want the status bar. No plugin system needed.

npx claude-context-window@latest

Copies the script to ~/.claude/statusline.js and configures ~/.claude/settings.json.

To remove:

npx claude-context-window@latest uninstall

Option 2: Claude Code plugin (from this repo)

Register this repository as a plugin marketplace, then install the plugin:

claude plugin marketplace add https://github.com/matuscvengros/claude-context-window
claude plugin install claude-context-window

Once installed, activate the status line:

/claude-context-window:install

This points the status line directly at the plugin's cached copy of the script — nothing is copied to ~/.claude/. To remove:

/claude-context-window:uninstall

Option 3: Shell script (Docker / CI)

For headless environments where there is no interactive Claude Code session. Requires node and jq.

./install.sh
./install.sh --force   # overwrite existing statusLine from another tool
./uninstall.sh

Copies the script to ~/.claude/statusline.js and configures ~/.claude/settings.json. The script resolves its own location, so it works from any working directory — just call it by its path.

How it works

Claude Code's status line is a customizable bar at the bottom of the terminal. It runs a shell command after each assistant message, piping JSON session data to stdin. The command's stdout becomes the status bar content.

This tool provides that command: a Node.js script that reads the JSON and outputs two lines — project/git info and a color-coded context window progress bar.

Colors indicate context usage:

| Color | Usage | Meaning | |--------|---------|---------------| | Green | 0–50% | Plenty of room | | Yellow | 50–75% | Getting there | | Orange | 75–90% | Caution | | Red | 90–100% | Nearly full |

The script has zero dependencies, runs in under 100ms, and handles edge cases gracefully (null fields before the first API call, missing data, auto-compaction resets).

Ownership detection

All install methods embed a # claude-context-window marker comment in the settings.json command string. This allows safe uninstall — the tool only removes its own statusLine entry and will not touch configurations from other tools.

Requirements

  • Node.js >= 18
  • Claude Code
  • jq (only for install.sh / uninstall.sh)

License

MIT