pyCCsl (pronounced "pixel") - An information-rich status line for Claude Code
Real-time metrics • Cost tracking • Git status • Token usage • 9 themes • Zero dependencies
📖 User Guide | 🔗 GitHub | 📝 Issues
|
|
All performance metrics in a single view:
Shows cache hit rate, response time, session duration, token generation speed, and message count.
Detailed token analysis with tuple format:
Input tokens displayed as (base, cache_write, cache_read) for complete visibility into token usage.
Five different separator options:
Available styles: powerline (requires compatible fonts), simple, arrows, pipes, dots.
Four-level performance indicator:
- ●○○○ = High cache usage, fast responses
- ○●○○ = Moderate cache, acceptable response times
- ○○●○ = Low cache usage, slower responses
- ○○○● = Minimal cache usage, slow responses
- Python 3.8 or higher
- Claude Code
- Download the script:
curl -O https://raw.githubusercontent.com/wolfdenpublishing/pyccsl/main/pyccsl.py
chmod +x pyccsl.py- Copy to Claude directory:
cp pyccsl.py ~/.claude/- Configure Claude Code by editing
~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "python3 ~/.claude/pyccsl.py"
}
}That's it! Restart Claude Code and you should have the default status line.
Use the --env option and you can change your status line at any time while Claude Code is running. (These instructions assume you have completed the Quick Setup steps above.)
- Download the example .env file:
curl -O https://raw.githubusercontent.com/wolfdenpublishing/pyccsl/main/pyccsl.env.example- Copy to Claude directory:
cp pyccsl.env.example ~/.claude/pyccls.env- Modify the hook command in
~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "python3 ~/.claude/pyccsl.py --env ~/.claude/pyccsl.env"
}
}Edit the ~/.claude/pyccsl.env file at any time to dynamically modify the status line of your active Claude Code sessions!
The --style powerline option creates beautiful arrow separators, but requires Powerline-compatible fonts to display correctly.
Installing Powerline Fonts
# Using Homebrew
brew tap homebrew/cask-fonts
brew install --cask font-meslo-lg-nerd-font
# Or download directly
git clone https://github.com/powerline/fonts.git --depth=1
cd fonts
./install.sh
cd ..
rm -rf fonts# Ubuntu/Debian
sudo apt-get install fonts-powerline
# Or manually install
git clone https://github.com/powerline/fonts.git --depth=1
cd fonts
./install.sh
cd ..
rm -rf fonts# Using Scoop
scoop bucket add nerd-fonts
scoop install Meslo-NF
# Or manually:
# 1. Download fonts from https://github.com/powerline/fonts
# 2. Right-click on .ttf files and select "Install"After installing, configure your terminal to use a Powerline font:
- VS Code Terminal: Settings → Terminal → Font Family → "MesloLGS NF" or "DejaVu Sans Mono for Powerline"
- iTerm2 (macOS): Preferences → Profiles → Text → Font → Select a Powerline font
- Windows Terminal: Settings → Profiles → Font face → Select a Powerline font
- Linux Terminal: Edit → Preferences → Custom font → Select a Powerline font
Note: If Powerline fonts aren't installed or configured, the arrows will appear as boxes (□) or question marks. Use --style simple (default) or other styles if you prefer not to install special fonts.
Performance Monitoring
{
"statusLine": {
"type": "command",
"command": "python3 ~/.claude/pyccsl.py badge,model,perf-all-metrics,cost --theme nord"
}
}Displays all performance metrics for session analysis and cache optimization.
Cost Tracking
{
"statusLine": {
"type": "command",
"command": "python3 ~/.claude/pyccsl.py model,input,output,cost --numbers full"
}
}Shows detailed token counts and costs with full number formatting.
Minimal Display
{
"statusLine": {
"type": "command",
"command": "python3 ~/.claude/pyccsl.py model,cost --theme minimal --no-emoji"
}
}Shows only model and cost without colors or emoji.
Dynamic Configuration (Live Updates)
Want to change your status line without restarting Claude Code? Use an environment file!
- Create a configuration file
~/.pyCCsl.env:
# Copy the example file
cp pyCCsl.env.example ~/.pyCCsl.env- Configure Claude Code:
{
"statusLine": {
"type": "command",
"command": "python3 ~/.claude/pyccsl.py --env ~/.pyCCsl.env"
}
}- Edit
~/.pyCCsl.envanytime to change settings instantly:
# Example ~/.pyCCsl.env
PYCCSL_THEME="nord"
PYCCSL_NUMBERS="full"
PYCCSL_STYLE="powerline"
PYCCSL_FIELDS="badge,model,perf-cache-rate,tokens,cost"Changes take effect immediately on the next status line refresh - no restart required!
The env file is bash-compatible, so you can also source it: source ~/.pyCCsl.env
- Single file implementation (~1000 lines)
- No external dependencies - uses only Python standard library
- Embedded Anthropic pricing data
- Handles missing transcript files and non-git directories gracefully
- Reads JSON from stdin (Claude Code hook)
- Parses transcript file for metrics (if available)
- Extracts git repository information
- Calculates performance metrics and costs
- Formats and outputs customized status line
Performance badge calculation:
- Cache Hit Rate =
cache_read_tokens / total_input_tokens - Response Time = Average time between user message and assistant response
Thresholds configurable via --perf-cache and --perf-response options.
Uses embedded Anthropic pricing data:
Cost = (input_tokens × input_rate +
cache_creation × cache_write_5m_rate +
cache_read × cache_read_rate +
output_tokens × output_rate) / 1,000,000
All cache writes assumed to use 5-minute TTL (Claude Code default).
0- Success1- Invalid arguments2- Invalid JSON input3- Transcript file error4- Calculation error
When Claude Code displays system messages (e.g., "Context left until auto-compact: 12%"), it may truncate the status line mid-sequence, leaving ANSI color codes unclosed. This causes terminal colors to "bleed" into subsequent output.
Workaround Options:
- Use
--theme noneto disable colors entirely - Use
--theme minimalfor reduced color usage - Clear the terminal with
clearorresetwhen this occurs
Note: This is a Claude Code limitation where system messages take priority and truncate custom status lines without properly closing escape sequences. There is no fix available from the pyCCsl side.
MIT License - See LICENSE file for details
- Developed for Claude Code by Anthropic
- Pricing data from Anthropic's documentation
- Color themes inspired by popular terminal themes










