Skip to content

levibe/claude-code-statusline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

claude-code-statusline

License: MIT POSIX shell macOS / Linux

A minimal Claude Code statusline showing branch, diff, model, context, throughput, and rate limit usage.

Screenshot

Design principles

  • Essential – relevant indicators shown without extra labels, dividers, or empty states
  • Quiet – supporting the main action, not competing with it
  • Terminal-first – plain text symbols, no emojis

What it shows

  • Branch – current git branch
  • Diff – uncommitted additions and deletions
  • Model – active Claude model
  • Context – usage bar and percentage. Grey under 35%, yellow-green under 50%, yellow under 75%, orange above. Start a new conversation before 50% for best results.
  • Throughput – tokens per minute. Grey under 1k, yellow at 1k, orange at 5k, red at 10k, violet at 20k.
  • Rate limits – 5-hour and weekly usage with countdown. Grey under 50%, yellow at 50%, orange at 75%, red at 90%. Shown on first use of each session, when on pace to hit the limit, and at 75%. If hidden, you're within a comfortable pace.

Indicators without data are hidden rather than shown empty.

Install

  1. Download the script:
curl -o ~/.claude/statusline.sh https://raw.githubusercontent.com/levibe/claude-code-statusline/main/statusline.sh && chmod +x ~/.claude/statusline.sh

Or clone and symlink: git clone https://github.com/levibe/claude-code-statusline && ln -s claude-code-statusline/statusline.sh ~/.claude/statusline.sh

  1. Add to your ~/.claude/settings.json:
{
  "statusLine": {
    "type": "command",
    "command": "~/.claude/statusline.sh"
  }
}
  1. Restart Claude Code.

Requirements

  • jq – JSON parsing
  • git – branch and diff information

brew install jq git or apt install jq git

Notes

  • Tracks text diffs, untracked files, and binary file changes (binary files count as +1 added or -1 removed)
  • Caps line counting at 10k to avoid slowdowns on large diffs
  • TPM uses a 5-minute sliding window and includes subagent token usage
  • Shows short SHA on detached HEAD; falls back to symbolic ref in empty repos
  • Uses --no-optional-locks on all git calls to prevent lock contention
  • Fixes model name bleeding across sessions (CC bug)
  • Validates model names to filter garbled input from Claude Code

Development

Run the test suite:

brew install bats-core  # https://bats-core.readthedocs.io/en/stable/installation.html
bats test/

Contributing

Issues and feature requests

License

MIT

About

A minimal Claude Code statusline with context usage, branch, model, and diff info.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages