The only Claude Code statusline that tracks your agent ecosystem.
Running agents, session count, and token burn โ at a glance.
Pure stdin. Zero polling. Zero daemons.
claude-code-statusline
โก Real-time token, context & agent dashboard for Claude Code โ zero polling, pure stdin
Description
โก Real-time token, context & agent dashboard for Claude Code โ zero polling, pure stdin
README
Claude Code doesn't show you how many agents are running, which ones finished, or how large your agent ecosystem is. It also hides your token burn rate, rate limit proximity, and context window usage. You're flying blind.
This gives you everything in one persistent status line.
| Segment | Description |
|---|---|
| ๐ค Agent Ecosystem | Running now / spawned this session / total available. No other statusline tracks this. |
| โก Token Usage | 5-hour window percentage with 5-block visual bar + time remaining |
| ๐ง Context Window | Percentage used, color-coded green / yellow / red |
| ๐ Weekly Usage | 7-day limit percentage with visual bar |
All data is pulled in real-time from Claude Code's stdin JSON payload. No polling, no external API calls, no background daemons.
The status line shows three numbers for your agent ecosystem: running ยท spawned ยท total.
- Running โ agents actively executing right now (spawned minus completed, parsed from your session transcript)
- Spawned โ total Agent tool calls in the current session
- Total โ your full agent ecosystem: built-in Claude Code agents + plugin agents + custom agents from
~/.claude/agents/
This works with any Claude Code setup. If you use subagents (Agent tool), your running and spawned counts update in real-time. The total reflects everything available in your environment.
- Claude Code (CLI or desktop)
bashpython3- (Optional)
ccusagefor token data fallback when stdin rate limits are unavailable
git clone https://github.com/disconnect13/claude-code-statusline.git
cd claude-code-statusline && bash install.shmkdir -p ~/.claude/scripts
cp statusline.sh ~/.claude/scripts/statusline.sh
chmod +x ~/.claude/scripts/statusline.shThen add to ~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "/full/path/to/home/.claude/scripts/statusline.sh"
}
}Replace /full/path/to/home with your actual home directory (e.g., /Users/yourname on macOS or /home/yourname on Linux).
Restart Claude Code to see the status bar.
Claude Code invokes the script after each assistant message, passing a JSON payload on stdin with context_window, rate_limits, and transcript_path data. The script parses this with python3 and renders ANSI-colored output.
Token data comes from stdin's rate_limits.five_hour when available. If not present (older Claude Code versions or certain configurations), falls back to the ccusage CLI with a 30-second cache TTL and async background refresh so the status bar never blocks.
| Variable | Default | Description |
|---|---|---|
CLAUDE_TOKEN_LIMIT |
250000000 |
5-hour token limit for your plan. Default is calibrated for Claude Max 20x (250M tokens, manually verified). Override for other plans. |
CLAUDE_BUILTIN_AGENTS |
5 |
Number of built-in agent types in total count |
The status bar uses a muted, dark-theme-friendly palette:
| Color | ANSI 256 | Use |
|---|---|---|
| Dark Sea Green | 108 | Healthy / low usage |
| Soft Gold | 180 | Caution / medium usage |
| Dusty Rose | 174 | Alert / high usage |
| Soft Coral | 209 | Active state (running agents) |
Edit the color variables near the top of statusline.sh to customize.
- Green: 0-49% usage
- Yellow: 50-79% usage
- Red: 80%+ usage
rm ~/.claude/scripts/statusline.shRemove the statusLine key from ~/.claude/settings.json.
- macOS: Fully supported
- Linux: Fully supported (portable
stathandling) - Windows (WSL): Should work under WSL with bash and python3
Release History
| Version | Changes | Urgency | Date |
|---|---|---|---|
| v1.1.0 | ### Fixed - Agent count now deduplicates across plugin and custom agents - Non-agent `.md` files in `~/.claude/agents/` (protocol docs, config files) are excluded from count - Default built-in agent count changed from 5 to 4 (statusline-setup is a system utility, not a user agent) ### Added - Project-level agent counting: agents defined in `./agents/` subdirectories are now included in the total - Smarter counting logic handles overlapping agent definitions across plugins, custom, and project s | High | 4/14/2026 |
| v1.0.1 | ## Fixed - Portable Unicode rendering for macOS default bash 3.2 (contributed by @opepin) - Context window percentage now displays with color (green/yellow/red) as intended - Resolved ShellCheck CI warnings for unused variable false positives | High | 4/12/2026 |
| v1.0.0 | Latest release: v1.0.0 | High | 4/11/2026 |

