claude-code-statusline

skill
Security Audit
Warn
Health Warn
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 6 GitHub stars
Code Pass
  • Code scan — Scanned 1 files during light audit, no dangerous patterns found
Permissions Pass
  • Permissions — No dangerous permissions requested

No AI report is available for this listing yet.

SUMMARY

A single bash script status line for Claude Code: model, folder, git branch, context usage bar and Pro/Max subscription limits on one line. Needs jq.

README.md

Claude Code statusline

🇬🇧 English · 🇨🇿 Čeština · 🇪🇸 Español · 🇧🇷 Português · 🇩🇪 Deutsch · 🇫🇷 Français · 🇨🇳 简体中文 · 🇯🇵 日本語 · 🇸🇪 Svenska · 🇳🇴 Norsk · 🇩🇰 Dansk

A simple but information-dense status line for Claude Code: one bash script, no extra dependencies besides jq. It shows the model, the current folder, the git branch, context usage and subscription limit usage on a single line. For anyone who works in Claude Code every day and wants to see how much context and limit they have left before they hit the wall.

Author: Jindřich Fáborský

🆕 Latest version 1.2.0: cleaner layout with Context:/Limits: labels, no cost or duration segments. Release history: CHANGELOG.md. Want to hear about new versions? Set the repo to Watch → Custom → Releases.

[Opus 4.8 (1M context) ·xhigh] | 📁 youtubedb | 🌿 main± | Context: ████░░░░░░ 47% | Limits: 5h:38% · 7d:72%

What it looks like:

Statusline preview

What it shows

Part Meaning
[Opus 4.8 (1M context) ·xhigh] model + reasoning effort (·xhigh is hidden when the environment doesn't report it, e.g. with an API key)
📁 youtubedb current folder
🌿 main± git branch; ± marks uncommitted changes (dirty working tree)
Context: ████░░░░░░ 47% context window usage: a ten-segment bar that changes color as it fills
Limits: 5h:38% · 7d:72% subscription limit usage: the five-hour window and the weekly cap (rate_limits from the payload)

Colors for context and limit usage:

  • 🟢 green < 50%
  • 🟡 yellow ≥ 50%
  • 🟠 orange ≥ 70%
  • 🔴 red ≥ 90%

The limits segment only appears on a Pro/Max subscription, and only after the first response in a session. With a Console API key the rate_limits field isn't sent, so the whole segment is hidden and nothing breaks.

Requirements

  • bash: on Windows via Git Bash (see Installation → Windows)
  • jq: parses the JSON that Claude Code sends on stdin (brew install jq)
  • git: optional; without git or outside a repository it shows no-git

The script is defensive: if jq is missing or the input is invalid, it doesn't crash, it just shows empty/zero values. It only does integer math and reads git through plumbing/porcelain, so it doesn't depend on the system language (it works on non-English locales too).

Installation

  1. Download statusline.sh (for example to ~/.claude/statusline.sh) and make it executable:

    curl -o ~/.claude/statusline.sh https://raw.githubusercontent.com/faborsky/claude-code-statusline/main/statusline.sh
    chmod +x ~/.claude/statusline.sh
    
  2. Enable it in Claude Code via ~/.claude/settings.json (global) or .claude/settings.json (per project):

    {
      "statusLine": {
        "type": "command",
        "command": "~/.claude/statusline.sh"
      }
    }
    

    ~ (and $HOME) expand correctly on macOS, Linux and Windows.

  3. Open a new session and the status line appears at the bottom.

Windows

On Windows the statusLine command runs in Git Bash, with PowerShell as a fallback. The bash script works unchanged as long as you have Git for Windows with Git Bash installed, which you almost certainly do if you use git:

  • Use forward slashes in paths (~/.claude/statusline.sh or C:/Users/<you>/.claude/statusline.sh), not backslashes.
  • ANSI colors and emoji work (Git Bash / Windows Terminal).

Without Git Bash (PowerShell only) the script would need a PowerShell port. There isn't one yet.

Customization

It's one short script. Where to change what:

  • Color thresholds for context and limits: the 50 / 70 / 90 values in the pct_color function.
  • Layout / field order: the final printf at the end of the file.
  • Bar length: the ten-segment bar in the "10-segment progress bar" section.
  • Labels and emoji: the Context: / Limits: text and 📁 🌿 in the printf (standard emoji, no Nerd Font needed).

How context is calculated

The script primarily uses context_window.used_percentage from the Claude Code payload (accurate, includes cache). If the field is missing, it falls back to computing total_input_tokens / context_window_size. The whole JSON is parsed in a single jq pass.

Credit

Based on the statusline shown in Leonardo Grigorio's tutorial "My actual Claude Code workflow" (YouTube, channel Build & Ship with AI).

This version is substantially modified: one jq pass instead of five, the accurate used_percentage first with a fallback, custom color thresholds and a ten-segment bar, Context:/Limits: labels and error handling. Thanks to Leonardo for the original idea. 🙏

License

MIT © 2026 Jindřich Fáborský, covering the modifications in this repository.

Author

Jindřich Fáborský, marketer and educator from Prague. I teach marketers to build their own tools with AI.

Reviews (0)

No results found