{"id":49142475,"url":"https://github.com/nerdalytics/claude-statusline","last_synced_at":"2026-04-22T01:33:46.115Z","repository":{"id":351653399,"uuid":"1211898285","full_name":"nerdalytics/claude-statusline","owner":"nerdalytics","description":"A single-file zsh statusline for Claude Code","archived":false,"fork":false,"pushed_at":"2026-04-15T22:05:44.000Z","size":809,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"trunk","last_synced_at":"2026-04-16T00:16:13.646Z","etag":null,"topics":["claude-code","statusline"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nerdalytics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-15T21:30:49.000Z","updated_at":"2026-04-15T22:06:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nerdalytics/claude-statusline","commit_stats":null,"previous_names":["nerdalytics/claude-statusline"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/nerdalytics/claude-statusline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerdalytics%2Fclaude-statusline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerdalytics%2Fclaude-statusline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerdalytics%2Fclaude-statusline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerdalytics%2Fclaude-statusline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nerdalytics","download_url":"https://codeload.github.com/nerdalytics/claude-statusline/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerdalytics%2Fclaude-statusline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32117410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T00:31:26.853Z","status":"ssl_error","status_checked_at":"2026-04-22T00:30:22.894Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude-code","statusline"],"created_at":"2026-04-22T01:33:43.513Z","updated_at":"2026-04-22T01:33:46.103Z","avatar_url":"https://github.com/nerdalytics.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# claude-statusline\n\nA single-file zsh statusline for [Claude Code](https://claude.com/claude-code).\nIt renders up to four rows of live session state and fits them into\nwhatever terminal width Claude Code hands it.\n\n![Full statusline at a wide terminal: META row with model name, 7-day and 5-hour rate bars, context bar, and cost; REPO row with branch and dirty-file indicators; TOOLS row with per-tool chips; TASKS row with the in-progress task.](./assets/layout-full.png)\n\n## Install\n\nTwo paths. The non-developer path uses Finder and TextEdit only. The\ndeveloper path uses a terminal. Pick whichever fits.\n\n### Non-developer path (macOS, no terminal)\n\nYou need a working Claude Code install. Everything else happens in Finder\nand TextEdit.\n\n**1. Download the project.**\n\nClick this link. Your browser downloads a zip file to the **Downloads**\nfolder:\n\n[**claude-statusline-trunk.zip** (direct download)](https://github.com/nerdalytics/claude-statusline/archive/refs/heads/trunk.zip)\n\n**2. Unzip it.**\n\nOpen the **Downloads** folder in Finder. Double-click\n`claude-statusline-trunk.zip`. macOS extracts a folder called\n`claude-statusline-trunk`. Open that folder. Find the file named\n`statusline.zsh`. That is the one file you are installing.\n\n**3. Open your home folder.**\n\nIn Finder, press `⌘` + `⇧` + `H` (command, shift, H). Finder shows your\nhome folder, which contains **Desktop**, **Documents**, **Downloads**,\nand a few others.\n\n**4. Make hidden folders visible.**\n\nClaude Code keeps its settings in a folder called `.claude` inside your\nhome folder. Folders whose name starts with a dot are hidden by default.\n\nIn Finder, press `⌘` + `⇧` + `.` (command, shift, period). Hidden\nfolders appear. `.claude` should now be visible among the others. Press\nthe same keys later to hide them again.\n\n\u003cdetails\u003e\n\u003csummary\u003eWhat if \u003ccode\u003e.claude\u003c/code\u003e is missing entirely?\u003c/summary\u003e\n\nOpen Claude Code at least once. Claude Code creates the folder on first\nlaunch. Then come back to this step.\n\n\u003c/details\u003e\n\n**5. Move the script into `.claude`.**\n\nDrag `statusline.zsh` from the extracted folder into `.claude`. If macOS\nasks whether to replace an existing file with the same name, click\n**Replace**.\n\n**6. Open the settings file.**\n\nInside `.claude`, look for a file called `settings.json`. Right-click it\nand choose **Open With → TextEdit**.\n\n\u003cdetails\u003e\n\u003csummary\u003eWhat if \u003ccode\u003esettings.json\u003c/code\u003e does not exist yet?\u003c/summary\u003e\n\nRight-click in the empty area inside `.claude` and choose **New\nDocument**, or create the file from TextEdit (**File → New**, then save\nas `settings.json` into `.claude`).\n\n\u003c/details\u003e\n\n**7. Switch TextEdit to plain text.**\n\nIn TextEdit's **Format** menu, click **Make Plain Text** if that option\nis there. If you see **Make Rich Text** instead, the file is already\nplain text and you can leave it alone.\n\nTextEdit has to be in plain text mode, otherwise it saves invisible\nformatting that Claude Code cannot parse.\n\n**8. Paste in the settings block.**\n\nIf `settings.json` is empty, paste this in exactly:\n\n```json\n{\n  \"statusLine\": {\n    \"type\": \"command\",\n    \"command\": \"zsh ~/.claude/statusline.zsh\",\n    \"refreshInterval\": 1\n  }\n}\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eWhat if \u003ccode\u003esettings.json\u003c/code\u003e already contains other settings?\u003c/summary\u003e\n\nKeep what is there and add only the `\"statusLine\": { ... }` key alongside\nthem, separated by a comma. When in doubt, copy the whole file into\n[jsonlint.com](https://jsonlint.com). It will tell you whether the shape\nis valid.\n\n\u003c/details\u003e\n\nSave with `⌘` + `S`. Close TextEdit.\n\n**9. Restart Claude Code.**\n\nIn your Claude Code prompt, type `/exit` and press Enter. That shuts\ndown Claude Code cleanly and returns you to your terminal's shell\nprompt. Then start Claude Code again:\n\n```sh\nclaude\n```\n\nThe statusline appears above your next prompt.\n\n\u003cdetails\u003e\n\u003csummary\u003eWhat if \u003ccode\u003eclaude\u003c/code\u003e prints \u003ccode\u003ecommand not found\u003c/code\u003e?\u003c/summary\u003e\n\nTry `claude-code` instead. The command name depends on how Claude Code\nwas installed on your machine. Use whichever one you used the first\ntime.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eWhy not \u003ccode\u003e⌘\u003c/code\u003e + \u003ccode\u003eQ\u003c/code\u003e?\u003c/summary\u003e\n\nClaude Code runs inside a terminal app. `⌘` + `Q` would close the\nterminal window rather than let Claude Code shut down properly. Always\nuse `/exit`.\n\n\u003c/details\u003e\n\n#### If nothing changed\n\n- Check the filename in `.claude`. It has to be `settings.json`, not\n  `settings.json.txt`. If TextEdit appended `.txt`, rename the file and\n  remove the extra extension.\n- Check that `statusline.zsh` sits directly inside `.claude`, not inside\n  a subfolder.\n- Open `settings.json` again. Confirm the `statusLine` block is still\n  there and still valid JSON (use [jsonlint.com](https://jsonlint.com)\n  to check).\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eDeveloper path\u003c/b\u003e — clone, symlink, paste JSON block, restart. Linux notes and a verify command inside.\u003c/summary\u003e\n\n```sh\ngit clone https://github.com/nerdalytics/claude-statusline.git ~/code/claude-statusline\nln -sfn ~/code/claude-statusline/statusline.zsh ~/.claude/statusline.zsh\n```\n\nAdd a `statusLine` block to `~/.claude/settings.json`:\n\n```json\n{\n  \"statusLine\": {\n    \"type\": \"command\",\n    \"command\": \"~/.claude/statusline.zsh\",\n    \"refreshInterval\": 1\n  }\n}\n```\n\nRestart Claude Code.\n\n**Linux:** same flow. Clone anywhere, symlink into `~/.claude`. Make\nsure `zsh`, `jq`, and `git` are on `PATH`. `jq` is not bundled with\nmost Linux distributions, so install with `apt install jq`,\n`dnf install jq`, or your distro equivalent.\n[`gh`](https://cli.github.com/) is optional and drives the PR-related\nsegments on the REPO row; everything else works without it.\n\n**Verify:**\n\n```sh\necho '{\"model\":{\"display_name\":\"Claude Sonnet 4\"},\"context_window\":{\"current_usage\":{\"input_tokens\":50000},\"context_window_size\":200000}}' \\\n  | zsh ~/.claude/statusline.zsh\n```\n\nA gradient `Claude Sonnet 4` followed by a 25%-full context bar means\nthe script is wired up correctly.\n\n\u003c/details\u003e\n\n## Configure\n\nThe script reads configuration from three places:\n\n| Source                           | Purpose                                               |\n|----------------------------------|-------------------------------------------------------|\n| `~/.claude/settings.json`        | Main Claude Code settings                             |\n| `~/.claude/settings.local.json`  | Per-machine overrides. Local wins if both are present |\n| `~/.claude/statusline.conf`      | Optional zsh file sourced at startup for script vars  |\n\n### `statusLine.refreshInterval` (integer)\n\nLives in `settings.json`. Controls how often Claude Code re-runs the\nstatusline script, in seconds. Lower values mean the bars and counters\nupdate closer to real time; higher values reduce the render load at the\ncost of staleness.\n\n```json\n{ \"statusLine\": { \"refreshInterval\": 1 } }\n```\n\nThe minimum (and recommended) value is `1`. It keeps the rate-limit\nbars, context bar, and tool counters fresh. Set it higher if you want\nthe statusline to refresh less often.\n\n### `statusLine.padding` (integer)\n\nLives in `settings.json` or `settings.local.json`. The script reads your\nterminal's column count, subtracts `4` for Claude Code's left chrome, then\nsubtracts this value. Set it when something else on screen consumes\nhorizontal space, such as a tmux status bar on the right edge or an IDE\ngutter.\n\n```json\n{ \"statusLine\": { \"padding\": 6 } }\n```\n\nDefault is `0` (no extra subtraction beyond the built-in 4).\n\n### `AUTOCOMPACT_BUFFER` (integer)\n\nSet in `~/.claude/statusline.conf`. Subtracted from the context-window\nsize before usage is computed. Use it when Claude Code's autocompact\nfeature reserves a token buffer you want the bar to account for. With\nthe buffer set, `100%` on the context bar means autocompact is about to\nfire, not that the hard context limit has been reached.\n\nClaude Code's current default is `33000` (33k tokens), visible at the\nbottom of the `/context` panel. Match that value unless you know your\ninstall uses a different reserve:\n\n```sh\n# ~/.claude/statusline.conf\nAUTOCOMPACT_BUFFER=33000\n```\n\n### `DEFAULT_BRANCH` (string)\n\nSet in `~/.claude/statusline.conf`. Overrides git default-branch detection.\nThe script normally reads `refs/remotes/origin/HEAD`. Set this when your\nrepository's HEAD symref is not configured.\n\n```sh\nDEFAULT_BRANCH=main\n```\n\n### `STATUSLINE_DEBUG` (environment variable)\n\nSet to any non-empty value to append a diagnostic line to\n`/tmp/statusline-responsive.log` on each render. The line records the\ndetected column width and the measured width of every row.\n\n```sh\nSTATUSLINE_DEBUG=1 echo '{\"model\":{\"display_name\":\"Test\"}}' | zsh ~/.claude/statusline.zsh\n```\n\n## What you see on screen\n\nUp to four rows. Each row appears only when it has content.\n\n| Row   | Content                                                                                                                           |\n|-------|-----------------------------------------------------------------------------------------------------------------------------------|\n| META  | Model name, 7-day rate bar, 5-hour rate bar, context-window bar, agent tokens, session cost                                       |\n| REPO  | Project directory, branch, worktree, PR number and state and review, comments, sync with remote, mergeability, CI checks, dirty files |\n| TOOLS | Total tool-call count, per-tool chips with counts, currently running tool                                                          |\n| TASKS | Completed/total counter, last-completed name, in-progress task, first pending task, running sub-agents                            |\n\n### META row\n\n| Segment         | What it shows                                                                                                               | Visible when                                                        |\n|-----------------|-----------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------|\n| **model**       | Model display name (`Claude Sonnet 4`, `Opus 4.6 (1M context)`). Rendered as a teal→purple gradient.                         | Always                                                              |\n| **rate7d**      | 7-day rate-limit usage as a 7-cell bar with a `7d` badge. Purple gradient. Suffix shows time-to-reset (`↻ 5d16h`).            | `rate_limits.seven_day` is in the input JSON                        |\n| **rate5h**      | 5-hour rate-limit usage as a 10-cell bar with a `5h` badge. Cyan gradient. Suffix shows time-to-reset (`↻ 4h19m`).            | `rate_limits.five_hour` is in the input JSON                        |\n| **context**     | Context-window usage as a 10-cell bar. Badge is a progress glyph. Suffix is remaining tokens (`↻ 142.5K`). Green→yellow→red. | `context_window.current_usage` is present and window size \u003e 0       |\n| **agent_tokens**| Tokens consumed by sub-agents (`⚡12.3K`). Muted gray.                                                                        | At least one sub-agent reported tokens in the transcript            |\n| **cost**        | Session cost in USD (`$1.42`). Muted gray.                                                                                   | `cost.total_cost_usd` is present and non-zero                       |\n\n**Fill-bar anatomy** (applies to all three bars):\n\n| Part          | Example    | Meaning                                                          |\n|---------------|------------|------------------------------------------------------------------|\n| Filled cells  | `████`     | Used portion. Coloured by gradient.                              |\n| Badge         | `▕ 7d ▏`   | Label with auto-contrast foreground on a coloured background.    |\n| Empty cells   | `▁▁▁`      | Unused portion. Dim.                                             |\n| Suffix        | `↻ 2d14h`  | Reset countdown (rate bars) or remaining tokens (context bar).   |\n\n**Context bar overflow.** When remaining tokens fall below zero (after\n`AUTOCOMPACT_BUFFER` is accounted for), the bar switches to red→purple\ncolouring and shows the `⊙` glyph.\n\n### REPO row\n\nEvery REPO segment requires the current working directory to be inside a\ngit repository.\n\n| Segment          | Shows                                                                                                                                         | Visible when                               | Example                    |\n|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------|----------------------------|\n| **project**      | Directory name. Clickable (OSC 8 hyperlink to the directory).                                                                                 | In a git repo                              | `claude-statusline`        |\n| **branch**       | Current branch, prefixed `⎇`. When the branch was cut from a non-default branch, shows the ancestry chain. Clickable.                          | In a git repo                              | `⎇ trunk` / `⎇ main ⎇ feat`|\n| **worktree**     | Worktree name, prefixed `⎇`. Only shown when the worktree name differs from the branch name.                                                   | A worktree is active with a distinct name  | `⎇ review-pr-42`           |\n| **pr_number**    | Pull-request number for the current branch.                                                                                                   | A PR exists for the branch                 | `#142`                     |\n| **pr_state**     | Draft indicator.                                                                                                                              | The PR is a draft                          | `✎`                        |\n| **pr_review**    | Review decision.                                                                                                                              | A review decision exists                   | `✓` / `✗` / `⋯`             |\n| **pr_comments**  | Comment count.                                                                                                                                | PR has ≥ 1 comment                         | `✉ 3`                      |\n| **git_sync**     | Ahead/behind counts vs. upstream, or vs. the default branch when no upstream is set.                                                          | Branch diverges from remote                | `↑2 ↓1`                    |\n| **pr_mergeable** | Conflict warning.                                                                                                                             | PR mergeable status is `CONFLICTING`       | `⚠`                        |\n| **pr_checks**    | CI summary. Pending, failed, and passed counts. Compact form when everything passes.                                                          | PR has ≥ 1 status check                    | `✓12` / `○2 ✗1 ✓9`          |\n| **git_dirty**    | Lines added, lines deleted, files changed vs. HEAD.                                                                                           | Working tree has uncommitted changes       | `+45 -12 ~3`               |\n\n### TOOLS row\n\nAppears when at least one tool has been used this session.\n\n| Part                | Shows                                                                                                               | Example              |\n|---------------------|---------------------------------------------------------------------------------------------------------------------|----------------------|\n| **Total count**     | Purple number at the start. Total tool uses across all tools, including sub-agents.                                  | `142`                |\n| **Completed chips** | One chip per distinct tool, sorted by count ascending. `name N` when count \u003e 1, just `name` otherwise.               | `Read 39` `Edit 33`  |\n| **Running tool**    | Currently-executing tool, prefixed `◐`. Shows target (file path, command, pattern, prompt) when available.           | `◐ Bash: git status` |\n\n### TASKS row\n\nAppears when there are active tasks or running sub-agents.\n\n| Part                | Shows                                                                                                  | Example                  |\n|---------------------|--------------------------------------------------------------------------------------------------------|--------------------------|\n| **Counter**         | Completed / total. Total includes running sub-agents.                                                   | `10/10`                  |\n| **Completed glyphs**| One `✓` per completed task in the current group, followed by the last-completed task's name.            | `✓✓ Verify both batches` |\n| **In progress**     | Prefixed `◐` followed by the task name.                                                                 | `◐ Write tests`          |\n| **Pending**         | One `○` per pending task, followed by the first pending task's name.                                    | `○○ Deploy to staging`   |\n| **Running agents**  | One entry per running sub-agent, each prefixed `◐`. Shows the agent's description, truncated to 30 characters. | `◐ Reviewing PR`         |\n\n### Icon glossary\n\n| Icon  | Meaning                                     | Where                                            |\n|-------|---------------------------------------------|--------------------------------------------------|\n| `↻`   | Time-to-reset / remaining tokens            | Bar suffixes                                     |\n| `⎇`   | Git branch or worktree                      | REPO                                             |\n| `⚡`   | Agent token usage                            | META                                             |\n| `$`   | Session cost                                | META                                             |\n| `◐`   | In progress                                 | TOOLS, TASKS                                     |\n| `○`   | Pending                                     | TASKS; also context bar badge at low usage       |\n| `✓`   | Completed / CI pass / review approved       | TASKS, REPO                                      |\n| `✗`   | CI fail / review requested changes          | REPO                                             |\n| `⋯`   | Review required                             | REPO                                             |\n| `✎`   | Draft PR                                    | REPO                                             |\n| `✉`   | PR comments                                 | REPO                                             |\n| `↑`   | Commits ahead of remote                     | REPO                                             |\n| `↓`   | Commits behind remote                       | REPO                                             |\n| `⚠`   | Merge conflict                              | REPO                                             |\n| `+`   | Lines added                                 | REPO                                             |\n| `-`   | Lines deleted                               | REPO                                             |\n| `~`   | Files changed                               | REPO                                             |\n| `█`   | Filled bar cell                             | META bars                                        |\n| `▁`   | Empty bar cell                              | META bars                                        |\n\n**Context bar badge.** The glyph inside the context bar indicates how full\nthe window is:\n\n| Glyph | Usage                    |\n|-------|--------------------------|\n| `○`   | \u003c 20%                    |\n| `◔`   | 20% – 39%                |\n| `◑`   | 40% – 59%                |\n| `◕`   | 60% – 79%                |\n| `●`   | ≥ 80%                    |\n| `⊙`   | Overflow (remaining \u003c 0) |\n\n## How it adapts to narrow terminals\n\nFour full rows want more horizontal space than most terminals have. The\nscript runs three sequential passes each time Claude Code triggers a\nrender. It wraps rows wider than the terminal, enforces a six-line budget\nacross the whole display, then shrinks the widest remaining row one step\nat a time until everything fits.\n\n### Measuring available width\n\n`sl_detect_width` computes how many columns the statusline has to work\nwith.\n\n1. Read the terminal's column count. First `$COLUMNS`. If that is unset,\n   walk the process tree up to 8 ancestors looking for a real TTY and\n   run `stty size`. If nothing works, fall back to 9999.\n2. Read `statusLine.padding` from `settings.json` or `settings.local.json`\n   (local wins).\n3. Subtract `4` (Claude Code's left chrome) plus `statusLine.padding`.\n\nA 120-column terminal with `statusLine.padding: 2` gives the statusline\n114 columns to work with.\n\n### The three passes\n\n**Pass 1: wrap.** `_sl_try_wrap` tests any row wider than the available\nwidth. It walks segments left to right and finds the last clean boundary\nwhere the first half fits on one line and the second half also fits. Bar\nfills are never split mid-gradient. When both halves fit, the row renders\non two physical lines. When no clean split exists, the row stays on one\nline.\n\nMETA wraps after the rate bars when its width exceeds the terminal:\n\n![META row wrapped: model name, 7-day and 5-hour rate bars on line 1; context bar and cost continuing on line 2.](./assets/layout-meta-wrapped.png)\n\nTOOLS wraps at a chip boundary when there are too many chips to fit:\n\n![TOOLS row wrapped: first tool chips on line 1, remaining chips and the running tool continuing on line 2.](./assets/layout-tools-wrapped.png)\n\n**Pass 2: six-line budget.** Wrapped rows count as 2 physical lines,\nunwrapped rows as 1. When the total exceeds 6 lines:\n\n1. Un-wrap the lowest-priority rows first (reverse of `SL_LAYOUT_ORDER`,\n   skipping the protected first entry).\n2. If the total is still over budget, remove whole rows in reverse\n   priority until it fits.\n\n**Pass 3: shrink the widest.** A loop of up to 500 iterations finds the\nwidest row still exceeding its allowed width (1 line unwrapped, 2 if\nwrapped) and calls that row's shrink state machine for one atomic step.\nThe row is re-measured after each step. When a row's shrink function\nreports \"exhausted\" the row is removed entirely. META is the exception.\nWhen META still does not fit after all its shrink steps, every other row\nis removed to make room.\n\n### Row priority\n\n`SL_LAYOUT_ORDER=(meta repo tools tasks)` defines both the display order\nand the shrink priority. Index 1 (META) is protected and never removed.\nWhen the budget demands it, the rest are removed in reverse order: TASKS\nfirst, then TOOLS, then REPO.\n\nTo customise, override `SL_LAYOUT_ORDER` before `sl_layout` runs. Example,\nswapping the TOOLS and REPO rows:\n\n```zsh\nSL_LAYOUT_ORDER=(meta tools repo tasks)\n```\n\n### META row: 17 shrink steps\n\nMETA is data-driven by the `_SL_META_SHRINK_SEQUENCE` array. An implicit\nStep 0 runs first, then the 17 explicit steps execute in order, one per\ncall, until the row fits.\n\n**Step 0 (iterative).** Truncates the model name one character at a time,\nright to left, down to a \"first-word second-word\" minimum. `Opus 4.6 (1M\ncontext)` shrinks through `Opus 4.6 (1M contex…` → `Opus 4.6 (1M conte…`\n→ … → `Opus 4.6`, then stops.\n\nThe 17 steps run in priority order. Compact the rate bars first, then\nstrip badge spaces, clear badge text, drop the context glyph, strip\nthe refresh icon, clear the bar ranges entirely. Only after all that\ndoes the row start dropping segments: agent tokens, then cost, then\nthe model name itself.\n\n\u003cdetails\u003e\n\u003csummary\u003eShow the full 17-step table\u003c/summary\u003e\n\n| Step | Action                                                                                                                  |\n|------|-------------------------------------------------------------------------------------------------------------------------|\n|  1   | Compact the 7-day bar. Clear fill cells; keep only badge and suffix.                                                    |\n|  2   | Compact the 5-hour bar.                                                                                                 |\n|  3   | Strip the leading space from the 7-day badge text (` 7d ` → `7d `).                                                      |\n|  4   | Strip the leading space from the 5-hour badge text.                                                                      |\n|  5   | Compact the context bar. Clear fill cells; keep badge and suffix.                                                       |\n|  6   | Clear the 7-day badge text entirely.                                                                                    |\n|  7   | Clear the 5-hour badge text entirely.                                                                                   |\n|  8   | Strip the context badge's leading space and change its role to `spacer`. The progress glyph stays visible longer this way. |\n|  9   | Drop the context progress glyph (`◔ ◕ ◑ ○ ● ⊙`).                                                                         |\n|  10  | Remove the `↻ ` refresh icon from the 7-day bar suffix.                                                                 |\n|  11  | Remove the `↻ ` refresh icon from the 5-hour bar suffix.                                                                |\n|  12  | Remove the `↻ ` refresh icon from the context bar suffix.                                                               |\n|  13  | Clear the entire 7-day bar range.                                                                                       |\n|  14  | Clear the entire 5-hour bar range.                                                                                      |\n|  15  | Drop the agent-tokens segment (`⚡12.3K`).                                                                                |\n|  16  | Drop the cost segment (`$1.42`).                                                                                        |\n|  17  | Drop the model name.                                                                                                    |\n\n\u003c/details\u003e\n\n### REPO row: 6 shrink phases\n\nTruncates project, branch, and worktree names one character at a time\n(phases 0–2), then removes each segment in the same order (phases 3–5).\nOnce phase 5 is exhausted, the orchestrator removes the REPO row.\n\n\u003cdetails\u003e\n\u003csummary\u003eShow the full phase table\u003c/summary\u003e\n\n| Phase | Action                                                                                                             |\n|-------|--------------------------------------------------------------------------------------------------------------------|\n|  0    | Truncate the project name, right to left, down to 1 character.                                                     |\n|  1    | Truncate the branch name, right to left. The ` ⎇ ` prefix is preserved.                                             |\n|  2    | Truncate the worktree name, right to left. The ` ⎇ ` prefix is preserved.                                           |\n|  3    | Remove the project segment entirely.                                                                               |\n|  4    | Remove the branch segment entirely.                                                                                |\n|  5    | Remove the worktree segment entirely.                                                                              |\n\n\u003c/details\u003e\n\n### TOOLS row: 5 shrink phases\n\nStrips the `mcp__` prefix from MCP chips first, then left-truncates\nlong MCP names, right-truncates long regular names, walks back the `…`\nellipsis to individual dots, and finally collapses short chips to a\nsingle letter.\n\n\u003cdetails\u003e\n\u003csummary\u003eShow the full phase table\u003c/summary\u003e\n\nChip style is ` name count ` or ` name `. Shrink targets the `tool_seg`\nroles between `chip_start` and `chip_end`.\n\n| Phase | Action                                                                                                                 |\n|-------|------------------------------------------------------------------------------------------------------------------------|\n|  0    | Strip the `mcp__` prefix from the leftmost MCP chip (`mcp__claude-in-chrome` → `claude-in-chrome`).                     |\n|  1    | Left-truncate MCP chips with `…`, leftmost first.                                                                       |\n|  2    | Right-truncate regular chips longer than 4 characters, adding `…`.                                                      |\n|  3    | Walk back existing truncation: `…` → `..` → `.` → first letter only.                                                    |\n|  4    | Collapse any remaining 4-character-or-shorter chip to its first letter, leftmost first.                                  |\n\n\u003c/details\u003e\n\n### TASKS row: 5 shrink phases\n\nTruncates the completed/in-progress/pending task names one character at\na time, then collapses checkmark runs down to a single `✓`.\n\n\u003cdetails\u003e\n\u003csummary\u003eShow the full phase table\u003c/summary\u003e\n\n| Phase | Action                                                                                                         |\n|-------|----------------------------------------------------------------------------------------------------------------|\n|  0    | Truncate the last-completed task name, right to left. Checkmark prefix is preserved.                            |\n|  1    | Truncate running-agent descriptions, leftmost agent first.                                                     |\n|  2    | Truncate the in-progress task name, right to left. The `◐` prefix is preserved.                                 |\n|  3    | Truncate the first-pending task name, right to left. The `○`-glyph prefix is preserved.                         |\n|  4    | Collapse a row of `✓✓✓` checkmarks to a single `✓`.                                                             |\n\n\u003c/details\u003e\n\n### When nothing else fits\n\nWhen META still exceeds the available width after all 17 shrink steps\nhave run and the model name is gone, the orchestrator drops REPO, TOOLS,\nand TASKS immediately. META renders on whatever content survived, usually\njust a badge or two.\n\nUnder extreme width pressure the script compacts the bars and strips\nalmost everything else off. What remains:\n\n![Slim statusline: heavily compacted META row with only the essential segments visible.](./assets/layout-slim.png)\n\n## Contributing\n\nSource: [github.com/nerdalytics/claude-statusline](https://github.com/nerdalytics/claude-statusline).\nIssues and pull requests accepted.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerdalytics%2Fclaude-statusline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnerdalytics%2Fclaude-statusline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerdalytics%2Fclaude-statusline/lists"}