# Claude Code Status Line โ€” full project context for AI This file is intended to be ingested by AI assistants (Perplexity, ChatGPT, Claude.ai, etc.) for question-answering about the project. It contains the full README, BLOCKS guide, examples index, and license, concatenated in priority order. Author: Yevgeniy Achin License: Source-Available (Reuse-by-Permission) --- # ๐Ÿ›ฐ๏ธ Claude Code Status Line โ€” 40 themes, configurable blocks, CLI > Drop-in replacement for the **Claude Code** default status line: live **context window** usage with a smooth progress bar, **session cost** in USD, **5h / 7d rate-limit** warnings, **git branch** with dirty / ahead / behind counts, **time-on-task tracking**, and the active **model name** (with `(1M)` indicator for 1M-context variants) โ€” all in one colorful Bash line. Ships with **40 ready-made themes** (anime, cyberpunk, hacker, retro, weather, fire, ocean, coffee, music, game, pirate, christmas, space, cat, love, rainbow, zen, plus practical: minimal, developer, time-tracker) and an **18-block library** to compose your own. Includes an all-in-one CLI configurator and a `/statusline` slash command for Claude Code. [![License: Source-Available](https://img.shields.io/badge/license-Source--Available-orange.svg)](LICENSE) [![Made for Claude Code](https://img.shields.io/badge/made%20for-Claude%20Code-7c3aed.svg)](https://claude.com/claude-code) [![Variants: 40](https://img.shields.io/badge/variants-40-brightgreen.svg)](#-40-ready-made-variants--pick-one-and-go) [![Bash + jq](https://img.shields.io/badge/runs%20on-bash%20%2B%20jq-yellow.svg)](#requirements) [![Author](https://img.shields.io/badge/author-Yevgeniy%20Achin-blue.svg)](mailto:amazopic@gmail.com) **Languages:** English ยท [ะ ัƒััะบะธะน](README.ru.md) ยท [Franรงais](README.fr.md) ยท [Deutsch](README.de.md) ยท [ะฃะบั€ะฐั—ะฝััŒะบะฐ](README.uk.md) ยท [Slovenลกฤina](README.sl.md) ยท [Italiano](README.it.md) ยท [Espaรฑol](README.es.md) ยท [ไธญๆ–‡](README.zh.md) ยท [ๆ—ฅๆœฌ่ชž](README.ja.md) ยท [ํ•œ๊ตญ์–ด](README.ko.md) ```text Opus 4.7 (1M) โ”‚ ๐Ÿš€ 12% โ–ˆโ–Œโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 121.4K/1000K โ”‚ 0.42$ โ”‚ โ†‘0.5K โ†“1.2K โ”‚ project โ”‚ โއ main โ”‚ tokens: 87 K โ”‚ ๐Ÿค– xhigh ``` ## โšก Quick start The fastest path โ€” bundled all-in-one script with built-in CLI: ```bash git clone https://github.com/amazopic/REPO.git claude-code-statusline cp claude-code-statusline/statusline-bundle.sh ~/.claude/status-line.sh chmod +x ~/.claude/status-line.sh ~/.claude/status-line.sh use cyberpunk # or: anime, hacker, minimal, โ€ฆ ``` Then add to `~/.claude/settings.json`: ```json { "statusLine": { "type": "command", "command": "/Users//.claude/status-line.sh" } } ``` Restart Claude Code (or run `/config` reload). Done. ## Why a custom status line / status bar for Claude Code? Claude Code's default status line is sparse. This drop-in replacement turns the bottom status bar into an **at-a-glance dashboard** for every session: - ๐Ÿ”‹ How much context have I burned? (smooth 1.25% fractional bars) - ๐Ÿ’ฐ What is this session costing me? - ๐Ÿšฆ How close am I to my rate limits? - ๐Ÿง  What thinking level / model am I on? - ๐ŸŒฟ Which git branch am I on? All in **one line**, color-coded, with smart icons that signal urgency. ## โœจ Features - ๐Ÿช **Live context bar** โ€” 10-cell progress bar with sub-cell precision (quadrant or vertical fractional glyphs) - ๐Ÿง  **Model name** โ€” with `(1M)` indicator for 1M-context variants - ๐Ÿ’ธ **Session cost** in USD, updated every render - โฌ†๏ธโฌ‡๏ธ **Per-message token counters** (input / output) - ๐Ÿšฆ **Rate limits** โ€” 5h / 7d with โš ๏ธ warning when > 50% - ๐Ÿ”„ **API-mode fallback** โ€” when no rate limits are piped, shows total session tokens (`tokens: NNN K`) with thin-space thousand separators - ๐Ÿš€ **Smart status icon** โ€” ๐Ÿš€ < 40%, ๐Ÿš— 40โ€“49%, โš ๏ธ โ‰ฅ 50% context fill - ๐ŸŽจ **256-color ANSI** โ€” bright, distinct color per segment - ๐Ÿงฉ **Pluggable bar styles** โ€” pick `quadrant` (โ––โ–„โ–™โ–ˆ) or `vertical` (โ–โ–Žโ–โ–Œโ–‹โ–Šโ–‰โ–ˆ), or roll your own in 10 lines of bash - โšก **Lightweight** โ€” pure `bash` + `jq`. No Node, no Python, no daemon, no telemetry ## ๐ŸŽจ 40 ready-made variants โ€” pick one and go Each theme ships in **two variants**: - **Detailed** โ€” full feature set (model, context bar, cost, tokens, git, time, mood icon, โ€ฆ) - **Compact** โ€” `model ยท context % + bar ยท branch` only | Theme | Detailed | Compact | |---|---|---| | ๐Ÿ›  minimal | [`statusline-minimal.sh`](examples/statusline-minimal.sh) | [`-compact`](examples/statusline-minimal-compact.sh) | | ๐Ÿ›  developer | [`statusline-developer.sh`](examples/statusline-developer.sh) | [`-compact`](examples/statusline-developer-compact.sh) | | ๐Ÿ›  time *(human-hours)* | [`statusline-time.sh`](examples/statusline-time.sh) | [`-compact`](examples/statusline-time-compact.sh) | | ๐Ÿ›  zen | [`statusline-zen.sh`](examples/statusline-zen.sh) | [`-compact`](examples/statusline-zen-compact.sh) | | ๐ŸŒˆ rainbow | [`statusline-rainbow.sh`](examples/statusline-rainbow.sh) | [`-compact`](examples/statusline-rainbow-compact.sh) | | โœจ anime | [`statusline-anime.sh`](examples/statusline-anime.sh) | [`-compact`](examples/statusline-anime-compact.sh) | | ๐Ÿ’– love | [`statusline-love.sh`](examples/statusline-love.sh) | [`-compact`](examples/statusline-love-compact.sh) | | ๐Ÿฑ cat | [`statusline-cat.sh`](examples/statusline-cat.sh) | [`-compact`](examples/statusline-cat-compact.sh) | | ๐ŸŽ„ christmas | [`statusline-christmas.sh`](examples/statusline-christmas.sh) | [`-compact`](examples/statusline-christmas-compact.sh) | | ๐Ÿ’ป hacker | [`statusline-hacker.sh`](examples/statusline-hacker.sh) | [`-compact`](examples/statusline-hacker-compact.sh) | | ๐Ÿ’ป cyberpunk | [`statusline-cyberpunk.sh`](examples/statusline-cyberpunk.sh) | [`-compact`](examples/statusline-cyberpunk-compact.sh) | | ๐Ÿš€ space | [`statusline-space.sh`](examples/statusline-space.sh) | [`-compact`](examples/statusline-space-compact.sh) | | ๐Ÿ•น retro | [`statusline-retro.sh`](examples/statusline-retro.sh) | [`-compact`](examples/statusline-retro-compact.sh) | | ๐Ÿ”ฅ fire | [`statusline-fire.sh`](examples/statusline-fire.sh) | [`-compact`](examples/statusline-fire-compact.sh) | | ๐ŸŒŠ ocean | [`statusline-ocean.sh`](examples/statusline-ocean.sh) | [`-compact`](examples/statusline-ocean-compact.sh) | | โ˜€ weather | [`statusline-weather.sh`](examples/statusline-weather.sh) | [`-compact`](examples/statusline-weather-compact.sh) | | โ˜• coffee | [`statusline-coffee.sh`](examples/statusline-coffee.sh) | [`-compact`](examples/statusline-coffee-compact.sh) | | ๐ŸŽต music | [`statusline-music.sh`](examples/statusline-music.sh) | [`-compact`](examples/statusline-music-compact.sh) | | โš” game | [`statusline-game.sh`](examples/statusline-game.sh) | [`-compact`](examples/statusline-game-compact.sh) | | ๐Ÿดโ€โ˜ ๏ธ pirate | [`statusline-pirate.sh`](examples/statusline-pirate.sh) | [`-compact`](examples/statusline-pirate-compact.sh) | ```bash cp examples/statusline-cyberpunk-compact.sh ~/.claude/status-line.sh chmod +x ~/.claude/status-line.sh ``` **Browse them all in your terminal first** โ€” every variant has a pre-rendered preview in [`screenshots/`](screenshots/): ```bash # preview a single one cat screenshots/statusline-cyberpunk.ansi # or browse the whole gallery (40 variants + main) for f in screenshots/*.ansi; do printf "\n=== %s ===\n" "$(basename "$f" .ansi)" cat "$f" done ``` See [`examples/README.md`](examples/README.md) for the full table with descriptions, and [`screenshots/README.md`](screenshots/README.md) for how the previews are generated. ## ๐Ÿงฑ Build your own from blocks Don't want to use a preset? Compose a custom status line from a library of named blocks โ€” `model`, `context-bar`, `cost`, `git`, `tokens-msg`, `time-active`, `thinking`, โ€ฆ See [**BLOCKS.md**](BLOCKS.md) for: - the **catalog of blocks** (each one is a copy-pasteable bash snippet) - the **style packs** (color palettes & separators from `classic`, `compact`, `anime`, `hacker`, `cyberpunk`, `zen`) - a **3-step recipe** to build your own line: pick a style โ†’ list blocks โ†’ paste ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Step 1 โ€” pick a STYLE pack (colors, separator) โ”‚ โ”‚ Step 2 โ€” pick the BLOCKS you want (in order) โ”‚ โ”‚ Step 3 โ€” paste shared HEADER + chosen BLOCKS + FOOTER โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` ## ๐Ÿ“ฆ All-in-one bundle (`statusline-bundle.sh`) If you don't want to manage 40+ files, grab the **single bundled script** [`statusline-bundle.sh`](statusline-bundle.sh) โ€” it contains every theme + every block + a CLI configurator in one file. ```bash cp statusline-bundle.sh ~/.claude/status-line.sh chmod +x ~/.claude/status-line.sh ~/.claude/status-line.sh use cyberpunk # switch theme ~/.claude/status-line.sh use cyberpunk-compact # use compact variant ~/.claude/status-line.sh custom model context-bar git cost # compose from blocks ~/.claude/status-line.sh list # list themes ~/.claude/status-line.sh list blocks # list blocks ~/.claude/status-line.sh preview anime # preview without saving ~/.claude/status-line.sh show # show current config ~/.claude/status-line.sh reset # reset to default ``` Configuration is saved to `~/.claude/statusline.conf` and persists across restarts. The same file acts as both **the renderer** (when called by Claude Code with JSON on stdin) and **the configurator** (when you call it with arguments). ### `/statusline` slash command Drop [`commands/statusline.md`](commands/statusline.md) into `~/.claude/commands/` to enable a `/statusline` slash command inside Claude Code: ```bash mkdir -p ~/.claude/commands cp commands/statusline.md ~/.claude/commands/statusline.md ``` Then in any Claude Code session you can type: ``` /statusline cyberpunk /statusline cyberpunk-compact /statusline custom model context-bar git cost /statusline list /statusline preview anime ``` Claude will run the bundle CLI for you, report the result, and remind you to reload. ### Optional shell alias ```bash alias statusline='~/.claude/status-line.sh' ``` Then `statusline cyberpunk` works from any terminal. ## ๐Ÿš€ Install ### Manual install (3 steps) ```bash git clone https://github.com/amazopic/REPO.git cp REPO/statusline.sh ~/.claude/status-line.sh chmod +x ~/.claude/status-line.sh ``` Then add to `~/.claude/settings.json`: ```json { "statusLine": { "type": "command", "command": "/Users//.claude/status-line.sh" } } ``` Restart Claude Code (or run `/config` reload). ### Install via Claude Code agent (with automatic backup) Want Claude Code to install it safely for you? Paste this prompt: > "Install the status line from this repo as my Claude Code status line: > 1. If `~/.claude/status-line.sh` already exists, back it up to > `~/.claude/status-line.sh.bak.` (pick a free `-N` > suffix if a backup with that name already exists). > 2. Copy `statusline.sh` from this repo to `~/.claude/status-line.sh` and `chmod +x`. > 3. Read `~/.claude/settings.json`. If it has no `statusLine` key, add a > `statusLine` block pointing to the absolute path of the script. If > `statusLine` already exists and points elsewhere, back up > `settings.json` to `.bak.` first. > 4. Smoke-test the script: > `echo '{\"model\":{\"display_name\":\"Test\"},\"transcript_path\":\"\"}' | bash ~/.claude/status-line.sh` > 5. Tell me to restart Claude Code and report the backups created." ### Requirements - `bash` 4+ (script uses 0-indexed arrays โ€” **do not run under `zsh`**) - `jq` for JSON parsing - A 256-color terminal (basically every modern one) ## โš™๏ธ Configuration Edit constants near the top of `statusline.sh`: | Variable / function | What it controls | |---|---| | `BAR_STYLE` | `"quadrant"` (default, 2.5% step) or `"vertical"` (1.25% step) | | `pct_icon()` | Thresholds for ๐Ÿš€ / ๐Ÿš— / โš ๏ธ icons before the bar | | `pct_color()` | Color thresholds for percentage / bar | | ANSI color constants | Recolor any segment (`G`, `Y`, `R`, `B`, `C`, `M`, โ€ฆ) | ## ๐Ÿ†š vs the default Claude Code status line | Capability | Default | This project | |---|---|---| | Active **model name** | โœ… | โœ… (with `(1M)` flag for 1M-context variants) | | **Context window** % used | โŒ | โœ… live, 1.25 % precision | | **Progress bar** for context | โŒ | โœ… (vertical, quadrant, rainbow, sparkline, โ€ฆ) | | **Session cost** in USD | โŒ | โœ… updated every render | | **Per-message** input/output token counters | โŒ | โœ… | | **Total session tokens** (API mode fallback) | โŒ | โœ… | | **5h / 7d rate-limit** indicators with โš ๏ธ at > 50 % | โŒ | โœ… | | **Git branch** + dirty + ahead/behind | โŒ | โœ… | | **Time-on-task** (active vs wall clock) | โŒ | โœ… | | **Thinking / effort level** display | โŒ | โœ… | | Themed presets | โŒ | โœ… 20 themes ร— 2 variants = **40 ready-made** | | Compose from named blocks | โŒ | โœ… 18 blocks, see [BLOCKS.md](BLOCKS.md) | | Built-in CLI configurator | โŒ | โœ… `statusline-bundle.sh use / custom / list / preview` | | Claude Code `/statusline` slash command | โŒ | โœ… optional, see [`commands/`](commands/) | | External dependencies | โ€” | `bash` 4+ and `jq` (no Node, no Python, no daemon) | | License | โ€” | Source-Available (reuse-by-permission) | ## ๐Ÿ’ก Use cases Concrete scenarios where this project pays for itself: - **"How much of my 1 M context have I burned?"** โ€” see a live percent + bar before every prompt. - **"What is this Claude Code session costing me?"** โ€” running USD total, updated every render. - **"Will I hit a rate limit today?"** โ€” 5 h / 7 d indicators with โš ๏ธ when > 50 %. - **"Am I on the right branch?"** โ€” git branch + dirty + ahead/behind in your status line. - **"How many actual hours did I spend on this feature?"** โ€” time-on-task tracker (`active` vs `wall`). - **"I want my terminal to be fun."** โ€” anime, cyberpunk, hacker, retro, weather, ocean, fire and other themes. - **"I want a minimal, ASCII-only status line for screen recordings."** โ€” `zen` theme. - **"I want to ship a status line my whole team uses."** โ€” single bundled script + CLI configurator + slash command. ## โ“ FAQ ### What is "Claude Code Status Line"? A bash-based replacement for the default status line in [Claude Code](https://claude.com/claude-code) (Anthropic's CLI). It turns the bottom-of-screen line into a real dashboard: model, context %, progress bar, session cost, rate limits, git status, time-on-task, and more. ### How is it installed? Copy `statusline-bundle.sh` to `~/.claude/status-line.sh`, `chmod +x`, then point Claude Code's `~/.claude/settings.json` `statusLine.command` at that path. Full instructions in the [Quick start](#-quick-start) and [Install](#-install) sections. ### Does it support the 1 M context window models? Yes. The script detects `[1m]` in the model id and `1M` in the display name and adjusts the bar's denominator to 1 000 000 tokens. You'll see `Opus 4.7 (1M) โ€ฆ 12 % โ–ˆโ–Œโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 121.4K/1000K`. ### What models does it work with? Any model Claude Code supports โ€” Opus 4.7, Sonnet 4.6, Haiku 4.5, Opus 4.6, etc. The script reads `model.display_name` and `model.id` from the stdin JSON Claude Code provides; it doesn't hardcode model names. ### Can I customize colors, themes, or add my own? Yes โ€” three ways: 1. Pick one of the **40 ready-made variants** in [`examples/`](examples/). 2. Compose your own from **named blocks** โ€” see [BLOCKS.md](BLOCKS.md). 3. Edit color constants and bar style in `statusline.sh` directly. ### Will it slow down Claude Code? No. Each render runs once per status redraw, parses the piped JSON with `jq`, optionally `grep`s the latest line of the transcript, and prints. Typical render is โ‰ค 50 ms even with the time-tracker enabled. ### Does it work without `jq`? `jq` is required โ€” it parses the JSON Claude Code sends on stdin. Install it via `brew install jq` (macOS), `apt install jq` (Debian/Ubuntu), or `choco install jq` (Windows). ### Does it work on Windows? Yes, in any environment that runs `bash` 4+ and `jq` โ€” Git Bash, WSL, MSYS2, Cygwin. Pure CMD/PowerShell aren't supported. ### Does it work on Linux / macOS? Yes on both. macOS uses BSD `date`, Linux uses GNU `date` โ€” the time-tracker handles both transparently. ### Can I use this with the raw Anthropic API instead of Claude Code? Partially. The status line is designed for Claude Code's stdin JSON format. For raw API usage, the rate-limit indicators auto-fall back to a **total session tokens** display (`tokens: NNN K`). ### Where is the configuration stored? `~/.claude/statusline.conf` โ€” a tiny shell-sourced file written by the bundle's CLI (`statusline.sh use ` etc.). Persists across restarts. ### How do I revert to the default Claude Code status line? Either remove the `statusLine` block from `~/.claude/settings.json`, or run `~/.claude/status-line.sh reset` and switch to a `minimal` theme that closely matches the default. ### Is it free? Can I use it commercially? Personal, local use is free โ€” see the [Source-Available License](LICENSE). Any reuse, redistribution, fork, or inclusion in another project requires **prior written permission** from the author (Yevgeniy Achin ยท amazopic@gmail.com). Reasonable requests are typically granted. ### How does the "human-hours" tracker work? The `time` theme reads timestamps from the JSONL transcript and reports two durations: **active** (sum of inter-message gaps shorter than 5 minutes) and **wall** (total span from first to last message). The 5-minute idle threshold is configurable. ## ๐Ÿท๏ธ Suggested GitHub topics When you publish this repo, add these topics to maximize discoverability: `claude-code` ยท `claude-code-statusline` ยท `statusline` ยท `status-bar` ยท `terminal-prompt` ยท `anthropic-claude` ยท `ai-coding` ยท `developer-tools` ยท `bash-script` ยท `terminal-customization` ยท `prompt-customization` ยท `claude-4` ยท `opus-4` ยท `sonnet-4` ยท `dotfiles` ยท `terminal-dashboard` ยท `context-window-monitor` ยท `token-counter` ยท `rate-limit-monitor` ## ๐Ÿค Contributing Issues and PRs are welcome โ€” but note the license: - **Reading, opening issues, submitting PRs**: free. - **Forking, copying into another project, redistributing**: requires prior written permission from the author. To request reuse permission, contact: **Yevgeniy Achin** ยท โœ‰ [amazopic@gmail.com](mailto:amazopic@gmail.com) Reasonable requests for personal, educational, and non-commercial use are typically granted free of charge. ## ๐Ÿ“œ License [**Source-Available License (Reuse-by-Permission)**](LICENSE) This project's source is publicly available for reading, study, and personal use on your own machine. Any reuse โ€” copying, redistributing, modifying, or including in another project โ€” requires **prior written permission** from the author (Yevgeniy Achin ยท amazopic@gmail.com). This is **not** an OSI-approved open-source license. It is a deliberate choice to keep distribution and derivative works under the author's control while allowing the community to read, study, and contribute. ## โญ Found it useful? If you spend hours staring at Claude Code, you might as well stare at a beautiful status line. **Give the repo a โญ** to help others discover it! --- Made by **Yevgeniy Achin** ยท โœ‰ [amazopic@gmail.com](mailto:amazopic@gmail.com) ยท for the Claude Code community. --- # Block library and composition guide # Compose your own status line โ€” block library This is a catalog of **blocks** (segments) you can mix and match to build your own custom Claude Code status line. Pick a style pack, list the blocks you want, paste them into a script โ€” done. > Author: **Yevgeniy Achin** ยท โœ‰ amazopic@gmail.com > License: **Source-Available** ([LICENSE](LICENSE)) โ€” reuse only with > the author's prior permission. > ๐Ÿ’ก **Don't want to assemble blocks by hand?** Use the all-in-one > [`statusline-bundle.sh`](statusline-bundle.sh) and run > `~/.claude/status-line.sh custom model context-bar git cost` โ€” same > blocks, no copy-paste. See the bundle section in the [main > README](README.md#-all-in-one-bundle-statusline-bundlesh). --- ## How to compose ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Step 1 โ€” pick a STYLE pack (colors, separator, vibe)โ”‚ โ”‚ Step 2 โ€” pick the BLOCKS you want (in order) โ”‚ โ”‚ Step 3 โ€” paste shared HEADER + chosen BLOCKS + FOOTER โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` Every statusline script in this repo follows the same pattern: ```bash #!/usr/bin/env bash [ STYLE โ€” colors and SEP ] [ HEADER โ€” input parsing helpers, shared variables ] [ BLOCK 1 ] โ†’ appends to $line [ BLOCK 2 ] โ†’ appends to $line [ BLOCK N ] โ†’ appends to $line [ FOOTER โ€” printf '%s\n' "$line" ] ``` You can grab the header + footer from any example script (they are identical) and only swap the middle. --- ## Step 1 โ€” style packs Each style pack defines: separator (`SEP`), color palette, and optional accent glyphs. Drop the pack near the top of your script. ### `classic` โ€” gold / green / cyan, vertical bar separator ```bash G=$'\e[1;38;5;220m'; GD=$'\e[38;5;178m' GR=$'\e[1;38;5;46m'; GRD=$'\e[38;5;34m' Y=$'\e[1;38;5;226m'; YD=$'\e[38;5;184m' R=$'\e[1;38;5;196m'; RU=$'\e[38;5;160m' B=$'\e[1;38;5;39m'; C=$'\e[1;38;5;51m'; CD=$'\e[38;5;38m' M=$'\e[1;38;5;201m'; W=$'\e[1;38;5;255m' D=$'\e[38;5;244m'; RD=$'\e[38;5;131m'; N=$'\e[0m' SEP=" ${D}โ”‚${N} " ``` ### `compact` โ€” same palette, dot separator ```bash # (same colors as classic) SEP=" ${D}ยท${N} " ``` ### `anime` โ€” pink / magenta / violet, ๐ŸŒธ separator ```bash P=$'\e[1;38;5;213m'; PD=$'\e[38;5;218m' M=$'\e[1;38;5;201m'; V=$'\e[1;38;5;177m' W=$'\e[1;38;5;231m'; D=$'\e[38;5;244m' N=$'\e[0m' SEP=" ๐ŸŒธ " ``` ### `hacker` โ€” phosphor green Matrix terminal ```bash GR=$'\e[1;38;5;46m'; GRD=$'\e[38;5;28m'; GRDD=$'\e[38;5;22m' W=$'\e[1;38;5;255m'; N=$'\e[0m' SEP=" ${GRD}::${N} " ``` ### `cyberpunk` โ€” neon pink / cyan / yellow ```bash P=$'\e[1;38;5;201m'; PD=$'\e[38;5;163m' C=$'\e[1;38;5;51m'; CD=$'\e[38;5;38m' Y=$'\e[1;38;5;227m'; W=$'\e[1;38;5;231m' D=$'\e[38;5;238m'; N=$'\e[0m' SEP=" ${PD}//${N} " ``` ### `zen` โ€” no colors, plain ASCII ```bash SEP=" " N="" ``` --- ## Step 2 โ€” shared HEADER Paste this once, near the top of your script (after the style pack). Every block below relies on the variables it sets. ```bash set -uo pipefail input=$(cat) j() { jq -r "$1 // empty" 2>/dev/null <<<"$input"; } model_disp=$(j '.model.display_name') model_id=$(j '.model.id') model_name="${model_disp:-${model_id:-Claude}}" model_name="${model_name// context/}" cwd=$(j '.workspace.current_dir') [[ -z "$cwd" ]] && cwd=$(j '.cwd') [[ -z "$cwd" ]] && cwd="$PWD" cost=$(j '.cost.total_cost_usd'); cost=${cost:-0} cost_fmt=$(awk -v c="$cost" 'BEGIN { printf "%.2f", c+0 }') transcript=$(j '.transcript_path') exceeds_200k=$(j '.exceeds_200k_tokens') if [[ "$model_id" == *"[1m]"* ]] || [[ "$model_disp" == *"1M"* ]] \ || [[ "$exceeds_200k" == "true" ]]; then ctx_max=1000000 else ctx_max=200000 fi in_tok=0; out_tok=0; cr=0; cc=0 if [[ -n "$transcript" && -f "$transcript" ]]; then last=$(grep '"usage"' "$transcript" 2>/dev/null | tail -1) if [[ -n "$last" ]]; then in_tok=$(jq -r '.message.usage.input_tokens // 0' <<<"$last" 2>/dev/null || echo 0) out_tok=$(jq -r '.message.usage.output_tokens // 0' <<<"$last" 2>/dev/null || echo 0) cr=$(jq -r '.message.usage.cache_read_input_tokens // 0' <<<"$last" 2>/dev/null || echo 0) cc=$(jq -r '.message.usage.cache_creation_input_tokens // 0' <<<"$last" 2>/dev/null || echo 0) fi fi ctx_used=$(( in_tok + cr + cc )) ctx_pct=$(awk -v u="$ctx_used" -v m="$ctx_max" 'BEGIN { if (m>0) printf "%d", u*100/m; else print 0 }') line="" ``` --- ## Step 3 โ€” block catalog For every block: a one-line description, a copy-paste snippet that **appends** to `$line`. The first block in your line should NOT have a leading `${SEP}` โ€” drop the leading `${SEP}` on whichever block you choose first. ### `model` โ€” model name with `(1M)` indicator ```bash line+="${G}${model_name}${N}" ``` ### `context` โ€” icon + percent + bar + tokens ```bash # pct icon if (( ctx_pct < 40 )); then ctx_icon="๐Ÿš€" elif (( ctx_pct < 50 )); then ctx_icon="๐Ÿš—" else ctx_icon="โš ๏ธ" fi # pct color if (( ctx_pct < 50 )); then cc_=$GR; cd_=$GRD elif (( ctx_pct < 70 )); then cc_=$Y; cd_=$YD else cc_=$R; cd_=$RU fi # bar (8 levels per cell) eighths=$(( (ctx_pct * 8 + 5) / 10 )) full=$(( eighths / 8 )); part=$(( eighths % 8 )) empty=$(( 10 - full - (part > 0 ? 1 : 0) )) parts=("" "โ–" "โ–Ž" "โ–" "โ–Œ" "โ–‹" "โ–Š" "โ–‰") ctx_bar="" for (( i=0; i 0 )) && ctx_bar+="${parts[$part]}" for (( i=0; i 0 ? 1 : 0) )) parts=("" "โ–" "โ–Ž" "โ–" "โ–Œ" "โ–‹" "โ–Š" "โ–‰") ctx_bar="" for (( i=0; i 0 )) && ctx_bar+="${parts[$part]}" for (( i=0; i 0 ? 1 : 0) )) parts=("" "โ––" "โ–„" "โ–™") ctx_bar="" for (( i=0; i 0 )) && ctx_bar+="${parts[$part]}" for (( i=0; i/dev/null \ | jq -s '[.[] | select(.message.usage) | .message.usage | ((.input_tokens // 0) + (.output_tokens // 0) + (.cache_creation_input_tokens // 0) + (.cache_read_input_tokens // 0))] | add // 0' 2>/dev/null) fi sess_k=$(( ${sess_total:-0} / 1000 )) # thin-space thousand separator fmt_thin() { local n=$1 result="" len i; len=${#n} for ((i=0; i 0 && (len-i) % 3 == 0 )) && result+=$'\xe2\x80\x89' result+="${n:$i:1}" done printf '%s' "$result" } sess_fmt=$(fmt_thin "$sess_k") line+="${SEP}${GRD}tokens: ${C}${sess_fmt}${CD}K${N}" ``` ### `folder` โ€” current directory basename ```bash folder=$(basename "$cwd") line+="${SEP}${B}${folder}${N}" ``` ### `git-branch` โ€” git branch only ```bash br="" if git -C "$cwd" rev-parse --git-dir >/dev/null 2>&1; then br=$(git -C "$cwd" symbolic-ref --short HEAD 2>/dev/null \ || git -C "$cwd" rev-parse --short HEAD 2>/dev/null) line+="${SEP}${B}โއ ${br}${N}" fi ``` ### `git` โ€” branch + dirty count + ahead / behind ```bash git_part="" if git -C "$cwd" rev-parse --git-dir >/dev/null 2>&1; then br=$(git -C "$cwd" symbolic-ref --short HEAD 2>/dev/null \ || git -C "$cwd" rev-parse --short HEAD 2>/dev/null) dirty=$(git -C "$cwd" status --porcelain 2>/dev/null | wc -l | tr -d ' ') ahead=0; behind=0 upstream=$(git -C "$cwd" rev-parse --abbrev-ref --symbolic-full-name '@{u}' 2>/dev/null) if [[ -n "$upstream" ]]; then counts=$(git -C "$cwd" rev-list --left-right --count HEAD...@{u} 2>/dev/null) ahead=${counts%% *}; behind=${counts##* } fi git_part="${B}โއ ${br}${N}" (( dirty > 0 )) && git_part+=" ${Y}โœš${dirty}${N}" (( ahead > 0 )) && git_part+=" ${GR}โ†‘${ahead}${N}" (( behind > 0 )) && git_part+=" ${R}โ†“${behind}${N}" line+="${SEP}${git_part}" fi ``` ### `limits` โ€” 5h / 7d rate limits with โš ๏ธ at > 50 % ```bash lim5h=$(j '.rate_limits.five_hour.used_percentage // .rate_limits.session.percent_used') lim7d=$(j '.rate_limits.seven_day.used_percentage // .rate_limits.weekly.percent_used') if [[ -n "$lim5h" || -n "$lim7d" ]]; then l5=${lim5h%.*}; l7=${lim7d%.*} w5=""; (( ${l5:-0} > 50 )) && w5="โš ๏ธ " w7=""; (( ${l7:-0} > 50 )) && w7="โš ๏ธ " line+="${SEP}${GRD}5h:${N} ${w5}${GR}${l5:-โ€”}${GRD}%${N} ${GRD}7d:${N} ${w7}${GR}${l7:-โ€”}${GRD}%${N}" fi ``` ### `thinking` โ€” effort level (with ๐Ÿค–) ```bash thinking=$(j '.effort.level // .thinking.level // .thinking // .output_style.name') [[ -z "$thinking" ]] && thinking="default" line+="${SEP}๐Ÿค– ${C}${thinking}${N}" ``` ### `time-active` โ€” sum of inter-message gaps < 5 min ("on keyboard") ```bash IDLE=300 to_epoch() { local ts="$1"; [[ -z "$ts" ]] && { echo 0; return; } [[ "$ts" =~ ^[0-9]+$ ]] && { echo "$ts"; return; } local c="${ts%%.*}"; c="${c%Z}"; c="${c//T/ }" date -j -f '%Y-%m-%d %H:%M:%S' "$c" +%s 2>/dev/null \ || date -d "$ts" +%s 2>/dev/null || echo 0; } fmt_dur() { local s=$1; (( s<0 )) && s=0 local h=$((s/3600)) m=$(((s%3600)/60)) if (( h>0 )); then printf '%dh%02dm' $h $m elif (( m>0 )); then printf '%dm' $m else printf '%ds' $s; fi; } active_s=0; first=0; last=0; turns=0 if [[ -n "$transcript" && -f "$transcript" ]]; then prev=0 while IFS= read -r ts; do [[ -z "$ts" ]] && continue e=$(to_epoch "$ts"); (( e==0 )) && continue (( first==0 )) && first=$e; last=$e if (( prev>0 )); then gap=$(( e - prev )) (( gap > 0 && gap < IDLE )) && active_s=$(( active_s + gap )) fi prev=$e; turns=$(( turns + 1 )) done < <(jq -r '.timestamp // .created_at // .message.created_at // empty' "$transcript" 2>/dev/null) fi wall_s=$(( last > 0 && first > 0 ? last - first : 0 )) line+="${SEP}${C}โฑ active ${fmt_dur $active_s}${N}" ``` ### `time-wall` โ€” total session span (first โ†’ last message) ```bash # requires the same setup as time-active above line+="${SEP}${C}โฑ wall ${fmt_dur $wall_s}${N}" ``` ### `turns` โ€” number of message pairs ```bash # requires turn counting from time-active block line+="${SEP}${B}${turns}${D} turns${N}" ``` ### `host` โ€” short hostname ```bash host=$(hostname -s 2>/dev/null || echo localhost) line+="${SEP}${C}${host}${N}" ``` ### `cups` โ€” cost-derived "coffee cup" count ```bash cups=$(awk -v c="$cost" 'BEGIN { printf "%d", c*4 }') # 1 cup โ‰ˆ $0.25 line+="${SEP}โ˜• ${G}${cups}${N}" ``` ### `level` โ€” RPG-style level from cost ```bash level=$(awk -v c="$cost" 'BEGIN { printf "%d", c+1 }') line+="${SEP}${M}LV ${level}${N}" ``` ### `mood-icon` โ€” emoji that changes with context % ```bash if (( ctx_pct < 30 )); then mood="โ˜€" elif (( ctx_pct < 60 )); then mood="โ›…" elif (( ctx_pct < 80 )); then mood="๐ŸŒง" else mood="โ›ˆ" fi line+="${SEP}${mood}" ``` --- ## Footer Always end with: ```bash printf '%s\n' "$line" ``` --- ## Worked example โ€” build a developer-friendly compact line Goal: `Opus 4.7 ยท 12% โ–ˆโ–Œโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ ยท โއ main โœš3 ยท 0.42$` 1. Style: `compact` (dot separator) 2. Blocks (in order): `model`, `context-pct`, `context-bar`, `git`, `cost` Final script: ```bash #!/usr/bin/env bash # my-statusline.sh โ€” composed from BLOCKS.md # style: compact; blocks: model ยท context-pct + context-bar ยท git ยท cost set -uo pipefail input=$(cat) # โ”€โ”€ style: compact โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ G=$'\e[1;38;5;220m'; GD=$'\e[38;5;178m' GR=$'\e[1;38;5;46m'; GRD=$'\e[38;5;34m' Y=$'\e[1;38;5;226m' R=$'\e[1;38;5;196m' B=$'\e[1;38;5;39m' D=$'\e[38;5;244m'; N=$'\e[0m' SEP=" ${D}ยท${N} " # โ”€โ”€ header โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ j() { jq -r "$1 // empty" 2>/dev/null <<<"$input"; } model_disp=$(j '.model.display_name'); model_id=$(j '.model.id') model_name="${model_disp:-${model_id:-Claude}}"; model_name="${model_name// context/}" cwd=$(j '.workspace.current_dir'); [[ -z "$cwd" ]] && cwd="$PWD" cost=$(j '.cost.total_cost_usd'); cost=${cost:-0} cost_fmt=$(awk -v c="$cost" 'BEGIN { printf "%.2f", c+0 }') transcript=$(j '.transcript_path') exceeds_200k=$(j '.exceeds_200k_tokens') [[ "$model_id" == *"[1m]"* || "$model_disp" == *"1M"* || "$exceeds_200k" == "true" ]] \ && ctx_max=1000000 || ctx_max=200000 in_tok=0; cr=0; cc=0 if [[ -n "$transcript" && -f "$transcript" ]]; then last=$(grep '"usage"' "$transcript" 2>/dev/null | tail -1) if [[ -n "$last" ]]; then in_tok=$(jq -r '.message.usage.input_tokens // 0' <<<"$last" 2>/dev/null || echo 0) cr=$(jq -r '.message.usage.cache_read_input_tokens // 0' <<<"$last" 2>/dev/null || echo 0) cc=$(jq -r '.message.usage.cache_creation_input_tokens // 0' <<<"$last" 2>/dev/null || echo 0) fi fi ctx_used=$(( in_tok + cr + cc )) ctx_pct=$(awk -v u="$ctx_used" -v m="$ctx_max" 'BEGIN { if (m>0) printf "%d", u*100/m; else print 0 }') line="" # โ”€โ”€ block: model โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ line+="${G}${model_name}${N}" # โ”€โ”€ block: context-pct + context-bar โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ eighths=$(( (ctx_pct * 8 + 5) / 10 )) full=$(( eighths / 8 )); part=$(( eighths % 8 )) empty=$(( 10 - full - (part > 0 ? 1 : 0) )) parts=("" "โ–" "โ–Ž" "โ–" "โ–Œ" "โ–‹" "โ–Š" "โ–‰") ctx_bar="" for (( i=0; i 0 )) && ctx_bar+="${parts[$part]}" for (( i=0; i/dev/null 2>&1; then br=$(git -C "$cwd" symbolic-ref --short HEAD 2>/dev/null || git -C "$cwd" rev-parse --short HEAD 2>/dev/null) dirty=$(git -C "$cwd" status --porcelain 2>/dev/null | wc -l | tr -d ' ') git_part="${B}โއ ${br}${N}" (( dirty > 0 )) && git_part+=" ${Y}โœš${dirty}${N}" line+="${SEP}${git_part}" fi # โ”€โ”€ block: cost โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ line+="${SEP}${G}${cost_fmt}${GD}\$${N}" # โ”€โ”€ footer โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ printf '%s\n' "$line" ``` --- ## See also - [`statusline.sh`](statusline.sh) โ€” full reference implementation - [`examples/`](examples/) โ€” 40 ready-made variants (20 detailed + 20 compact) - [`screenshots/`](screenshots/) โ€” pre-rendered ANSI previews - [`README.md`](README.md) โ€” main project documentation --- For permission to reuse any of these blocks in another project, contact: **amazopic@gmail.com**. --- # Examples index # Examples โ€” 40 ready-made status line variants Each theme ships in **two variants**: - **Detailed** โ€” full feature set (model, context, cost, tokens, git, time, theme accents, โ€ฆ) - **Compact** โ€” minimal three-segment layout: `model ยท context % + bar ยท git branch` Both are **standalone** โ€” copy any one to `~/.claude/status-line.sh`, `chmod +x`, and you're done. > ๐Ÿ’ก **One-file alternative**: see [`../statusline-bundle.sh`](../statusline-bundle.sh) โ€” > all 40 themes + all blocks + a CLI configurator (`use`, `custom`, > `preview`, `list`) in a single script. Pair with [`../commands/statusline.md`](../commands/statusline.md) > for a `/statusline` Claude Code slash command. > Want to see them in your terminal first? Browse [`../screenshots/`](../screenshots/). > Want to assemble your own from scratch? See [`../BLOCKS.md`](../BLOCKS.md). ## ๐Ÿ›  Practical | Theme | Detailed | Compact | |---|---|---| | minimal | [`statusline-minimal.sh`](statusline-minimal.sh) | [`statusline-minimal-compact.sh`](statusline-minimal-compact.sh) | | developer (git-aware) | [`statusline-developer.sh`](statusline-developer.sh) | [`statusline-developer-compact.sh`](statusline-developer-compact.sh) | | **time** (human-hours tracker) | [`statusline-time.sh`](statusline-time.sh) | [`statusline-time-compact.sh`](statusline-time-compact.sh) | | zen (mono-ASCII, no emojis) | [`statusline-zen.sh`](statusline-zen.sh) | [`statusline-zen-compact.sh`](statusline-zen-compact.sh) | ## ๐ŸŽจ Themed | Theme | Detailed | Compact | |---|---|---| | rainbow | [`statusline-rainbow.sh`](statusline-rainbow.sh) | [`statusline-rainbow-compact.sh`](statusline-rainbow-compact.sh) | | anime โœจ๐ŸŒธ | [`statusline-anime.sh`](statusline-anime.sh) | [`statusline-anime-compact.sh`](statusline-anime-compact.sh) | | love ๐Ÿ’– | [`statusline-love.sh`](statusline-love.sh) | [`statusline-love-compact.sh`](statusline-love-compact.sh) | | cat ๐Ÿฑ | [`statusline-cat.sh`](statusline-cat.sh) | [`statusline-cat-compact.sh`](statusline-cat-compact.sh) | | christmas ๐ŸŽ„ | [`statusline-christmas.sh`](statusline-christmas.sh) | [`statusline-christmas-compact.sh`](statusline-christmas-compact.sh) | ## ๐Ÿ’ป Hacker / Sci-fi | Theme | Detailed | Compact | |---|---|---| | hacker (Matrix) | [`statusline-hacker.sh`](statusline-hacker.sh) | [`statusline-hacker-compact.sh`](statusline-hacker-compact.sh) | | cyberpunk (neon) | [`statusline-cyberpunk.sh`](statusline-cyberpunk.sh) | [`statusline-cyberpunk-compact.sh`](statusline-cyberpunk-compact.sh) | | space ๐Ÿš€ | [`statusline-space.sh`](statusline-space.sh) | [`statusline-space-compact.sh`](statusline-space-compact.sh) | | retro (8-bit) | [`statusline-retro.sh`](statusline-retro.sh) | [`statusline-retro-compact.sh`](statusline-retro-compact.sh) | ## ๐ŸŒ Elemental / Mood | Theme | Detailed | Compact | |---|---|---| | fire ๐Ÿ”ฅ | [`statusline-fire.sh`](statusline-fire.sh) | [`statusline-fire-compact.sh`](statusline-fire-compact.sh) | | ocean ๐ŸŒŠ | [`statusline-ocean.sh`](statusline-ocean.sh) | [`statusline-ocean-compact.sh`](statusline-ocean-compact.sh) | | weather โ˜€โ›…๐ŸŒง | [`statusline-weather.sh`](statusline-weather.sh) | [`statusline-weather-compact.sh`](statusline-weather-compact.sh) | | coffee โ˜• | [`statusline-coffee.sh`](statusline-coffee.sh) | [`statusline-coffee-compact.sh`](statusline-coffee-compact.sh) | | music ๐ŸŽต | [`statusline-music.sh`](statusline-music.sh) | [`statusline-music-compact.sh`](statusline-music-compact.sh) | ## ๐ŸŽฎ Gamified | Theme | Detailed | Compact | |---|---|---| | game (RPG HUD) | [`statusline-game.sh`](statusline-game.sh) | [`statusline-game-compact.sh`](statusline-game-compact.sh) | | pirate ๐Ÿดโ€โ˜ ๏ธ | [`statusline-pirate.sh`](statusline-pirate.sh) | [`statusline-pirate-compact.sh`](statusline-pirate-compact.sh) | ## Try one ```bash # pick a variant โ€” detailed or compact cp examples/statusline-cyberpunk-compact.sh ~/.claude/status-line.sh chmod +x ~/.claude/status-line.sh ``` Then make sure `~/.claude/settings.json` points to it: ```json { "statusLine": { "type": "command", "command": "/Users//.claude/status-line.sh" } } ``` Restart Claude Code (or `/config` reload). ## See them all in your terminal The `../screenshots/` folder has pre-rendered ANSI captures of every variant (40 themes + the main reference). To browse the whole gallery: ```bash for f in screenshots/*.ansi; do printf "\n=== %s ===\n" "$(basename "$f" .ansi)" cat "$f" done ``` Each `.ansi` file contains the literal terminal output (with ANSI color codes), so `cat` displays it exactly as it would appear in your status line. ## Build your own from blocks Don't see a layout you want? See [`../BLOCKS.md`](../BLOCKS.md) โ€” a catalog of 18+ named blocks (model, context-bar, cost, tokens, git, time, thinking, โ€ฆ) that you can paste into a script in any order to build a custom line. ## About `statusline-time.sh` (human-hours tracker) Detailed variant computes: - **Active time** โ€” sum of inter-message intervals **shorter than 5 min** (treats longer gaps as "away from keyboard"). The closest approximation to actual time-on-task. - **Wall time** โ€” total span from the first to the last message. - **Turns** โ€” number of user/assistant message pairs. Timestamps are pulled from the JSONL transcript via `jq`, trying `.timestamp`, `.created_at`, and `.message.created_at` in that order. If none are present, falls back to file `mtime - ctime` for wall time. The 5-minute idle threshold is configurable โ€” change `IDLE_THRESHOLD` near the top of the script. The compact variant (`statusline-time-compact.sh`) shows just `active` time alongside model + context + branch. --- > Author: **Yevgeniy Achin** ยท โœ‰ [amazopic@gmail.com](mailto:amazopic@gmail.com) > License: **Source-Available** ([../LICENSE](../LICENSE)) โ€” reuse only > with the author's prior permission. --- # License (full text) Source-Available License (Reuse-by-Permission) Copyright (c) 2026 Yevgeniy Achin Contact: amazopic@gmail.com This source code is made publicly available for the following purposes: โ€ข reading and study; โ€ข personal evaluation on the user's own machine; โ€ข reference and learning. Any of the following actions REQUIRE PRIOR WRITTEN PERMISSION from the author (Yevgeniy Achin ): โ€ข copying, mirroring, or redistributing the source code, in whole or in part, on any platform or under any name; โ€ข modifying or creating derivative works based on this code; โ€ข including this code (or any portion of it) in another project, package, library, plugin, dotfiles repo, or product โ€” whether commercial or non-commercial, free or paid; โ€ข selling, sublicensing, relicensing, or transferring the rights; โ€ข removing or altering the author attribution, copyright notice, or this license text in any copy you have received permission to make. Permitted without prior permission: โ€ข running the published `statusline.sh` (or any of the example scripts) locally on your own computer as your Claude Code status line; โ€ข linking to this repository from articles, blog posts, talks, and social posts (please credit the author); โ€ข opening issues and submitting pull requests to this project; contributions are accepted only after explicit acceptance by the author and become subject to this same license. To request reuse permission, contact the author at amazopic@gmail.com with: a short description of your intended use, where the code will appear, and how the author will be credited. Reasonable requests for personal, educational, and non-commercial use are typically granted free of charge. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the author be liable for any claim, damages, or other liability arising from, out of, or in connection with the software or the use or other dealings in the software.