freshcrate
Home > MCP Servers > claude-code-statusline

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 Status Line in action

Claude Code Status Line

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.

macOSLinuxLicenseStars

Why This Exists

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.

What You Get

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.

How Agent Tracking Works

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.

Requirements

  • Claude Code (CLI or desktop)
  • bash
  • python3
  • (Optional) ccusage for token data fallback when stdin rate limits are unavailable

Install

Quick Start

git clone https://github.com/disconnect13/claude-code-statusline.git
cd claude-code-statusline && bash install.sh

Manual

mkdir -p ~/.claude/scripts
cp statusline.sh ~/.claude/scripts/statusline.sh
chmod +x ~/.claude/scripts/statusline.sh

Then 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.

How It Works

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.

Customization

Environment Variables

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

Color Palette

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.

Thresholds

  • Green: 0-49% usage
  • Yellow: 50-79% usage
  • Red: 80%+ usage

Uninstall

rm ~/.claude/scripts/statusline.sh

Remove the statusLine key from ~/.claude/settings.json.

Platform Support

  • macOS: Fully supported
  • Linux: Fully supported (portable stat handling)
  • Windows (WSL): Should work under WSL with bash and python3

License

MIT

Release History

VersionChangesUrgencyDate
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 sHigh4/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 positivesHigh4/12/2026
v1.0.0Latest release: v1.0.0High4/11/2026

Dependencies & License Audit

Loading dependencies...

Similar Packages

everything-claude-codeThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.v1.10.0
mcp-tidy๐Ÿงน Simplify your MCP servers with mcp-tidy, clearing server bloat to enhance performance and improve tool selection in Claude Code.main@2026-04-21
claude-code-proxyMonitor and visualize your Claude Code API interactions with Claude Code Proxy. Easily set up a transparent proxy and live dashboard. ๐Ÿ› ๏ธ๐Ÿš€main@2026-04-21
mcpickClaude Code extension manager โ€” MCP servers, plugins (skills, hooks, agents), and marketplacesmain@2026-04-18
BashiTurn Claude Code into a structured development team. 600+ skills via Cortex MCP, 12 agents, 20 commands. Built for people who can direct but don't write code. npx create-bashi-appv3.3.0