freshcrate
Skin:/
Home > MCP Servers > claude-code-statusline

claude-code-statusline

⚡ Real-time token, context & agent dashboard for Claude Code — zero polling, pure stdin

Why this rank:Release freshnessStrong adoptionHealthy release cadence

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.2.0## Added - **`CLAUDE_PLAN` environment variable** for friendly plan presets: `pro`, `max5`, `max20`, `max20_buffered`. Switch Claude plans with a one-line edit in `settings.json` without memorizing raw token counts. - **README "Plan tiers" section** documenting which plans are supported and clarifying that the 5hr and weekly bars are already plan-aware via stdin `rate_limits` (the Anthropic API). `CLAUDE_PLAN` and `CLAUDE_TOKEN_LIMIT` only govern the `ccusage` fallback path used by offline sessHigh4/22/2026
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
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-06-06
mcpickClaude Code extension manager — MCP servers, plugins (skills, hooks, agents), and marketplacesmain@2026-06-03
mcp-tidy🧹 Simplify your MCP servers with mcp-tidy, clearing server bloat to enhance performance and improve tool selection in Claude Code.main@2026-05-31
slack-mcp-serverSession-based Slack MCP for Claude and MCP clients: local-first workflows, secure-default HTTP.v4.3.0

More in MCP Servers

AstrBotAgentic IM Chatbot infrastructure that integrates lots of IM platforms, LLMs, plugins and AI feature, and can be your openclaw alternative. ✨
agentscopeBuild and run agents you can see, understand and trust.
claude-plugins-officialOfficial, Anthropic-managed directory of high quality Claude Code Plugins.
langchain4jLangChain4j is an open-source Java library that simplifies the integration of LLMs into Java applications through a unified API, providing access to popular LLMs and vector databases. It makes impleme