Claude Code Statusline
A fast, lightweight statusline for Claude Code showing git info, API usage, costs, and more.

Features
- Git status: branch, modified/staged/untracked indicators, ahead/behind
- Model: current Claude model in use
- Subscription: plan type and rate limit tier
- Costs: daily/weekly/monthly token costs from your usage logs
- API usage: current utilization % and time until reset
Installation
macOS / Linux
curl -fsSL https://raw.githubusercontent.com/erwint/claude-code-statusline/main/install.sh | bash
Or clone and install manually:
git clone https://github.com/erwint/claude-code-statusline.git
cd claude-code-statusline
./install.sh
Windows (PowerShell)
irm https://raw.githubusercontent.com/erwint/claude-code-statusline/main/install.ps1 | iex
Or download and run manually:
Invoke-WebRequest -Uri https://raw.githubusercontent.com/erwint/claude-code-statusline/main/install.ps1 -OutFile install.ps1
.\install.ps1
Build from source
Requires Go 1.21+:
go build -ldflags="-s -w" -o claude-code-statusline .
Force source build with the install script:
BUILD_FROM_SOURCE=1 ./install.sh
Configuration
The install script automatically configures Claude Code by adding to ~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "~/.claude/bin/claude-code-statusline"
}
}
Environment Variables
| Variable |
Default |
Description |
CLAUDE_STATUSLINE_CACHE_TTL |
300 |
Cache TTL in seconds for API usage |
CLAUDE_STATUS_DISPLAY_MODE |
colors |
colors, minimal, or background |
CLAUDE_STATUS_INFO_MODE |
none |
none, emoji, or text |
Command Line Flags
--cache-ttl <seconds> Cache TTL for API usage (default: 300)
--no-color Disable ANSI colors
--display-mode <mode> colors|minimal|background
--info-mode <mode> none|emoji|text
--debug Enable debug logging to /tmp/claude-statusline.log
--version Show version info
How It Works
- Git info: Runs
git commands to get branch and status
- Model: Receives current model via stdin from Claude Code
- Credentials: Reads from
~/.claude/credentials.json, falls back to system keychain
- API usage: Fetches from Anthropic's OAuth API (cached)
- Costs: Parses
~/.claude/projects/*/*.jsonl logs (incremental, cached)
Pre-built binaries are available for:
- macOS (Intel and Apple Silicon)
- Linux (x64 and ARM64)
- Windows (x64 and ARM64)
Acknowledgments
Inspired by gabriel-dehan/claude_monitor_statusline.
License
MIT