No description
  • Shell 53.6%
  • Nushell 46.4%
Find a file
gabethebabe 394a186606 Fix inflated +lines count from untracked binary files
Untracked file line counts (via xargs wc -l) were being added to
git diff insertions, causing huge numbers when binary/data files
existed. Now only show git diff stats for tracked files and display
untracked file count separately as ?N.
2026-02-06 08:13:50 -05:00
install.sh Initial commit: Claude Code statusline with token/cost tracking 2025-12-03 18:06:40 -05:00
README.md Add Windows/Nushell statusline script 2025-12-12 08:22:03 -05:00
statusline-command.nu Fix context window: restore transcript-parsing algorithm 2026-02-02 17:56:26 -05:00
statusline-command.sh Fix inflated +lines count from untracked binary files 2026-02-06 08:13:50 -05:00

Claude Code Statusline

A customizable status line for Claude Code that displays:

  • Directory with git branch and status
  • Token usage (input/output + cache write/read)
  • Session cost
  • Context usage % (color-coded)
  • API latency (cached)
  • Model indicator

Preview

Linux (Bash)

󰚡 ~  main 󰗡  󰾂 1K↑24K↓ 󰆓 175K↑5.6M↓  󰄬 75¢  🧠 35%

Windows (Nushell)

📁 ~ | 🤖 O | 💰 $5.42 | 🧠 162K 81% | 📊 6↑1K↓ ⚡2K↑160K↓ | 🏓 76ms

Requirements

Linux

  • jq - JSON processor
  • bc - Calculator
  • curl - For API latency
  • Nerd Font - For icons (optional)

Windows

  • Nushell - Modern shell
  • curl - For API latency (included in Windows 10+)

Installation

Linux

  1. Copy the script to your Claude config directory:
cp statusline-command.sh ~/.claude/statusline-command.sh
chmod +x ~/.claude/statusline-command.sh
  1. Add to your Claude Code settings (~/.claude/settings.json):
{
  "statusLine": {
    "type": "command",
    "command": "/bin/bash ~/.claude/statusline-command.sh"
  }
}

Windows (Nushell)

  1. Copy the script to your Claude config directory:
copy statusline-command.nu $env:USERPROFILE\.claude\statusline.nu
  1. Add to your Claude Code settings (~/.claude/settings.json):
{
  "statusLine": {
    "type": "command",
    "command": "nu --stdin -c \"let input = $in; source C:/Users/YOUR_USERNAME/.claude/statusline.nu; $input | statusline\""
  }
}

Replace YOUR_USERNAME with your Windows username.

  1. Restart Claude Code

Icons Reference

Linux (Nerd Font)

Icon Meaning
󰚡 Home directory
Git branch
󰗡 Git clean
󰷉 Git modified
󰾂 Token usage
󰆓 Cache usage
󰄬 Session cost
󰧑 Model
󰛳 API latency
🧠 Context %

Windows (Emoji)

Icon Meaning
📁 Directory
🤖 Model (O=Opus, S=Sonnet, H=Haiku)
💰 Session cost
🧠 Context (tokens + %)
📊 Input↑ Output↓ tokens
Cache create↑ read↓
🏓 API latency

Token Display

  • Input/Output: 6↑1K↓ = 6 input tokens, 1K output tokens
  • Cache: 2K↑160K↓ = 2K cache created, 160K cache read

Context Calculation

Context % is calculated as:

context = (input_tokens + cache_read_input_tokens + cache_creation_input_tokens) / 200000 * 100

Color thresholds:

  • 🟢 Green: < 50%
  • 🟡 Yellow: 50-80%
  • 🔴 Red: ≥ 80%

License

MIT