@zlemon317/cc-statusline
v1.0.5
Published
Custom status line for Claude Code: model, context usage, session duration, CPU, git branch & changes
Maintainers
Readme
cc-statusline
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:

matrix theme:

ocean theme:

Features
- Current model name
- Model effort level and thinking mode status
- Context usage percentage with progress bar
- Automatic context-window mapping by model name (128k–2M; Qwen / DeepSeek / GLM / Kimi / MiniMax / GPT / Gemini / Grok; Claude uses the JSON-provided value)
- 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 @zlemon317/cc-statusline@latestGlobal install
# 1. Install the package
npm install -g @zlemon317/cc-statusline
# 2. Run the setup script
cc-statuslineThe 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 @zlemon317/cc-statusline@latest --uninstallRestores 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 statsbash— required on Windows (ships with Git for Windows); preinstalled on macOS/Linux
Windows note: the installer locates
bash,jq, andgitvia yourPATH. Git for Windows' default setup only addsGit\cmdtoPATH, which containsgit.exebut notbash.exe— addGit\usr\binto yourPATHas well. After installing dependencies or editingPATH, open a new terminal window before running the installer (existing windows keep the oldPATH).
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/1M) | ◷ Duration: 5m32s | ▣ CPU: 23% | Δ +128 -45Model context window mapping
The status line automatically matches the context window size by model name — no manual configuration needed:
| Model family | Context window | |---------|-----------| | qwen3.8-max / qwen3.7-max / qwen3.7-plus / qwen3.7-flash / qwen3.6-plus / qwen3.6-flash | 1M | | deepseek-v4-pro / deepseek-v4-flash | 1M | | deepseek-v3.2 | 128k | | glm-5.2 | 1M | | glm-5.1 / glm-5 | 200k | | kimi-k3 / k3 | 1M | | k3-256k | 256k | | kimi-k2.7-code / kimi-k2.6 / kimi-k2.5 / kimi-for-coding | 256k | | kimi (legacy) | 128k | | minimax-m3 | 1M | | minimax-m2 / m2.5 / m2.7 | 204.8k | | gpt-5.6 (sol / terra / luna) | 1.05M | | gpt-5.5 | 1M | | gpt-5 pro / 5.1 / 5.3 / 5.4 (codex) | 400k | | gpt-4.1 | 1M | | gpt-4o / gpt-4-turbo | 128k | | gemini 3 / 3.1 (pro / flash) | 1M | | grok-4.1-fast / grok-4.20 | 2M | | grok-4.5 | 500k | | grok-4.3 | 1M | | grok-4 | 256k | | claude (any) | JSON-provided value (200k standard / 1M beta) | | Unknown models | JSON-provided value, else 200k (default) |
The mapping lives in the get_model_context_window() function in bin/statusline.sh. Model matching is case-insensitive. Priority: name mapping > JSON-provided context_window_size > 200k default. If your gateway uses different model names, just add a line to that function.
[1m] is Claude Code's suffix for 1M-context-window models (e.g. deepseek-v4-flash[1m]) — it is not a separate model ID. A top-level override in get_model_context_window() treats any [1m]-suffixed name as 1M, so no per-model entries are needed for it.
Releasing
Publishing is automated via GitHub Actions (.github/workflows/publish.yml):
git tag v1.0.0
git push origin v1.0.0The workflow syncs the package.json version from the tag and publishes to the public npm registry (requires an NPM_TOKEN repository secret).
License
中文说明
Claude Code 自定义状态行工具,实时展示模型名称、上下文使用率、会话时长、CPU 使用率、代码仓库、Git 分支与代码变更统计等。
安装
npx @zlemon317/cc-statusline@latest卸载
npx @zlemon317/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/1M) | ◷ Duration: 5m32s | ▣ CPU: 23% | Δ +128 -45模型上下文窗口映射
状态行会按模型名称自动匹配上下文窗口大小(覆盖 128k / 200k / 256k / 400k / 500k / 1M / 2M,含 Qwen、DeepSeek、GLM、Kimi、MiniMax、GPT、Gemini、Grok 系列;Claude 直接使用 JSON 提供的准确值),映射规则位于 bin/statusline.sh 的 get_model_context_window() 函数中,模型匹配不区分大小写。优先级:名称映射 > JSON 提供的 context_window_size > 200k 默认值。如果你的网关使用不同的模型名,直接在该函数里加一行即可。
另外,Claude Code 为 1M 上下文窗口的模型约定在模型 ID 后追加 [1m] 后缀(如 deepseek-v4-flash[1m])。这并非独立模型 ID,get_model_context_window() 中的一条顶层覆盖规则会把任何带 [1m] 后缀的名字强制识别为 1M,因此无需为它单独列出模型条目。
