|
1 | 1 | # Statusline |
2 | 2 |
|
3 | | -A Claude Code plugin that provides real-time visibility into your coding session. Track context usage, API rate limits, active tools, running agents, and task progress at a glance. |
| 3 | +A Claude Code plugin that provides real-time visibility into your coding session. Track context usage, cache hit rates, session duration, API rate limits, active tools, and running agents — all at a glance. |
4 | 4 |
|
5 | | -**Multi-provider support:** Automatically detects Anthropic vs z.ai GLM models and shows provider-specific metrics. |
| 5 | +**Dual-provider support:** Automatically adapts to Anthropic Claude and z.ai GLM models with provider-specific metrics. |
6 | 6 |
|
7 | | -## Overview |
| 7 | +## Quick Start |
8 | 8 |
|
9 | | -Statusline keeps you informed about what's happening during your Claude Code session without interrupting your workflow. |
| 9 | +```bash |
| 10 | +/plugin install statusline |
| 11 | +/statusline:setup |
| 12 | +``` |
10 | 13 |
|
11 | | -| Metric | Anthropic | z.ai GLM | |
12 | | -|--------|-----------|----------| |
13 | | -| **Context Health** | Token count, percentage, progress bar | Token count, percentage, progress bar | |
14 | | -| **Rate Limits** | 5h utilization, 7d utilization | Token quota %, monthly tools % | |
15 | | -| **Tool Breakdown** | — | Search, Web, ZRead usage counts | |
16 | | -| **Active Tools** | MCP server detection | MCP server detection | |
17 | | -| **Agent Tracking** | Running agents and count | Running agents and count | |
18 | | -| **Task Progress** | Todo completion tracking | Todo completion tracking | |
| 14 | +Answer 4 questions and your statusline is live. That's it. |
19 | 15 |
|
20 | | -## Installation |
| 16 | +## What You See |
21 | 17 |
|
22 | | -Add the plugin to your Claude Code instance: |
| 18 | +The statusline renders in your terminal below the input prompt, updating automatically every turn. |
| 19 | + |
| 20 | +### 3-line Detailed (default) |
23 | 21 |
|
24 | | -```bash |
25 | | -/plugin install statusline |
| 22 | +``` |
| 23 | +📁 monorepo (master) → 🤖 opus-4.8[200k] (medium) → ⏳ 23m |
| 24 | +📊 ██░░░░░░░░ 21% (43k/200k) → 🗃️ 98% (42k/43k) cache hit → ⏱️ 5h: 45% | 7d: 28% |
| 25 | +🔧 Seq Ctx7 |
26 | 26 | ``` |
27 | 27 |
|
28 | | -## Commands |
| 28 | +### 2-line Balanced |
29 | 29 |
|
30 | | -| Command | Purpose | |
31 | | -|---------|---------| |
32 | | -| `/statusline:status` | Display current session metrics | |
33 | | -| `/statusline:config` | Configure display format (1/2/3 lines) | |
34 | | -| `/statusline:setup` | Interactive setup wizard | |
35 | | -| `/statusline:disable` | Pause automatic status updates | |
| 30 | +``` |
| 31 | +monorepo (master) → opus-4.8[200k] (medium) → 23m |
| 32 | +██░░░░░░░░ 21% (43k/200k) → cache 98% (42k/43k) → 5h: 45% | 7d: 28% → Seq Ctx7 |
| 33 | +``` |
| 34 | + |
| 35 | +### 1-line Minimal |
36 | 36 |
|
37 | | -## Provider Auto-Detection |
| 37 | +``` |
| 38 | +monorepo (master) · opus-4.8[200k] (medium) · 21% · 5h: 45% | 7d: 28% |
| 39 | +``` |
| 40 | + |
| 41 | +## Features |
38 | 42 |
|
39 | | -The plugin automatically detects your model provider: |
| 43 | +### 📊 Context Health |
40 | 44 |
|
41 | | -- **Anthropic** — Any Claude model (claude-opus, claude-sonnet, claude-haiku, etc.) |
42 | | -- **z.ai GLM** — Any model starting with `glm-` (glm-5.1, glm-4, glm-flash, etc.) |
| 45 | +See how much of your context window you've used — with color-coded thresholds: |
43 | 46 |
|
44 | | -Detection happens from the model ID injected by Claude Code into the statusline JSON input. |
| 47 | +| Range | Color | Meaning | |
| 48 | +|-------|-------|---------| |
| 49 | +| 0–49% | 🟢 Green | Plenty of room | |
| 50 | +| 50–69% | 🟡 Dim yellow | Starting to fill | |
| 51 | +| 70–84% | 🟡 Bold yellow | Getting tight | |
| 52 | +| 85%+ | 🔴 Bold red | Approaching limit | |
45 | 53 |
|
46 | | -## Display Formats |
| 54 | +Three display styles: |
| 55 | +- **Progress bar**: `██░░░░░░░░ 21% (43k/200k)` |
| 56 | +- **With tokens**: `21% (43k/200k)` |
| 57 | +- **Compact**: `21%` |
47 | 58 |
|
48 | | -### 1-line (Compact) |
| 59 | +### 🗃️ Cache Hit Rate (Anthropic only) |
| 60 | + |
| 61 | +Shows how effective prompt caching is for your session: |
49 | 62 |
|
50 | | -Everything on a single line: |
51 | 63 | ``` |
52 | | -claude-plugins (master) │ GLM 5.1 │ ctx: 21% 43k/200k │ tokens: 15% │ tools: 11% (883 left) |
| 64 | +🗃️ 98% (42k/43k) cache hit |
53 | 65 | ``` |
54 | 66 |
|
55 | | -### 2-line (Default) |
| 67 | +- Percentage with decimal precision when ≥99% (e.g., `99.98%`) |
| 68 | +- Token breakdown: cached reads vs total cacheable tokens |
| 69 | +- **Only shown for Anthropic Claude models** — GLM proxy values aren't real cache metrics |
| 70 | + |
| 71 | +### ⏳ Session Duration |
| 72 | + |
| 73 | +Tracks how long your current session has been running: |
| 74 | + |
| 75 | +``` |
| 76 | +⏳ 1h23m |
| 77 | +``` |
| 78 | + |
| 79 | +- File-based tracker persists across statusline updates |
| 80 | +- Auto-resets after 24 hours of inactivity |
| 81 | + |
| 82 | +### ⏱️ Rate Limits |
| 83 | + |
| 84 | +**Anthropic Claude** — 5-hour and 7-day utilization with reset timers: |
56 | 85 |
|
57 | | -Location + model on line 1, all metrics on line 2: |
58 | 86 | ``` |
59 | | -claude-plugins (master) │ GLM 5.1 │ v2.0.76 |
60 | | -ctx: 21% 43k/200k │ tokens: 15% │ tools: 11% (883 left) Web:35 ZRead:82 |
| 87 | +⏱️ 5h: 45% (reset 1h12m) | 7d: 28% |
61 | 88 | ``` |
62 | 89 |
|
63 | | -### 3-line (Detailed) |
| 90 | +**z.ai GLM** — Shown when available from the API: |
64 | 91 |
|
65 | | -Full layout with progress bar and token details: |
66 | 92 | ``` |
67 | | -claude-plugins (master) │ GLM 5.1 │ v2.0.76 │ explanatory |
68 | | -ctx: ██░░░░░░░░ 21% (43k/200k tokens) │ tokens: 15% │ tools: 11% (883 left) Web:35 ZRead:82 |
69 | | -Tools: Seq Ctx7 │ Agents: 2 active │ Tasks: 3/5 (60%) |
| 93 | +⏱️ rate-limits: n/a |
70 | 94 | ``` |
71 | 95 |
|
72 | | -## Context Health |
| 96 | +Rate limits use the same color thresholds as context health. |
| 97 | + |
| 98 | +### 🤖 Model Name |
73 | 99 |
|
74 | | -Color-coded progress indicator: |
75 | | -- 🟢 Green: 0-60% — Comfortable |
76 | | -- 🟡 Yellow: 60-85% — Getting full |
77 | | -- 🔴 Red: 85%+ — Approaching limit |
| 100 | +Simplified model names with context window size: |
78 | 101 |
|
79 | | -The 3-line format includes a visual progress bar: `███░░░░░░░ 30%` |
| 102 | +| Raw Model ID | Display | |
| 103 | +|-------------|---------| |
| 104 | +| `claude-opus-4-8` | `opus-4.8[200k]` | |
| 105 | +| `claude-sonnet-4-6` | `sonnet-4.6[200k]` | |
| 106 | +| `glm-5.1[1m]` | `glm-5.1[1m]` | |
80 | 107 |
|
81 | | -## API Rate Limits |
| 108 | +Effort/reasoning level shown in parentheses: `opus-4.8[200k] (medium)` |
82 | 109 |
|
83 | | -### Anthropic |
| 110 | +### 🔧 Active Tools & Agents |
| 111 | + |
| 112 | +Process-detected MCP servers and running agent count: |
84 | 113 |
|
85 | | -Shows 5-hour and 7-day utilization percentages: |
86 | 114 | ``` |
87 | | -5h: 42% │ 7d: 28% |
| 115 | +🔧 Seq Ctx7 ZRead |
| 116 | +👷 3 active |
88 | 117 | ``` |
89 | 118 |
|
90 | | -Requires Claude Code OAuth credentials (auto-detected from keychain or config files). |
| 119 | +Hidden when idle: `💤 idle` |
| 120 | + |
| 121 | +### 📁 Project & Branch |
91 | 122 |
|
92 | | -### z.ai GLM |
| 123 | +Current directory and git branch: |
93 | 124 |
|
94 | | -Shows token quota and monthly tool usage: |
95 | 125 | ``` |
96 | | -tokens: 15% │ tools: 11% (883 left) Web:35 ZRead:82 |
| 126 | +📁 monorepo (master) |
97 | 127 | ``` |
98 | 128 |
|
99 | | -- **tokens** — 5-hour rolling window (equivalent to Anthropic's 5h) |
100 | | -- **tools** — Monthly tool quota with remaining count |
101 | | -- **Per-tool breakdown** — Search, Web-reader, ZRead usage |
| 129 | +## Dual-Provider Support |
| 130 | + |
| 131 | +| Feature | Anthropic Claude | z.ai GLM | |
| 132 | +|---------|-----------------|----------| |
| 133 | +| Model name | Simplified (e.g., `opus-4.8[200k]`) | Preserved from model ID | |
| 134 | +| Rate limits | 5h/7d from JSON payload | Shown when available | |
| 135 | +| Cache stats | ✅ Real prompt caching data | ❌ Hidden (proxy artifacts) | |
| 136 | +| Context window | From JSON payload | From JSON payload | |
| 137 | +| Effort level | low/medium/high/max | low/medium/high/max | |
| 138 | +| Session/tools | All features | All features | |
| 139 | + |
| 140 | +## Template Presets |
| 141 | + |
| 142 | +Six built-in presets for different workflows. Apply via `/statusline:config` → Template: |
| 143 | + |
| 144 | +| Template | Lines | Icons | Focus | |
| 145 | +|----------|-------|-------|-------| |
| 146 | +| **Detailed** | 3 | emoji | Full visibility — everything shown | |
| 147 | +| **Balanced** | 2 | unicode | Quick overview — key metrics only | |
| 148 | +| **Minimal** | 1 | none | Maximum space — bare essentials | |
| 149 | +| **Monitor** | 2 | emoji | Rate-limit tracking — hides tools | |
| 150 | +| **Developer** | 2 | unicode | Tools + agents + git focused | |
| 151 | +| **Performance** | 3 | emoji | Cache + context optimization | |
| 152 | + |
| 153 | +## Configuration |
| 154 | + |
| 155 | +All settings stored in `~/.claude/statusline.config.json`: |
| 156 | + |
| 157 | +```json |
| 158 | +{ |
| 159 | + "line_format": "3", |
| 160 | + "separator": "arrow", |
| 161 | + "context_style": "progress_bar", |
| 162 | + "icon_style": "emoji", |
| 163 | + "show_context": true, |
| 164 | + "show_rate_limits": true, |
| 165 | + "show_git_branch": true, |
| 166 | + "show_tools": true, |
| 167 | + "show_agents": true, |
| 168 | + "show_cache": true, |
| 169 | + "show_session": true, |
| 170 | + "show_reasoning": true, |
| 171 | + "color_style": "colorful" |
| 172 | +} |
| 173 | +``` |
| 174 | + |
| 175 | +### Config Reference |
| 176 | + |
| 177 | +| Field | Values | Default | Description | |
| 178 | +|-------|--------|---------|-------------| |
| 179 | +| `line_format` | `"1"`, `"2"`, `"3"` | `"3"` | Number of output lines | |
| 180 | +| `separator` | `"arrow"`, `"pipe"`, `"dot"`, `"slash"` | `"arrow"` | Section separator | |
| 181 | +| `context_style` | `"progress_bar"`, `"tokens"`, `"compact"` | `"progress_bar"` | Context display format | |
| 182 | +| `icon_style` | `"emoji"`, `"unicode"`, `"minimal"` | `"emoji"` | Icon theme | |
| 183 | +| `show_context` | boolean | `true` | Token count and percentage | |
| 184 | +| `show_rate_limits` | boolean | `true` | API usage metrics | |
| 185 | +| `show_git_branch` | boolean | `true` | Current git branch | |
| 186 | +| `show_tools` | boolean | `true` | Running MCP servers | |
| 187 | +| `show_agents` | boolean | `true` | Running agent count | |
| 188 | +| `show_cache` | boolean | `true` | Cache hit rate (Claude only) | |
| 189 | +| `show_session` | boolean | `true` | Session duration | |
| 190 | +| `show_reasoning` | boolean | `true` | Effort level next to model | |
102 | 191 |
|
103 | | -#### z.ai Credential Sources (tried in order) |
| 192 | +## Commands |
104 | 193 |
|
105 | | -1. **macOS Keychain** — `security add-generic-password -s "z.ai" -w "your-key"` |
106 | | -2. **Environment** — `ZAI_API_KEY` or `ZAI_CODING_PLAN_KEY` |
107 | | -3. **Config files** — `~/.local/share/opencode/auth.json` or `~/.zai/auth.json` |
| 194 | +| Command | Purpose | |
| 195 | +|---------|---------| |
| 196 | +| `/statusline:setup` | Interactive setup wizard | |
| 197 | +| `/statusline:config` | Quick layout/style changes | |
| 198 | +| `/statusline:status` | Display current session metrics | |
| 199 | +| `/statusline:disable` | Pause automatic status updates | |
108 | 200 |
|
109 | 201 | ## Smart Hiding |
110 | 202 |
|
111 | | -Empty values are never shown: |
112 | | -- No "None", "0%", or "No tasks" clutter |
113 | | -- Tool/agent sections hidden when inactive |
114 | | -- Per-tool breakdown only shown when usage > 0 |
115 | | -- Output style hidden when set to "default" |
| 203 | +Empty values are never shown — no "0%" or "n/a" clutter: |
| 204 | +- Cache section hidden for GLM models (not real data) |
| 205 | +- Rate limits show "n/a" only when provider data is genuinely unavailable |
| 206 | +- Tools/agents sections collapse when nothing is running |
| 207 | +- Session duration hidden on first render (0s) |
116 | 208 |
|
117 | 209 | ## Requirements |
118 | 210 |
|
119 | 211 | - Claude Code v1.0.80+ |
120 | | -- Node.js 18+ (for TypeScript CLI) |
121 | | -- `jq` (for Bash statusline script) |
122 | | - |
123 | | -## Contributing |
124 | | - |
125 | | -Found an issue or have a feature idea? Open an issue on the [claude-plugins repository](https://github.com/duyet/codex-claude-plugins/issues). |
| 212 | +- Python 3.8+ (for the statusline renderer) |
| 213 | +- Git (for branch detection) |
126 | 214 |
|
127 | 215 | ## License |
128 | 216 |
|
|
0 commit comments