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

@leaf-x317/cc-statusline

v1.0.6

Published

Custom status line for Claude Code: model, context usage, session duration, CPU, git branch & changes

Readme

cc-statusline

npm version npm downloads license

A custom status line for Claude Code — shows model name, context usage, session duration, CPU utilization, repo name, git branch, and code change stats at a glance.

中文说明

classic theme:

classic theme

matrix theme:

matrix theme

ocean theme:

ocean theme

Features

  • Current model name
  • Model effort level and thinking mode status
  • Context usage percentage with progress bar
  • Context usage measured against the window Claude Code actually uses (1M for [1m]-suffixed model IDs, 200k otherwise)
  • Session duration
  • CPU utilization (Linux, including WSL; hidden on macOS and native Windows, which lack /proc/stat)
  • Current working directory and repository name
  • Git branch
  • Code change stats (added / removed lines)
  • Switchable themes (classic / matrix / ocean)

Installation

Via npx (recommended)

npx @leaf-x317/cc-statusline@latest

Global install

# 1. Install the package
npm install -g @leaf-x317/cc-statusline

# 2. Run the setup script
cc-statusline

The installer copies the status line script to ~/.claude/statusline.sh (backing up any existing one) and writes the statusLine config into ~/.claude/settings.json.

Uninstall

npx @leaf-x317/cc-statusline@latest --uninstall

Restores your previous status line from backup (or removes it) and cleans up settings.json.

Dependencies

  • jq — JSON processing (apt install jq / yum install jq / brew install jq / winget install jqlang.jq)
  • git — branch and diff stats
  • bash — required on Windows (ships with Git for Windows); preinstalled on macOS/Linux

Windows note: the installer locates bash, jq, and git via your PATH. Git for Windows' default setup only adds Git\cmd to PATH, which contains git.exe but not bash.exe — add Git\usr\bin to your PATH as well. After installing dependencies or editing PATH, open a new terminal window before running the installer (existing windows keep the old PATH).

Themes

Edit ~/.claude/statusline.sh and change the THEME variable:

THEME="classic"  # classic theme (blue)
THEME="matrix"   # matrix theme (green)
THEME="ocean"    # ocean theme (cyan)

Or set the CC_STATUSLINE_THEME environment variable — it survives reinstalls. Add it to the env section of ~/.claude/settings.json:

"env": {
  "CC_STATUSLINE_THEME": "matrix"
}

Sample output

✦ kimi-k3 (high, thinking) | ◼ /workspace | ⎔ cc-statusline | ⌥ main
◔ Context: ████████░░ 82% (165k/200k) | ◷ Duration: 5m32s | ▣ CPU: 23% | Δ +128 -45

Context window

Claude Code determines the context window itself and reports it in the status line JSON as context_window_size: models whose ID carries the [1m] suffix get 1M tokens, everything else defaults to 200k. The status line uses that value as-is, so its percentage always matches the window Claude Code actually compacts against. There is no model-name mapping table to maintain.

[1m] is a suffix Claude Code appends to the model ID for 1M-context models (e.g. deepseek-v4-flash[1m]) — it is not a separate model ID. If context_window_size is missing, the script applies the same rule as a fallback: [1m] suffix → 1M, otherwise → 200k.

Releasing

Publishing is automated via GitHub Actions (.github/workflows/publish.yml):

git tag v1.0.0
git push origin v1.0.0

The workflow syncs the package.json version from the tag and publishes to the public npm registry (requires an NPM_TOKEN repository secret).

License

MIT


中文说明

Claude Code 自定义状态行工具,实时展示模型名称、上下文使用率、会话时长、CPU 使用率、代码仓库、Git 分支与代码变更统计等。

安装

npx @leaf-x317/cc-statusline@latest

卸载

npx @leaf-x317/cc-statusline@latest --uninstall

依赖

  • jq - JSON 处理工具(apt install jq / yum install jq / brew install jq / winget install jqlang.jq)
  • git - 版本控制工具
  • bash - 仅 Windows 需要(随 Git for Windows 提供);macOS/Linux 已预装

Windows 提示: 安装程序通过 PATH 查找 bash、jq、git。Git for Windows 默认安装只把 Git\cmd 加入 PATH(其中有 git.exe 但没有 bash.exe),需手动将 Git\usr\bin 也加入 PATH。安装依赖或修改 PATH 后,请重新打开终端窗口再运行安装程序(已打开的窗口仍使用旧的 PATH)。

主题配置

编辑 ~/.claude/statusline.sh 文件,修改 THEME 变量:

THEME="classic"  # 经典主题(蓝色系)
THEME="matrix"   # 矩阵主题(绿色系)
THEME="ocean"    # 海洋主题(青色系)

也可以设置 CC_STATUSLINE_THEME 环境变量——重装不会丢失。在 ~/.claude/settings.json 的 env 中添加:

"env": {
  "CC_STATUSLINE_THEME": "matrix"
}

示例输出

✦ kimi-k3 (high, thinking) | ◼ /workspace | ⎔ cc-statusline | ⌥ main
◔ Context: ████████░░ 82% (165k/200k) | ◷ Duration: 5m32s | ▣ CPU: 23% | Δ +128 -45

上下文窗口

Claude Code 会自行判定上下文窗口,并通过状态行 JSON 的 context_window_size 上报:模型 ID 带 [1m] 后缀(如 deepseek-v4-flash[1m])时为 1M,其余默认 200k。状态行直接使用该值,因此显示的百分比与 Claude Code 实际压缩所依据的窗口一致,无需维护模型名映射表。

若 JSON 未提供 context_window_size,脚本按同样的规则兜底:带 [1m] 后缀 → 1M,否则 → 200k。

许可证

MIT