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

cc-context-stats

v1.3.0

Published

Custom status line scripts for Claude Code

Readme

Claude Code Context Stats

PyPI version Downloads License: MIT

Never run out of context unexpectedly - monitor your session context in real-time.

Context Stats

Why Context Stats?

When working with Claude Code on complex tasks, you can easily burn through your context window without realizing it. As your context fills up, Claude's performance degrades - this is what Dex Horthy calls the "dumb zone". Context Stats helps you:

  • Know your zone - See if you're in the Smart Zone, Dumb Zone, or Wrap Up Zone
  • Track context usage - Real-time monitoring with live-updating graphs
  • Get early warnings - Color-coded status alerts you before performance degrades
  • Make informed decisions - Know when to start a fresh session

Context Zones

| Zone | Context Used | Status | What It Means | | ------------------- | ------------ | -------- | --------------------------------------------- | | 🟢 Smart Zone | < 40% | Optimal | Claude is performing at its best | | 🟡 Dumb Zone | 40-80% | Degraded | Context getting full, Claude may miss details | | 🔴 Wrap Up Zone | > 80% | Critical | Better to wrap up and start a new session |

Installation

pip install cc-context-stats

Or with uv:

uv pip install cc-context-stats

Quick Start

Real-Time Monitoring

Get your session ID from the status line (the last part after the pipe |), then run:

context-stats <session_id>

For example:

context-stats abc123def-456-789

This opens a live dashboard that refreshes every 2 seconds, showing:

  • Your current project and session
  • Context growth per interaction graph
  • Your current zone status
  • Remaining context percentage

Press Ctrl+C to exit.

Status Line Integration

Add to ~/.claude/settings.json:

{
  "statusLine": {
    "type": "command",
    "command": "claude-statusline"
  }
}

Restart Claude Code to see real-time token stats in your status bar.

Context Stats CLI

context-stats                    # Live monitoring (default)
context-stats -w 5               # Custom refresh interval (5 seconds)
context-stats --no-watch         # Show once and exit
context-stats --type cumulative  # Show cumulative context usage
context-stats --type both        # Show both graphs
context-stats --type all         # Show all graphs including I/O
context-stats <session_id>       # View specific session

Output Example

Context Stats (my-project • abc123def)

Context Growth Per Interaction
Max: 4,787  Min: 0  Points: 254
...graph...

Session Summary
----------------------------------------------------------------------------
  Context Remaining:   43,038/200,000 (21%)
  >>> DUMB ZONE <<< (You are in the dumb zone - Dex Horthy says so)

  Last Growth:         +2,500
  Input Tokens:        1,234
  Output Tokens:       567
  Lines Changed:       +45 / -12
  Total Cost:          $0.1234
  Model:               claude-sonnet-4-20250514
  Session Duration:    2h 29m

Status Line

Status Line

The status line shows at-a-glance metrics in your Claude Code interface:

| Component | Description | | --------- | ----------------------------------------- | | Model | Current Claude model | | Context | Tokens used / remaining with color coding | | Delta | Token change since last update | | Git | Branch name and uncommitted changes | | Session | Session ID for correlation |

Configuration

Create ~/.claude/statusline.conf:

token_detail=true   # Show exact token counts (vs abbreviated like "12.5k")
show_delta=true     # Show token delta in status line
show_session=true   # Show session ID
autocompact=true    # Show autocompact buffer indicator

Shell Script Installation

For users who prefer shell scripts:

curl -fsSL https://raw.githubusercontent.com/luongnv89/cc-context-stats/main/install.sh | bash

How It Works

Context Stats hooks into Claude Code's state files to track token usage across your sessions. Data is stored locally in ~/.claude/statusline/ and never sent anywhere.

Documentation

Migration from cc-statusline

If you were using the previous cc-statusline package:

pip uninstall cc-statusline
pip install cc-context-stats

The claude-statusline command still works. The main change is token-graph is now context-stats.

Related

License

MIT