awesome-statusline
Awesome Statusline — the effort & thinking statusline for Claude Code
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Badge for your README
Markdown
[](/listings/awesomezun--claude-statusline)HTML
<a href="/listings/awesomezun--claude-statusline"><img src="/api/listings/awesomezun--claude-statusline/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
These steps run a script from the network that findsafeskills does not scan.
Option 1. Ask your AI agent (easiest)
Tell Claude Code:
Install https://github.com/awesomezun/claude-statusline
It asks for a size, a style and where to show it, then installs. Name a preset up front (`… with large-plain`) and it installs straight away.
Option 2. One line in the terminal
**macOS / Linux**
curl -fsSL https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.sh | bash
**Windows (PowerShell)**
irm https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.ps1 | iex
The installer asks for a size (1–5), a style (1–3), then where to show it (1 Statusline, 2 [Mods](#mods); macOS / Linux). Already know your preset? Append it:
curl -fsSL https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.sh | bash -s -- large-plain
Then **restart Claude Code**.
<details> <summary>Other ways to install: clone · when security software blocks it on Windows · plugin marketplace</summary> <br/>
**Clone and run**
git clone https://github.com/awesomezun/claude-statusline.git && cd claude-statusline ./install.sh large-plain # macOS / Linux (leave out the preset to be asked) ./install.ps1 large-plain # Windows PowerShell
**If security software blocks `irm | iex` on Windows**, download the installer, read it, then run it:
Invoke-WebRequest -Uri https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.ps1 -OutFile .\install.ps1 notepad .\install.ps1 powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1
**Plugin marketplace**
/plugin marketplace add awesomezun/claude-statusline /plugin install awesome-statusline
Then run `/statusline-setup`, or pass a preset directly: `/statusline-setup large-plain`.
</details>
---
<a id="presets"></a>
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
.claude-plugin/marketplace.json · Manifest · 24 lines
- {
- "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
- "name": "awesome-statusline",
- "description": "Awesome Statusline — the effort & thinking statusline for Claude Code",
- "owner": {
- "name": "AwesomeJun",
- "email": "sjkang89@gmail.com"
- },
- "plugins": [
- {
- "name": "awesome-statusline",
- "version": "3.7.0",
- "description": "A Claude Code statusline that shows reasoning effort and thinking. 5 sizes (xsmall-xlarge) x 3 styles (emoji, plain, text), Pro/Max/Ultra usage limits, Catppuccin, no Node/Nerd Font, native PowerShell on Windows.",
- "author": {
- "name": "AwesomeJun",
- "email": "sjkang89@gmail.com"
- },
- "source": "./",
- "category": "tools",
- "keywords": ["statusline", "catppuccin", "effort", "thinking", "context-window", "api-usage"],
- "homepage": "https://github.com/awesomezun/claude-statusline"
- }
- ]
- }
README.md · README · 480 lines · 6 findings marked
- <div align="center">
- # ⚡ Awesome Statusline
- **Model · reasoning effort · context · prompt cache · usage limits, at a glance: a statusline for [Claude Code](https://claude.com/claude-code), now in the Claude desktop app too.**<br/>
- One line to install on macOS, Linux and Windows.
- <img src="https://img.shields.io/github/stars/awesomezun/claude-statusline?style=flat-square&color=cba6f7" alt="Stars"/>
- <img src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-89b4fa?style=flat-square" alt="Platforms"/>
- <img src="https://img.shields.io/badge/presets-5%20sizes%20%C3%97%203%20styles-f5c2e7?style=flat-square" alt="5 sizes × 3 styles"/>
- <img src="https://img.shields.io/badge/plans-Pro%20%7C%20Max%20%7C%20Ultra-a6e3a1?style=flat-square" alt="Pro, Max, Ultra"/>
- <img src="https://img.shields.io/badge/license-MIT-fab387?style=flat-square" alt="MIT"/>
- <br/><br/>
- <img src="assets/reels/terminal.webp" alt="A Claude Code session at work with the large preset under the prompt: context climbing to 40%, the 5-hour limit to 34%, the weekly limit at 65%" width="820"/>
- <br/><br/>
- <a href="#install"><img src="https://img.shields.io/badge/Install-one%20line-cba6f7?style=for-the-badge" alt="Install: one line"/></a> <a href="#desktop"><img src="https://img.shields.io/badge/New-desktop%20%2B%20%2Fcockpit-fab387?style=for-the-badge" alt="New: the desktop app and /cockpit"/></a> <a href="#presets"><img src="https://img.shields.io/badge/Presets-15-89b4fa?style=for-the-badge" alt="15 presets: 5 sizes × 3 styles"/></a> <a href="https://awesomezun.github.io/claude-statusline/"><img src="https://img.shields.io/badge/Gallery-web-a6e3a1?style=for-the-badge" alt="Web gallery: every preset"/></a>
- [🇰🇷 한국어](README.ko.md) · [Desktop & cockpit](#desktop) · [v3.7](#v37) · [At a glance](#overview) · [Install](#install) · [Presets](#presets) · [Plan](#plans) · [Mods](#mods) · [What it shows](#fields) · [FAQ](#faq)
- </div>
- ---
- <a id="desktop"></a>
- ## ✨ New: in the Claude desktop app, with a cockpit
- <div align="center">
- <img src="assets/reels/desktop.webp" alt="The Claude desktop app: the large preset in the band above the prompt; then /cockpit opens a pane beside the chat with two dials, a status strip, fuel gauges and the sessions, and switches to the dashboard" width="820"/>
- </div>
- <table>
- <tr>
- <td width="33%" valign="top">
- **🖥️ The desktop app**<br/>
- Its Code tab doesn't run a `statusLine`. As a mod, all 15 presets draw in a band above the prompt there, and in the terminal.
- </td>
- <td width="33%" valign="top">
- **🛩️ `/cockpit`**<br/>
- A pane beside the chat, drawn like [1top](https://1top.si)'s menu bar: dials, fuel gauges, a radial token chart, every session and limit. Dark or light.
- </td>
- <td width="33%" valign="top">
- **⚡ One flag**<br/>
- Add `--mods` to the install line, or pick *Mods* when the installer asks. → [Mods](#mods) · [Cockpit](#cockpit)
- </td>
- </tr>
- </table>
- <div align="center">
- <img src="assets/reels/cockpit.webp" alt="The cockpit, dark beside light: the cluster with its dials moving, then the dashboard with the radial token chart, the model mix and the account cards" width="820"/>
- <sub>Beta: needs a Claude Code with mods (early access), on macOS or Linux.</sub>
- </div>
- <a id="v37"></a>
- ## 🆕 v3.7: Fable 5.2, the prompt cache, free limit resets, your account
- <div align="center">
- <img src="assets/presets/xlarge.png" alt="xlarge on Fable 5.2: the signed-in account and its plan beside the model, a Cache line at 92% hit, warm until 6:46pm with one miss after a tool change, and a free reset mark at the end of the 7D line" width="820"/>
- </div>
- <table>
- <tr>
- <td width="25%" valign="top">
- **🧠 Fable 5.2**<br/>
- Claude Code's new default Fable model, with its effort and its 1M context. Fable 5.1 and the Mythos models read the same way, in the band and the cockpit too.
- </td>
- <td width="25%" valign="top">
- **💾 Prompt cache**<br/>
- How much input came from the cache (`cache 92%`), until when it stays warm, and once it's cold what your next turn writes again. In every preset; xlarge gives it a line.
- </td>
- <td width="25%" valign="top">
- **🎫 Free limit resets**<br/>
- When claude.ai has given you a free limit reset you haven't used, the limits line ends with a 🎫 mark. Use it from Settings › Usage on the web or in the desktop app. → [FAQ](#faq)
- </td>
- <td width="25%" valign="top">
- **👤 Your account**<br/>
- The signed-in account's name and plan (`Alex · Max 5x`) beside the model, so you know which account the limits belong to. → [FAQ](#faq)
- </td>
- </tr>
- </table>
- ---
- <a id="overview"></a>
- ## 🧭 At a glance
- **15 presets: 5 sizes × 3 styles.** When you install, you pick a size (how much you see) and a style (how it looks). Your plan isn't a choice: Ultra included, it's applied automatically.
- <div align="center">
- <img src="assets/reels/presets.webp" alt="The presets one after another: xsmall, small, medium, large and xlarge, then large-plain, large-simple and xsmall-simple" width="820"/>
- </div>
- | Size ↓ · Style → | Emoji (default) | No emoji | Simple text |
- |---|---|---|---|
- | **[xsmall](#xsmall)** · 2 lines | `xsmall` | `xsmall-plain` | `xsmall-simple` (1 line) |
- | **[small](#small)** · 2 lines | `small` | `small-plain` | `small-simple` |
- | **[medium](#medium)** · 4 lines | `medium` | `medium-plain` | `medium-simple` |
- | **[large](#large)** · 5 lines ⭐ recommended | **`large`** | `large-plain` | `large-simple` |
- | **[xlarge](#xlarge)** · 6 lines | `xlarge` | `xlarge-plain` | `xlarge-simple` |
- - **Emoji** is the default: icons and gradient bars. A size on its own means this style (`large`).
- - **No emoji** (`-plain`) keeps the layout and the bars and drops only the emoji. It's the steadiest choice where emoji widths drift: tmux, SSH, Windows consoles.
- - **Simple text** (`-simple`) is text and numbers only, so the fields differ a little by size. Its colors compare usage with how much of the limit window has passed: green = under pace, yellow = on pace, red = ahead of time (or ≥ 90%).
- - Sizes can be abbreviated (`xs` · `s` · `m` · `l` · `xl`): `l-plain` = `large-plain`. The older names `simple` and `oneline` are `small-simple` and `xsmall-simple`.
- - New here? Start with **`large`**. You can switch any time.
- Want it in the Claude desktop app too? Install it as a [mod (beta)](#mods).
- > [!NOTE]
- > **Ultra is applied automatically.** Ultra has no 5-hour limit, so on Ultra every preset shows one weekly line with a per-day budget in place of the 5H and 7D lines. There's nothing to pick, and changing plans never needs a reinstall. → [Plan](#plans)
- ---
- <a id="install"></a>
- ## 🚀 Install
- ### Option 1. Ask your AI agent (easiest)
- Tell Claude Code:
- ```text
- Install https://github.com/awesomezun/claude-statusline
- ```
- It asks for a size, a style and where to show it, then installs. Name a preset up front (`… with large-plain`) and it installs straight away.
- ### Option 2. One line in the terminal
- **macOS / Linux**
- ```bash
- curl -fsSL https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.sh | bash
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 153 on GitHub
- ```
- **Windows (PowerShell)**
- ```powershell
- irm https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.ps1 | iex
- Note: Runs a downloaded PowerShell script (iex / Invoke-Expression)
- Line 158 on GitHub
- ```
- The installer asks for a size (1–5), a style (1–3), then where to show it (1 Statusline, 2 [Mods](#mods); macOS / Linux). Already know your preset? Append it:
- ```bash
- curl -fsSL https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.sh | bash -s -- large-plain
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 164 on GitHub
- ```
- Then **restart Claude Code**.
- <details>
- <summary>Other ways to install: clone · when security software blocks it on Windows · plugin marketplace</summary>
- <br/>
- **Clone and run**
- ```bash
- git clone https://github.com/awesomezun/claude-statusline.git && cd claude-statusline
- ./install.sh large-plain # macOS / Linux (leave out the preset to be asked)
- ./install.ps1 large-plain # Windows PowerShell
- ```
- **If security software blocks `irm | iex` on Windows**, download the installer, read it, then run it:
- Note: Runs a downloaded PowerShell script (iex / Invoke-Expression)
- Line 180 on GitHub
- ```powershell
- Invoke-WebRequest -Uri https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.ps1 -OutFile .\install.ps1
- notepad .\install.ps1
- powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1
- ```
- **Plugin marketplace**
- ```
- /plugin marketplace add awesomezun/claude-statusline
- /plugin install awesome-statusline
- ```
- Then run `/statusline-setup`, or pass a preset directly: `/statusline-setup large-plain`.
- </details>
- ---
- <a id="presets"></a>
- ## 🎨 The 15 presets
- Each size in its three styles: emoji, no emoji (`-plain`) and simple text (`-simple`). Shown on Pro / Max; for Ultra, see [Plan](#plans).
- <a id="xsmall"></a>
- ### xsmall (`xs`) · 2 lines
- Model · effort · folder · branch, and three small bars. The simple-text style fits on one line.
- <div align="center">
- <img src="assets/presets/xsmall.png" alt="xsmall: emoji style" width="820"/>
- <img src="assets/presets/xsmall-plain.png" alt="xsmall-plain: no emoji" width="820"/>
- <img src="assets/presets/xsmall-simple.png" alt="xsmall-simple: simple text" width="820"/>
- </div>
- <a id="small"></a>
- ### small (`s`) · 2 lines
- Adds the full path, git changes, output style and time to reset.
- <div align="center">
- <img src="assets/presets/small.png" alt="small: emoji style" width="820"/>
- <img src="assets/presets/small-plain.png" alt="small-plain: no emoji" width="820"/>
- <img src="assets/presets/small-simple.png" alt="small-simple: simple text" width="820"/>
- </div>
- <a id="medium"></a>
- ### medium (`m`) · 4 lines
- Adds a wide context bar with the token count, and commits ahead.
- <div align="center">
- <img src="assets/presets/medium.png" alt="medium: emoji style" width="820"/>
- <img src="assets/presets/medium-plain.png" alt="medium-plain: no emoji" width="820"/>
- <img src="assets/presets/medium-simple.png" alt="medium-simple: simple text" width="820"/>
- </div>
- <a id="large"></a>
- ### large (`l`) · 5 lines ⭐ recommended
- Adds the session time, and one line per limit with its reset time.
- <div align="center">
- <img src="assets/presets/large.png" alt="large: emoji style" width="820"/>
- <img src="assets/presets/large-plain.png" alt="large-plain: no emoji" width="820"/>
- <img src="assets/presets/large-simple.png" alt="large-simple: simple text" width="820"/>
- </div>
- <a id="xlarge"></a>
- ### xlarge (`xl`) · 6 lines
- Adds a prompt cache line with its misses, 40-block bars everywhere and full reset dates.
- <div align="center">
- <img src="assets/presets/xlarge.png" alt="xlarge: emoji style" width="820"/>
- <img src="assets/presets/xlarge-plain.png" alt="xlarge-plain: no emoji" width="820"/>
- <img src="assets/presets/xlarge-simple.png" alt="xlarge-simple: simple text" width="820"/>
- </div>
- ---
- <a id="plans"></a>
- ## 📊 Plan: automatic, Ultra included
- **Nothing to choose.** Each plan has different usage limits, Claude Code passes the statusline only the ones your plan has, and the statusline draws exactly those. All 15 presets work this way, and switching plans never needs a reinstall.
- | Plan | Limits Claude Code sends | What the statusline shows |
- |---|---|---|
- | **Pro · Max** | 5-hour + weekly | a `5H` bar and a `7D` bar, each with its reset time |
- | **Ultra** | weekly only (no 5-hour limit) | one `Weekly` bar, its reset time, and a **per-day budget** |
- The **per-day budget** (`≈22%/day`) is the weekly allowance you have left divided by the days until it resets: use about that much per day and you won't hit the limit before the reset. With less than a day to go it shows what's left instead, e.g. `9% left`.
- <div align="center">
- <img src="assets/presets/plans.png" alt="The same large preset: 5H + 7D on Pro / Max, one Weekly line with a per-day budget on Ultra" width="820"/>
- </div>
- ---
- <a id="mods"></a>
- ## 🧩 Mods (beta): also in the Claude desktop app
- The statusline is a `statusLine` command, and the Claude desktop app's Code tab doesn't run one. **Mods** draws the same lines in the band above the prompt instead, through a Claude Code mod (early access), and that band shows in the desktop app too.
- <div align="center">
- <img src="assets/presets/desktop.png" alt="The large preset drawn by the mod above the prompt in the Claude desktop app" width="820"/>
- </div>
- | | Statusline (default) | Mods (beta) |
- |---|---|---|
- | Where | under the prompt, in the terminal | in a band above the prompt: the terminal and the Claude desktop app |
- | Presets | all 15 | all 15 (the mod runs the same renderer) |
- | Runs on | macOS · Linux · Windows | macOS · Linux |
- | Needs | Claude Code | a Claude Code with mods (early access; tested on 2.1.316 and on 2.1.309, the one the desktop app ships) and its `claude` CLI |
- **Install**: pick "Mods" when the installer asks where it should show, tell your AI agent (`Install https://github.com/awesomezun/claude-statusline as a mod`), or add `--mods`:
- ```bash
- curl -fsSL https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.sh | bash -s -- large --mods
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 305 on GitHub
- ```
- Then start a new session, in the terminal or in the desktop app's Code tab.
- - The installer copies the mod to `~/.claude/awesome-statusline-mod/` and installs it with `claude plugin install` as `awesome-statusline-mod@awesome-statusline-local`. The preset is the mod's `preset` option.
- - It removes an Awesome Statusline `statusLine`, so the terminal doesn't show the lines twice. Any other statusLine is left alone; while one is set, the terminal keeps it and the band shows only in the desktop app. Change this with the `terminal` option (`auto` · `show` · `hide`) in `/plugin configure awesome-statusline-mod@awesome-statusline-local`.
- - Until your first message in a session, effort comes from your settings and the usage rows may read `loading..`; from the first reply on they show the session's real values.
- - The VS Code extension has no band above the prompt, so the mod doesn't show there.
- - **Back to the statusline**: reinstall without `--mods`. **Remove the mod**: `claude plugin uninstall awesome-statusline-mod@awesome-statusline-local`, then delete `~/.claude/awesome-statusline-mod/`.
- <a id="cockpit"></a>
- ### Cockpit pane (prototype)
- With the mod installed, **`/cockpit`** opens a pane beside the chat drawn like [1top](https://1top.si)'s menu bar, in a dark and a light theme:
- - **Cluster**: two dials (tokens per hour, and weekly limit used per hour), a status strip (working, waiting, done, sign-in, low limit), an odometer with a trip counter, and what is left of each limit as fuel gauges.
- - **Dashboard**: a radial token chart around the hour, the model mix, and account cards with use per hour and a day's trend.
- - **Below either**: sessions (ranked by weekly limit used), token flow, limits, usage map, heatmap, resources, and this session (context, where each limit ends up at the pace so far, the tools running now). There's also a *Compact now* button.
- - **Period** from 10 minutes to 24 hours. The view, theme, period and language are buttons at the top and stay as you left them.
- With the 1top app running on the same computer, the cockpit reads 1top's local read-only API and shows every AI it tracks: Claude Code, Codex and the rest. Without it, it shows this computer's resources and the Claude Code sessions running the mod. While the cockpit is open, the band above the prompt steps aside. To open it at the start of every session, set the mod's `cockpit` option to `auto`. The desktop app draws it as graphics, the terminal as text.
- <div align="center">
- <table>
- <tr><th>Cluster · dark</th><th>Dashboard · dark</th></tr>
- <tr><td><img src="assets/presets/cockpit-cluster-dark.png" alt="The cluster, dark: two dials, the status strip, the odometer and fuel gauges, with the sessions below" width="380"/></td><td><img src="assets/presets/cockpit-dashboard-dark.png" alt="The dashboard, dark: a radial token chart, the model mix and account cards, with the account limits below" width="380"/></td></tr>
- <tr><th>Cluster · light</th><th>Dashboard · light</th></tr>
- <tr><td><img src="assets/presets/cockpit-cluster-light.png" alt="The cluster, light: two dials, the status strip, the odometer and fuel gauges, with the token flow below" width="380"/></td><td><img src="assets/presets/cockpit-dashboard-light.png" alt="The dashboard, light: a radial token chart, the model mix and account cards, with the heatmap below" width="380"/></td></tr>
- </table>
- </div>
- ---
- <a id="fields"></a>
- ## 🔍 What it shows
- | Element | Meaning |
- |---------|---------|
- | 🤖 **Model** | Current model (`Fable 5.2`, `Opus 5.5`, …) |
- | 👤 **Account** | The signed-in claude.ai account's name and plan (`Alex · Max 5x`); small screens show the name only |
- | ⚡ **Effort** | Reasoning effort: `low` · `medium` · `high` · `xhigh` · `max`. Live with `/effort`; hidden on models without effort |
- | 💡 **Thinking** | Extended thinking is on |
- | 🎨 **Output style** | Active output style (hidden while it's `default`) |
- | 📂 🌿 **Folder · Git** | Folder, branch, commits ahead ↑ / behind ↓, staged `+` · modified `!` · untracked `?` files |
- | 🐍 **Env** | Active conda / virtualenv (only when one is active) |
- | 🧠 **Context** | Context-window usage bar and token count |
- | 💾 **Cache** | Share of input read from the prompt cache (green from 80%, yellow from 50%), until when it stays warm, and once it's cold what the next turn writes again. Shows after the first reply (Claude Code 2.1.251+) |
- | ⏰ **Time** | Session duration |
- | 🚀 **5H** · ⭐ **7D** | 5-hour and weekly limit usage with reset times (Pro · Max) |
- | ⭐ **Weekly** | Weekly limit usage, reset time and per-day budget (Ultra) |
- | 🎫 **Free reset** | You hold a free limit reset from claude.ai that you haven't used (see the [FAQ](#faq)) |
- The no-emoji and simple-text styles use text labels such as `Context`, `Usage 5H` and `time` in place of the icons. Colors follow the [Catppuccin](https://catppuccin.com/) palette, and every glyph is a standard emoji or Unicode block — no Nerd Font needed.
- ---
- <a id="change"></a>
- ## 🔧 Change preset or uninstall
- **Change**: give your AI agent this repo's URL and the preset you want, and it reinstalls (e.g. `Switch https://github.com/awesomezun/claude-statusline to medium-simple`). From a terminal, re-run the installer with the new preset:
- ```bash
- curl -fsSL https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.sh | bash -s -- medium-simple
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 371 on GitHub
- ```
- **Uninstall**: remove the `statusLine` entry from `~/.claude/settings.json` and delete `~/.claude/awesome-statusline.sh` (`awesome-statusline.ps1` on Windows). Every install also leaves a `settings.json.backup-<timestamp>` you can restore. Installed as a mod? See [Mods (beta)](#mods).
- ---
- <a id="requirements"></a>
- ## ✅ Requirements
- | | macOS · Linux | Windows |
- |---|---|---|
- | Runs on | Bash 3.2+ (built in) | PowerShell 5.1+ (built in) |
- | JSON parsing | `jq` (the installer adds it via brew / apt / dnf / pacman / zypper / apk if missing) | not needed |
- | Not needed | Node, Nerd Font | Node, Nerd Font, Git Bash, `jq` |
- On Windows the installer writes a native `awesome-statusline.ps1` and points Claude Code at `powershell -NoProfile …`, which avoids Git Bash, `.sh` file associations and `jq` PATH problems.
- ---
- <a id="faq"></a>
- ## 🙋 FAQ
- **Do I need to reinstall when I change plans?** No. The statusline follows the limits Claude Code reports, so it shows 5H + 7D on Pro · Max and Weekly on Ultra by itself.
- **The limit lines say `loading..`.** Usage data arrives after your first message in a session, so `loading..` shows until then. It only arrives when you're signed in with a claude.ai subscription (Pro · Max · Ultra); with an API key it stays at `loading..`. On Ultra, if it's still `loading..` after your first message, you have an old version — ask your AI agent to reinstall.
- **I'm on Ultra and see only one Weekly bar.** That's expected: Ultra has no 5-hour limit.
- **I don't see `⚡effort`.** Your current model doesn't support effort, so the field is hidden on purpose. Switch to a model that supports `/effort` (e.g. Opus 5.5).
- **What does `cache 92%` mean, and why does it say `cold`?** Claude Code caches the start of your conversation, so the next turn reads it back instead of processing it again: reads are cheaper and count less toward your limits. `92%` is the share of this session's input that came from the cache. The cache stays warm for a while after each turn (5 minutes or an hour); past that it's `cold`, and the next turn writes the whole conversation again, the size shown after `re-caches`. A `miss` is a turn that processed again what the cache already held; xlarge names the likely cause (a tool or the system prompt changed, idle past the TTL).
- **Does it show how many free limit resets I have?** It shows whether you have one, not how many. claude.ai hands out free limit resets now and then; you use them from Settings › Usage on the web or in the desktop app, not from Claude Code. The statusline JSON doesn't carry them; Claude Code notes in its `~/.claude.json` only whether your account holds an unused one, and the 🎫 mark reads that. The count is only behind your login, and the statusline never touches your credentials. Nothing is sent anywhere.
- **Can I hide my account name?** Yes. Add `"env": {"AWESOME_STATUSLINE_ACCOUNT": "off"}` to `~/.claude/settings.json`. The name and plan come from the login Claude Code keeps in `~/.claude.json` (your email is never shown). Sessions on an API key or a cloud provider don't show an account.
- **Can I turn the emoji off?** Yes. Add `-plain` to any size for the same layout without emoji (`large-plain`), or `-simple` for text with no bars (`large-simple`).
- **Does it work in the Claude desktop app?** With [Mods (beta)](#mods), yes. The desktop app's Code tab doesn't run `statusLine` commands, but it draws the mod's band above the prompt.
- **Does it slow Claude Code down?** No. It's a small local script that takes about 0.1 s per refresh.
- **Why emoji instead of Nerd Font icons?** So it looks right out of the box in any terminal, with no font setup. See how it looks in your font in the [12-font showcase](demo.md).
- **Where are my old settings?** Every install backs up `settings.json` to `settings.json.backup-<timestamp>` before changing it.
- **Bars look banded or yellow turns olive inside tmux.** Claude Code drops to 256 colours inside tmux. The statusline notices and draws 256-colour gradients instead; for the full gradient, set `"env": {"CLAUDE_CODE_TMUX_TRUECOLOR": "1"}` in `~/.claude/settings.json` (the installer does it when tmux supports 24-bit colour). Details: [TROUBLESHOOTING.md](TROUBLESHOOTING.md)
- **Characters stack vertically inside tmux.** Enable truecolor in `~/.tmux.conf` (`set -ga terminal-overrides ",xterm-256color:RGB"`) and reload tmux. Details: [TROUBLESHOOTING.md](TROUBLESHOOTING.md)
- **The statusline is blank, or blank terminal windows keep popping up (Windows).** Re-run `install.ps1`. It switches to the native PowerShell renderer and drops the Git Bash / `jq` dependency. Details: [TROUBLESHOOTING.md](TROUBLESHOOTING.md)
- ---
- <a id="changelog"></a>
- ## 🆕 Changelog
- Built to keep pace with Claude Code. Full notes for each release are on [Releases](https://github.com/awesomezun/claude-statusline/releases).
- | Date | Update |
- |------|--------|
- | **2026‑11‑09** | **v3.7.0** · **Fable 5.2** support (and the Mythos models, in the band and the cockpit) · **prompt cache** in every preset: hit ratio, warm until, and what a cold cache writes again; xlarge gets a cache line with misses and their likely cause · **free limit reset** mark when you hold an unused one · the signed-in **account** and its plan (`Alex · Max 5x`; `AWESOME_STATUSLINE_ACCOUNT=off` hides it) · the mod works the cache figures out from each request, so the desktop app shows them too · README with motion reels and a desktop & cockpit section up front |
- | **2026‑11‑02** | **v3.6.0** · **Mods (beta)** · install as a Claude Code mod with `--mods`: the same 15 presets in the band above the prompt, so it also shows in the Claude desktop app (macOS / Linux) · the installer asks where it should show · `/cockpit` pane (prototype): 1top-style cluster and dashboard, dark and light, with accounts, token flow, usage map and running sessions · README shows the 15 presets size by size |
- | **2026‑11‑01** | **v3.5.1** · three styles for every size (simple text `m-simple`, `l-simple`, `xl-simple` added) · installs ask size, then style · **clean gradients inside tmux** (when Claude Code drops to 256 colours the bars use 256-colour gradients, and the installer turns on `CLAUDE_CODE_TMUX_TRUECOLOR` when tmux supports 24-bit colour) · fixed the first bar cell darkening on light themes with minimum contrast (VS Code, Orca) · README reorganized around "two choices (size, style) + one automatic (plan)" |
- | **2026‑10‑31** | **Ultra plan support + redesign** · Ultra has no 5-hour limit, so it gets a weekly bar with a per-day budget (the bars used to freeze at `0% (loading..)`) · every size redesigned (aligned columns, fixed-width %, resets shown as *in 2h10m · 01:50*, empty fields hidden) · no-emoji style (`-plain`) · text presets `simple` and `oneline` · one renderer for every preset, ~4× faster per refresh |
- | **2026‑10‑17** | **Windows on non-English locales** · no more `Unknown` / 0% when Claude Code sends non-ASCII text (e.g. a Korean session name) · context gauge guards against stale window-size reports |
- | **2026‑06‑03** | **Install size picker** · installing through Claude Code always asks for a size (`large` recommended) |
- | **2026‑06‑02** | **Windows native renderer** · PowerShell statusline, no Git Bash or `jq` needed on Windows |
- | **2026‑05‑31** | **Opus 4.8** support · reasoning **effort** (`high`/`xhigh`/`max`) and **thinking** indicators · one-line cross-platform installer · 5 sizes (`xs`–`xl`) · JetBrains Mono |
- | **2026‑04‑01** | **1M-token context window** support (Opus) · usage bars render before the first chat |
- | **2026‑01‑19** | Multi-mode display system · plugin marketplace |
- | **2026‑01‑18** | Catppuccin gradient bars · live **5h / 7d** usage-limit monitoring |
- ---
- <div align="center">
- Built with 🩵 for the Claude Code community · [Catppuccin](https://catppuccin.com/) theme · MIT License
- <sub>Awesome Statusline is an independent community project, not affiliated with or endorsed by Anthropic. Claude and Claude Code are trademarks of Anthropic, PBC.</sub>
- ⭐ **Star it if it made your terminal nicer.**
- <a href="https://www.star-history.com/?repos=AwesomeJun%2FCC-statusline&type=date&legend=top-left">
- <picture>
- <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=AwesomeJun/CC-statusline&type=date&theme=dark&legend=top-left&sealed_token=ntTNhwQ951y6lOVznUbvdeYGCi23yOBbRnadWt5pMTIRfdp6L3KPB1Dwy65vNWI7CIY4R1MzU6yloqyfkwmlEbMoguscV-kFRG5PCqCVyP4_G4XgShBDtg" />
- <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=AwesomeJun/CC-statusline&type=date&legend=top-left&sealed_token=ntTNhwQ951y6lOVznUbvdeYGCi23yOBbRnadWt5pMTIRfdp6L3KPB1Dwy65vNWI7CIY4R1MzU6yloqyfkwmlEbMoguscV-kFRG5PCqCVyP4_G4XgShBDtg" />
- <img alt="Star History Chart" src="https://api.star-history.com/chart?repos=AwesomeJun/CC-statusline&type=date&legend=top-left&sealed_token=ntTNhwQ951y6lOVznUbvdeYGCi23yOBbRnadWt5pMTIRfdp6L3KPB1Dwy65vNWI7CIY4R1MzU6yloqyfkwmlEbMoguscV-kFRG5PCqCVyP4_G4XgShBDtg" />
- </picture>
- </a>
- </div>
- <br/>
- <!-- gitreels:start -->
- <p align="center">
- <img src="assets/reel.gif" alt="Awesome Statusline — 30-second motion reel" width="820">
- <br>
- <a href="https://gitreels.com"><img src="https://gitreels.com/badge.svg" alt="Made with GitReels" height="24"></a>
- <a href="https://gitreels.com/awesomezun/claude-statusline"><img src="https://gitreels.com/api/badges/rotw/awesomezun/claude-statusline.svg" alt="Reel of the Week #2 on GitReels" height="24"></a>
- </p>
- <!-- gitreels:end -->
docs/build.py · Bundled script · 248 lines · 2 findings marked
- #!/usr/bin/env python3
- """Generate docs/index.html from the REAL statusline output.
- Runs the renderer (scripts/awesome-statusline.sh) for every preset against a
- representative mock session (see docs/_demo.py), captures the truecolor ANSI
- it prints, and converts that to HTML — so gradients and exact colors match the
- terminal pixel-for-pixel instead of being hand-approximated.
- Each element with an id is captured to assets/presets/<id>.png
- (by docs/shoot.py):
- #hero large, the recommended preset
- #<preset> one card per preset, 15 in all: each of the five sizes in
- emoji, -plain and -simple (Pro / Max), e.g. #large-plain
- #plans automatic - the same preset on Pro / Max and on Ultra
- """
- import sys
- sys.dont_write_bytecode = True # keep docs/ free of __pycache__ from the import below
- import html as H
- import pathlib
- import re
- sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))
- from _demo import ROOT, ansi_to_html, render # noqa: E402
- SIZES = [ # (preset, abbr, lines)
- ("xsmall", "xs", "2 lines"),
- ("small", "s", "2 lines"),
- ("medium", "m", "4 lines"),
- ("large", "l", "5 lines"),
- ("xlarge", "xl", "6 lines"),
- ]
- ABBR = {name: abbr for name, abbr, _ in SIZES}
- def rows(preset: str, plan: str = "pro") -> str:
- raw = render(preset, plan).rstrip("\n")
- return "".join(f'<div class="row">{ansi_to_html(ln)}</div>' for ln in raw.split("\n"))
- def card(title, sub, badge, body_html, tag="") -> str:
- tag_html = f'<span class="tag">{H.escape(tag)}</span>' if tag else ""
- return f'''
- <div class="card">
- <div class="card-head"><div class="name">{title} <span class="abbr">({sub})</span>{tag_html}</div><div class="lines">{badge}</div></div>
- <div class="term">
- <div class="term-bar"><span class="dot r"></span><span class="dot y"></span><span class="dot g"></span></div>
- <div class="term-body">{body_html}</div>
- </div>
- </div>'''
- def cards(items) -> str:
- return "\n".join(card(*it) for it in items)
- HERO = cards([("large", "l", "recommended", rows("large"))])
- STYLES = [ # (suffix, label)
- ("", "emoji"),
- ("-plain", "no emoji"),
- ("-simple", "simple text"),
- ]
- SIZE_NOTE = {
- "xsmall": "model · effort · folder · branch, three small bars",
- "small": "+ full path, git changes, output style, time to reset",
- "medium": "+ wide context bar with token count, commits ahead",
- "large": "+ session time, one line per limit with its reset time",
- "xlarge": "+ a prompt cache line, 40-block bars everywhere, full reset dates",
- }
- def line_count(preset: str) -> str:
- n = len(render(preset).rstrip("\n").split("\n"))
- return f"{n} line" + ("" if n == 1 else "s")
- def preset_card(name: str, abbr: str, suffix: str, label: str) -> str:
- preset = name + suffix
- badge = f"{label} · {line_count(preset)}" + (" · recommended" if preset == "large" else "")
- return f'<div class="pc" id="{preset}">{card(preset, abbr + suffix, badge, rows(preset))}</div>'
- SIZE_SECTIONS = "\n".join(f'''
- <div class="size-sec" id="size-{name}">
- <div class="section-title">{name} <span class="abbr">({abbr})</span></div>
- <p class="note">{SIZE_NOTE[name]}</p>
- <div class="grid">{"".join(preset_card(name, abbr, suffix, label) for suffix, label in STYLES)}
- </div>
- </div>''' for name, abbr, _ in SIZES)
- PLAN_CARDS = cards([
- ("large", "on Pro / Max", "5-hour + weekly limits", rows("large", "pro")),
- ("large", "on Ultra", "weekly limit only", rows("large", "ultra")),
- ])
- HTML = f'''<!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Awesome Statusline — for Claude Code</title>
- <link rel="preconnect" href="https://fonts.googleapis.com">
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
- <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap" rel="stylesheet">
- <style>__CSS__</style>
- </head>
- <body>
- <div class="wrap">
- <div class="hero">
- <h1><span class="spark">⚡</span> Awesome Statusline</h1>
- <p class="tag">A beautiful statusline for Claude Code — <b>context</b>, <b>usage limits</b> & reasoning <b style="color:var(--peach)">⚡effort</b>, all at a glance. One line to install on macOS, Linux & Windows.</p>
- <div class="badges">
- <span class="badge hot">⚡ effort · 💡 thinking</span>
- <span class="badge cool">macOS · Linux · Windows</span>
- <span class="badge">5 sizes × 3 styles</span>
- <span class="badge">Pro · Max · Ultra, automatic</span>
- <span class="badge">Catppuccin</span>
- </div>
- </div>
- <div id="hero">
- <div class="grid">{HERO}
- </div>
- </div>
- <div class="section-title">Two choices · one automatic</div>
- <div class="axes">
- <div class="axis"><div class="k">1 · Size</div><div class="v">xs · s · m · l · xl</div><p>How much you see. You pick it.</p></div>
- <div class="axis"><div class="k">2 · Style</div><div class="v">emoji · -plain · -simple</div><p>How it looks. You pick it.</p></div>
- <div class="axis auto"><div class="k">3 · Plan</div><div class="v">Pro / Max · Ultra</div><p>Which limits show. Automatic.</p></div>
- </div>
- <p class="note">Size + style = a preset: 5 × 3 = 15, e.g. <code>large</code>, <code>l-plain</code>, <code>m-simple</code>.</p>
- <div class="section-title">15 presets · 5 sizes × 3 styles</div>
- <p class="note">Every size in the three styles, on Pro / Max.</p>
- {SIZE_SECTIONS}
- <div id="plans">
- <div class="section-title">Automatic · Plan — nothing to choose</div>
- <div class="grid">{PLAN_CARDS}
- </div>
- <p class="note">Every preset follows the limits Claude Code reports: Ultra has no 5-hour limit, so it gets one weekly line with a per-day budget.</p>
- </div>
- <div class="section-title">Why this one</div>
- <div class="why">
- <div class="item"><h3>⚡ <span>Effort & thinking</span></h3><p>Surfaces <b style="color:var(--peach)">/effort</b> (high · xhigh · max) and <b style="color:var(--yellow)">extended thinking</b> — live, from Claude Code's official JSON.</p></div>
- <div class="item"><h3>📊 <span>Every plan, every window</span></h3><p>Pro and Max get 5-hour + weekly bars; Ultra (weekly only) gets a weekly bar with a per-day budget. Each limit is read on its own.</p></div>
- <div class="item"><h3>🖥️ <span>Truly cross-platform</span></h3><p>Bash on macOS and Linux, a native PowerShell renderer on Windows — no Git Bash or <code>jq</code> needed there.</p></div>
- <div class="item"><h3>📐 <span>5 sizes × 3 styles</span></h3><p>Pick how much you see with one word — <code>xs</code> to <code>xl</code> — then add <code>-plain</code> (no emoji) or <code>-simple</code> (text only) if you like. The plan is detected for you.</p></div>
- </div>
- <div class="section-title">Install</div>
- <div class="install"><span class="c"># macOS / Linux</span>
- curl -fsSL https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.sh | bash
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 153 on GitHub
- <span class="c"># Windows (PowerShell)</span>
- irm https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.ps1 | iex
- Note: Runs a downloaded PowerShell script (iex / Invoke-Expression)
- Line 156 on GitHub
- </div>
- <footer>Built with 🩵 for the Claude Code community · <b>Catppuccin</b> theme · MIT License</footer>
- </div>
- </body>
- </html>
- '''.replace("__CSS__", """
- :root{
- --base:#1e1e2e; --mantle:#181825; --crust:#11111b; --s0:#313244; --s1:#45475a;
- --text:#cdd6f4; --sub:#a6adc8; --over:#6c7086; --teal:#94e2d5; --peach:#fab387;
- --yellow:#f9e2af; --mauve:#cba6f7;
- }
- *{box-sizing:border-box;margin:0;padding:0}
- body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
- background:radial-gradient(1200px 600px at 50% -10%, #25253a 0%, var(--mantle) 55%, var(--crust) 100%);
- color:var(--text);line-height:1.6;padding:64px 24px;min-height:100vh}
- .wrap{max-width:1000px;margin:0 auto}
- .hero{text-align:center;margin-bottom:52px}
- .hero h1{font-size:54px;font-weight:800;letter-spacing:-1.5px;margin-bottom:14px}
- .hero h1 .spark{color:var(--peach)}
- .hero p.tag{font-size:19px;color:var(--sub);max-width:680px;margin:0 auto 22px}
- .hero p.tag b{color:var(--text)}
- .badges{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-top:18px}
- .badge{font-size:12.5px;padding:5px 11px;border-radius:999px;background:var(--s0);color:var(--sub);border:1px solid var(--s1)}
- .badge.hot{background:rgba(250,179,135,.14);color:var(--peach);border-color:rgba(250,179,135,.3)}
- .badge.cool{background:rgba(148,226,213,.12);color:var(--teal);border-color:rgba(148,226,213,.28)}
- .section-title{font-size:14px;text-transform:uppercase;letter-spacing:2px;color:var(--over);text-align:center;margin:48px 0 22px}
- .grid{display:flex;flex-direction:column;gap:22px}
- .card{background:var(--mantle);border:1px solid var(--s0);border-radius:16px;overflow:hidden;box-shadow:0 18px 50px -20px rgba(0,0,0,.7)}
- .card-head{display:flex;align-items:center;justify-content:space-between;padding:12px 18px;border-bottom:1px solid var(--s0)}
- .card-head .name{font-weight:700;font-size:15px}
- .card-head .name .abbr{color:var(--over);font-weight:500}
- .card-head .lines{font-size:12px;color:var(--over);background:var(--s0);padding:3px 9px;border-radius:999px}
- .term{background:var(--base)}
- .term-bar{display:flex;gap:7px;padding:11px 14px;border-bottom:1px solid rgba(255,255,255,.04)}
- .dot{width:11px;height:11px;border-radius:50%}
- .dot.r{background:#f38ba8}.dot.y{background:#f9e2af}.dot.g{background:#a6e3a1}
- .term-body{font-family:"JetBrains Mono",Menlo,Consolas,monospace,"Apple Color Emoji","Noto Color Emoji";
- font-size:13.5px;line-height:1.42;padding:12px 18px;white-space:pre;overflow-x:auto}
- .term-body .row{display:block}
- .cg{display:inline-block;width:1ch;height:1.02em;vertical-align:-.12em;
- background-color:currentColor;background-repeat:repeat;background-position:0 0;
- image-rendering:pixelated}
- .cg-full{background-color:currentColor}
- .cg-shade-light{background-color:currentColor;
- -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2' viewBox='0 0 2 2'%3E%3Crect width='1' height='1' fill='black'/%3E%3C/svg%3E");
- mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2' viewBox='0 0 2 2'%3E%3Crect width='1' height='1' fill='black'/%3E%3C/svg%3E");
- -webkit-mask-size:2px 2px;mask-size:2px 2px;
- -webkit-mask-repeat:repeat;mask-repeat:repeat}
- .cg-shade-medium{background-color:currentColor;
- -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2' viewBox='0 0 2 2'%3E%3Crect width='1' height='1' fill='black'/%3E%3Crect x='1' y='1' width='1' height='1' fill='black'/%3E%3C/svg%3E");
- mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2' viewBox='0 0 2 2'%3E%3Crect width='1' height='1' fill='black'/%3E%3Crect x='1' y='1' width='1' height='1' fill='black'/%3E%3C/svg%3E");
- -webkit-mask-size:2px 2px;mask-size:2px 2px;
- -webkit-mask-repeat:repeat;mask-repeat:repeat}
- .cg-shade-dark{background-color:currentColor;
- -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2' viewBox='0 0 2 2'%3E%3Crect width='2' height='1' fill='black'/%3E%3Crect y='1' width='1' height='1' fill='black'/%3E%3C/svg%3E");
- mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2' viewBox='0 0 2 2'%3E%3Crect width='2' height='1' fill='black'/%3E%3Crect y='1' width='1' height='1' fill='black'/%3E%3C/svg%3E");
- -webkit-mask-size:2px 2px;mask-size:2px 2px;
- -webkit-mask-repeat:repeat;mask-repeat:repeat}
- .why{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;margin-top:8px}
- @media(max-width:680px){.why{grid-template-columns:1fr}.hero h1{font-size:40px}}
- .why .item{background:var(--mantle);border:1px solid var(--s0);border-radius:14px;padding:18px 20px}
- .why .item h3{font-size:15px;margin-bottom:6px;display:flex;align-items:center;gap:8px}
- .why .item p{font-size:13.5px;color:var(--sub)}
- .install{background:var(--crust);border:1px solid var(--s0);border-radius:14px;padding:18px 20px;margin-top:10px;font-family:"JetBrains Mono",monospace;font-size:13px;color:#a6e3a1;overflow-x:auto}
- .install .c{color:var(--over)}
- footer{text-align:center;color:var(--over);font-size:13px;margin-top:60px}
- footer b{color:var(--mauve)}
- #hero,#plans,.size-sec{padding:28px 0 18px}
- #plans .section-title,.size-sec .section-title{margin-top:0}
- .size-sec .section-title{font-family:"JetBrains Mono",monospace;margin-bottom:4px}
- .size-sec .section-title .abbr{color:var(--over)}
- .size-sec .note{margin:0 0 14px}
- .size-sec .grid{gap:0}
- .pc{padding:10px 0 28px}
- .axes{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
- @media(max-width:680px){.axes{grid-template-columns:1fr}}
- .axis{background:var(--mantle);border:1px solid var(--s0);border-radius:14px;padding:16px 18px}
- .axis .k{font-size:12px;text-transform:uppercase;letter-spacing:1.5px;color:var(--over)}
- .axis .v{font-family:"JetBrains Mono",monospace;font-size:15px;color:var(--text);margin:6px 0 4px}
- .axis p{font-size:13.5px;color:var(--sub)}
- .axis.auto{border-style:dashed}
- .axis.auto .v{color:var(--teal)}
- .card-head .tag{font-size:12px;color:var(--peach);margin-left:8px;font-weight:500}
- .note{text-align:center;color:var(--sub);font-size:13.5px;margin-top:14px}
- .note code{font-family:"JetBrains Mono",monospace;color:var(--peach)}
- """)
- (ROOT / "docs" / "index.html").write_text(HTML, encoding="utf-8")
- print("wrote docs/index.html")
- print("--- large (text) ---")
- print(re.sub(r"\x1b\[[0-9;]*m", "", render("large")))
install.ps1 · Bundled script · 273 lines · 3 findings marked
- #Requires -Version 5
- <#
- .SYNOPSIS
- Awesome CC Statusline installer for Windows (PowerShell).
- .DESCRIPTION
- 1. Copies the native Windows PowerShell renderer to ~/.claude/awesome-statusline.ps1.
- 2. Patches settings.json -> statusLine (existing settings preserved + backup).
- 3. Uses Claude Code's official statusLine.command contract: JSON on stdin,
- rendered status text on stdout.
- Sizes: xsmall (xs) | small (s) | medium (m) | large (l) | xlarge (xl).
- Styles: emoji (default) | -plain (no emoji) | -simple (text only, no bars).
- Aliases: simple = small-simple, oneline = xsmall-simple.
- .EXAMPLE
- ./install.ps1 # install (asks size and style)
- ./install.ps1 l # by abbreviation
- ./install.ps1 large-plain # by full name, without emoji
- ./install.ps1 m-simple # text-only style
- #>
- # ============================================================================
- # HOW TO INSTALL — rules for the AI assistant running this.
- # A user may ask the assistant to install from the GitHub URL without cloning
- # the repo, so CLAUDE.md / the plugin command are NOT in context. These rules
- # are duplicated here (the one file the assistant always reads) and MUST stay
- # identical to CLAUDE.md and commands/statusline-setup.md in this repo.
- #
- # 1. You MUST resolve a preset before installing. Never install without an
- # explicit choice by the user. "Auto" / auto-accept mode is NOT an
- # exception — the user is present and can answer; ask anyway.
- # Recommending `large` (below) is only a hint shown inside the menu; it must
- # NEVER become a silent default or let you skip the question. Always ask.
- #
- # 2. If the user already named a preset — a size (xs/s/m/l/xl or full name),
- # optionally with -plain or -simple, or the aliases simple (= small-simple)
- # / oneline (= xsmall-simple) — use it and skip Questions A and B. A bare
- # size means the emoji style unless the user asked for no emoji or text
- # only. If they also said where it should show (statusline; or mods / the
- # desktop app), skip Question C too; on Windows always skip it (Statusline).
- # Otherwise ask Question C alone.
- #
- # 3. Otherwise ASK with the AskUserQuestion tool. Match the user's language.
- # Step 1 — ONE AskUserQuestion call with THREE questions (on Windows TWO:
- # leave out Question C — Mods is macOS / Linux only for now):
- # Question A (size) — text (use exactly this, on one line):
- # EN: Which size would you like to install? (examples on GitHub: https://github.com/awesomezun/claude-statusline)
- # KO: 어떤 크기로 설치할까요? (예시는 GitHub에서 확인: https://github.com/awesomezun/claude-statusline)
- # Four options, in EXACTLY this order (do NOT reorder). The recommended
- # option is ALWAYS large (option 1) — never substitute anything else:
- # 1. large (l) (추천 / Recommended) — most info, good for most users / 추천 기본값
- # 2. xlarge (xl) — largest, full detail / 가장 크게, 전체 상세
- # 3. medium (m) — balanced layout / 균형 잡힌 레이아웃
- # 4. small / xsmall — the two smallest, pick this to choose between them
- # / 작은 두 가지 (고르면 한 번 더 선택)
- # Question B (style) — text:
- # EN: Which style would you like?
- # KO: 어떤 스타일로 할까요?
- # Three options, in this order:
- # 1. With emoji (Recommended) / 이모지 있음 (추천) — icons + gradient bars
- # 2. No emoji / 이모지 없음 — same layout and bars, text labels instead of icons
- # 3. Simple text / 심플 텍스트형 — text only, no bars or emoji
- # Question C (display) — text:
- # EN: Where should it show?
- # KO: 어디에 표시할까요?
- # Two options, in this order:
- # 1. Statusline (Recommended) / 상태줄 (추천) — the status line under the prompt, in the terminal
- # / 터미널 프롬프트 아래 상태줄
- # 2. Mods (beta) / Mods (베타) — the same preset in a band above the prompt, also shown in the
- # Claude desktop app / 프롬프트 위 띠로 표시, Claude 데스크톱 앱에서도 보임
- # Step 2 — ONLY if the user picked option 4 in Question A, ask again:
- # EN: Which of the two smaller sizes? KO: 작은 쪽 중 무엇으로 설치할까요?
- # 1. small (s) — space-saving, key info / 공간 절약, 주요 정보
- # 2. xsmall (xs) — smallest, essentials only / 가장 작게, 핵심만
- # Resolve the preset: the size, plus -plain for "No emoji" or -simple for
- # "Simple text" (e.g. large-plain, xsmall-simple), and the display:
- # --mods for "Mods", nothing for "Statusline".
- # If the user gives nothing / "recommended" / "default", use large (Statusline).
- #
- # 4. Then install with the resolved preset:
- # macOS / Linux: bash install.sh <preset> (or: bash install.sh <preset> --mods)
- # Windows PowerShell: ./install.ps1 <preset>
- #
- # 5. If "auto" mode blocks the install (it downloads code that runs on every
- # launch — declining to auto-approve that is correct), do NOT just stop:
- # still resolve the preset, then have the user run it themselves so it proceeds:
- # macOS / Linux: ! bash install.sh <preset> (add --mods for Mods)
- # Windows: ! irm https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.ps1 | iex
- Note: Runs a downloaded PowerShell script (iex / Invoke-Expression)
- Line 89 on GitHub
- # or have them leave auto mode (shift+tab) for the one install step.
- #
- # 6. Only a truly headless one-shot run (claude -p / hook / cron, no way to get
- # a reply) may default to large — and you must say that you did.
- # ============================================================================
- param([string]$Size)
- $ErrorActionPreference = 'Stop'
- try {
- [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
- } catch {}
- function Write-Info($m) { Write-Host $m -ForegroundColor Cyan }
- function Write-Ok($m) { Write-Host $m -ForegroundColor Green }
- function Write-Err($m) { Write-Host $m -ForegroundColor Red }
- # abbreviation OR full name (optionally with -plain / -simple) -> canonical preset, or $null
- function Normalize-Mode([string]$s) {
- $s = $s.Trim().ToLowerInvariant()
- $style = ''
- if ($s.EndsWith('-plain')) { $style = '-plain'; $s = $s.Substring(0, $s.Length - 6) }
- elseif ($s.EndsWith('-simple')) { $style = '-simple'; $s = $s.Substring(0, $s.Length - 7) }
- switch ($s) {
- { $_ -in 'xs', 'xsmall' } { return "xsmall$style" }
- { $_ -in 's', 'small' } { return "small$style" }
- { $_ -in 'm', 'medium' } { return "medium$style" }
- { $_ -in 'l', 'large' } { return "large$style" }
- { $_ -in 'xl', 'xlarge' } { return "xlarge$style" }
- 'simple' { return 'small-simple' } # alias
- { $_ -in 'oneline', 'one-line', '1line' } { return 'xsmall-simple' } # alias
- }
- return $null
- }
- # --- paths ------------------------------------------------------------------
- $ClaudeDir = if ($env:CLAUDE_CONFIG_DIR) { $env:CLAUDE_CONFIG_DIR } else { Join-Path $HOME '.claude' }
- $Settings = Join-Path $ClaudeDir 'settings.json'
- $Dest = Join-Path $ClaudeDir 'awesome-statusline.ps1'
- $ScriptPath = $MyInvocation.MyCommand.Path
- $ScriptDir = if ($ScriptPath) { Split-Path -Parent $ScriptPath } else { (Get-Location).Path }
- $SrcDir = Join-Path $ScriptDir 'scripts'
- $RepoRaw = if ($env:AWESOME_STATUSLINE_RAW) { $env:AWESOME_STATUSLINE_RAW } else { 'https://raw.githubusercontent.com/awesomezun/claude-statusline/main' }
- # --- pick preset ------------------------------------------------------------
- # Precedence: explicit argument > interactive prompt > 'large' default.
- # When no preset is given and a real console is attached, ask (default large).
- # In non-interactive contexts (e.g. `irm ... | iex`, CI) we never block — the
- Note: Runs a downloaded PowerShell script (iex / Invoke-Expression)
- Line 137 on GitHub
- # console read throws and we fall straight through to 'large'.
- $Mode = 'large'
- if ($Size) {
- $Mode = Normalize-Mode $Size
- if (-not $Mode) {
- Write-Err "Unknown preset: '$Size'"
- Write-Err "Valid: xsmall|xs small|s medium|m large|l xlarge|xl - each optionally -plain or -simple (aliases: simple, oneline)"
- exit 1
- }
- } elseif ([Environment]::UserInteractive) {
- # Korean UI culture? Show the prompt in Korean; otherwise default to English.
- $isKo = ([Globalization.CultureInfo]::CurrentUICulture.TwoLetterISOLanguageName -eq 'ko')
- Write-Host ""
- if ($isKo) {
- Write-Host "statusline을 어떤 크기로 설치할까요? (예시는 github에서 확인)"
- Write-Host " 예시: https://github.com/awesomezun/claude-statusline"
- Write-Host ""
- Write-Host " 1. xsmall (xs) 가장 작게 — 2줄, 핵심만"
- Write-Host " 2. small (s) 작게 — 2줄, 라벨과 막대"
- Write-Host " 3. medium (m) 중간 — 4줄, 넓은 컨텍스트 막대"
- Write-Host " 4. large (l) 크게 — 5줄, 세션 시간·리셋 (추천 기본값)"
- Write-Host " 5. xlarge (xl) 가장 크게 — 6줄, 전체 상세"
- Write-Host ""
- Write-Host -NoNewline "선택 [기본값: 4]: "
- } else {
- Write-Host "Which size would you like to install? (see examples on GitHub)"
- Write-Host " Examples: https://github.com/awesomezun/claude-statusline"
- Write-Host ""
- Write-Host " 1. xsmall (xs) smallest — 2 lines, essentials"
- Write-Host " 2. small (s) small — 2 lines, labels + bars"
- Write-Host " 3. medium (m) medium — 4 lines, wide context bar"
- Write-Host " 4. large (l) large — 5 lines, session time / resets (recommended)"
- Write-Host " 5. xlarge (xl) largest — 6 lines, full detail"
- Write-Host ""
- Write-Host -NoNewline "Choice [default: 4]: "
- }
- # Under `irm ... | iex` the downloaded script occupies the pipeline, so a plain
- Note: Runs a downloaded PowerShell script (iex / Invoke-Expression)
- Line 174 on GitHub
- # Read-Host can be skipped (the PowerShell analog of the bash `curl | bash`
- # stdin problem fixed via /dev/tty). Read from the console host directly; if no
- # real console is attached (CI, non-interactive host) ReadLine throws and we
- # fall through to the 'large' default instead of blocking.
- $interactive = $true
- $answer = ''
- try { $answer = $Host.UI.ReadLine() } catch { $answer = ''; $interactive = $false }
- $answer = "$answer".Trim()
- switch ($answer) {
- '1' { $Mode = 'xsmall' }
- '2' { $Mode = 'small' }
- '3' { $Mode = 'medium' }
- '4' { $Mode = 'large' }
- '' { $Mode = 'large' }
- '5' { $Mode = 'xlarge' }
- default {
- # Allow typing a preset name/alias directly instead of a number.
- $Mode = Normalize-Mode $answer
- if (-not $Mode) {
- if ($isKo) { Write-Host "알 수 없는 입력 '$answer' — 'large'로 설치합니다." }
- else { Write-Host "Unknown input '$answer', using 'large'." }
- $Mode = 'large'
- }
- }
- }
- # A typed name may already carry its style (l-plain, m-simple, simple, ...).
- if ($interactive -and -not ($Mode.EndsWith('-plain') -or $Mode.EndsWith('-simple'))) {
- Write-Host ""
- if ($isKo) {
- Write-Host "어떤 스타일로 할까요?"
- Write-Host " 1. 이모지 있음 — 아이콘과 그래디언트 막대 (기본값)"
- Write-Host " 2. 이모지 없음 — 같은 배치, 아이콘 대신 글자"
- Write-Host " 3. 심플 텍스트형 — 막대·이모지 없이 글자만"
- Write-Host -NoNewline "선택 [기본값: 1]: "
- } else {
- Write-Host "Which style?"
- Write-Host " 1. With emoji — icons and gradient bars (default)"
- Write-Host " 2. No emoji — same layout, text labels instead of icons"
- Write-Host " 3. Simple text — text only, no bars or emoji"
- Write-Host -NoNewline "Choice [default: 1]: "
- }
- $st = ''
- try { $st = "$($Host.UI.ReadLine())".Trim() } catch { $st = '' }
- if ($st -eq '2') { $Mode = "$Mode-plain" }
- elseif ($st -eq '3') { $Mode = "$Mode-simple" }
- }
- }
- # --- install the script -----------------------------------------------------
- New-Item -ItemType Directory -Force -Path $ClaudeDir | Out-Null
- $Src = Join-Path $SrcDir 'awesome-statusline-windows.ps1'
- if (Test-Path $Src) {
- Copy-Item $Src $Dest -Force
- } else {
- Write-Info "Local scripts/ not found, downloading Windows renderer from repo..."
- Invoke-WebRequest -Uri "$RepoRaw/scripts/awesome-statusline-windows.ps1" -OutFile $Dest
- }
- # Force UTF-8 *with* BOM. The renderer body contains non-ASCII glyphs
- # (progress-bar blocks U+2588/U+2591, emoji). Windows PowerShell 5.1 does not
- # auto-detect UTF-8: with no BOM it reads .ps1 files using the system ANSI code
- # page (e.g. CP949 on Korean systems), corrupting those bytes into garbage
- # tokens that break the parser and leave the status line blank. Writing the BOM
- # explicitly guarantees correct parsing on every host (PS 5.1 and 7+).
- $scriptText = [System.IO.File]::ReadAllText($Dest, [System.Text.UTF8Encoding]::new($false))
- $utf8Bom = [System.Text.UTF8Encoding]::new($true)
- [System.IO.File]::WriteAllText($Dest, $scriptText, $utf8Bom)
- # --- patch settings.json ----------------------------------------------------
- $CommandPath = $Dest.Replace('\', '/')
- $Command = "powershell -NoProfile -ExecutionPolicy Bypass -File `"$CommandPath`" -Size $Mode"
- $slObj = [pscustomobject]@{ type = 'command'; command = $Command }
- if (Test-Path $Settings) {
- $backup = "$Settings.backup-" + (Get-Date -Format 'yyyyMMdd-HHmmss')
- Copy-Item $Settings $backup -Force
- # -Encoding UTF8: PS 5.1 would otherwise read settings.json with the ANSI code
- # page and fail on any non-ASCII text already in it.
- $json = Get-Content $Settings -Raw -Encoding UTF8 | ConvertFrom-Json
- if ($json.PSObject.Properties.Name -contains 'statusLine') {
- $json.statusLine = $slObj
- } else {
- $json | Add-Member -NotePropertyName 'statusLine' -NotePropertyValue $slObj
- }
- $json | ConvertTo-Json -Depth 20 | Set-Content $Settings -Encoding UTF8
- Write-Info "Existing settings backed up to: $backup"
- } else {
- [pscustomobject]@{ statusLine = $slObj } | ConvertTo-Json -Depth 20 | Set-Content $Settings -Encoding UTF8
- }
- Write-Ok "Installed Awesome CC Statusline (preset: $Mode)"
- Write-Host " script: $Dest"
- Write-Host " settings: $Settings (statusLine set)"
- Write-Host " command: $Command"
- Write-Host ""
- Write-Host "Restart Claude Code to see it."
- Write-Host "To switch preset later, just ask your AI agent to reinstall with the one you want."
- Write-Host ""
- Write-Host "Star this repo if you find it useful - it really helps:"
- Write-Host " https://github.com/awesomezun/claude-statusline"
install.sh · Bundled script · 463 lines · 1 finding marked
- #!/usr/bin/env bash
- # ============================================================================
- # Awesome CC Statusline — installer (macOS / Linux / Windows-GitBash)
- # ----------------------------------------------------------------------------
- # Usage:
- # ./install.sh # install (asks which preset)
- # ./install.sh l # install by abbreviation
- # ./install.sh large-plain # install by full name, without emoji
- # ./install.sh m-simple # text-only style
- # ./install.sh large --mods # Mods (beta): a band above the prompt that also
- # # shows in the Claude desktop app
- #
- # Sizes (smallest -> largest):
- # xsmall (xs) 2 lines, minimal (xs-simple: 1 line)
- # small (s) 2 lines, labels + bars
- # medium (m) 4 lines, wide context bar
- # large (l) 5 lines, session time / resets (recommended)
- # xlarge (xl) 6 lines, 40-block bars, full detail
- # Styles (suffix):
- # (none) emoji icons + gradient bars
- # -plain same layout, no emoji (e.g. l-plain)
- # -simple text only, no bars, no emoji (e.g. l-simple)
- # aliases: simple = small-simple, oneline = xsmall-simple
- #
- # What it does:
- # 1. ensures `jq` is installed (auto-installs via the system package manager)
- # 2. copies the renderer to ~/.claude/awesome-statusline.sh
- # 3. sets settings.json -> statusLine.command (existing settings preserved,
- # a timestamped backup is made first)
- # With --mods (beta, macOS / Linux), instead of 3:
- # 3. copies the mod to ~/.claude/awesome-statusline-mod/ and installs it with
- # `claude plugin install` (the preset is the mod's `preset` option)
- # 4. removes an Awesome Statusline statusLine entry (backup first), so the
- # terminal doesn't show it twice
- #
- # Honors $CLAUDE_CONFIG_DIR (defaults to ~/.claude) so it is safe to test.
- # ============================================================================
- #
- # ============================================================================
- # HOW TO INSTALL — rules for the AI assistant running this.
- # A user may ask the assistant to install from the GitHub URL without cloning
- # the repo, so CLAUDE.md / the plugin command are NOT in context. These rules
- # are duplicated here (the one file the assistant always reads) and MUST stay
- # identical to CLAUDE.md and commands/statusline-setup.md in this repo.
- #
- # 1. You MUST resolve a preset before installing. Never install without an
- # explicit choice by the user. "Auto" / auto-accept mode is NOT an
- # exception — the user is present and can answer; ask anyway.
- # Recommending `large` (below) is only a hint shown inside the menu; it must
- # NEVER become a silent default or let you skip the question. Always ask.
- #
- # 2. If the user already named a preset — a size (xs/s/m/l/xl or full name),
- # optionally with -plain or -simple, or the aliases simple (= small-simple)
- # / oneline (= xsmall-simple) — use it and skip Questions A and B. A bare
- # size means the emoji style unless the user asked for no emoji or text
- # only. If they also said where it should show (statusline; or mods / the
- # desktop app), skip Question C too; on Windows always skip it (Statusline).
- # Otherwise ask Question C alone.
- #
- # 3. Otherwise ASK with the AskUserQuestion tool. Match the user's language.
- # Step 1 — ONE AskUserQuestion call with THREE questions (on Windows TWO:
- # leave out Question C — Mods is macOS / Linux only for now):
- # Question A (size) — text (use exactly this, on one line):
- # EN: Which size would you like to install? (examples on GitHub: https://github.com/awesomezun/claude-statusline)
- # KO: 어떤 크기로 설치할까요? (예시는 GitHub에서 확인: https://github.com/awesomezun/claude-statusline)
- # Four options, in EXACTLY this order (do NOT reorder). The recommended
- # option is ALWAYS large (option 1) — never substitute anything else:
- # 1. large (l) (추천 / Recommended) — most info, good for most users / 추천 기본값
- # 2. xlarge (xl) — largest, full detail / 가장 크게, 전체 상세
- # 3. medium (m) — balanced layout / 균형 잡힌 레이아웃
- # 4. small / xsmall — the two smallest, pick this to choose between them
- # / 작은 두 가지 (고르면 한 번 더 선택)
- # Question B (style) — text:
- # EN: Which style would you like?
- # KO: 어떤 스타일로 할까요?
- # Three options, in this order:
- # 1. With emoji (Recommended) / 이모지 있음 (추천) — icons + gradient bars
- # 2. No emoji / 이모지 없음 — same layout and bars, text labels instead of icons
- # 3. Simple text / 심플 텍스트형 — text only, no bars or emoji
- # Question C (display) — text:
- # EN: Where should it show?
- # KO: 어디에 표시할까요?
- # Two options, in this order:
- # 1. Statusline (Recommended) / 상태줄 (추천) — the status line under the prompt, in the terminal
- # / 터미널 프롬프트 아래 상태줄
- # 2. Mods (beta) / Mods (베타) — the same preset in a band above the prompt, also shown in the
- # Claude desktop app / 프롬프트 위 띠로 표시, Claude 데스크톱 앱에서도 보임
- # Step 2 — ONLY if the user picked option 4 in Question A, ask again:
- # EN: Which of the two smaller sizes? KO: 작은 쪽 중 무엇으로 설치할까요?
- # 1. small (s) — space-saving, key info / 공간 절약, 주요 정보
- # 2. xsmall (xs) — smallest, essentials only / 가장 작게, 핵심만
- # Resolve the preset: the size, plus -plain for "No emoji" or -simple for
- # "Simple text" (e.g. large-plain, xsmall-simple), and the display:
- # --mods for "Mods", nothing for "Statusline".
- # If the user gives nothing / "recommended" / "default", use large (Statusline).
- #
- # 4. Then install with the resolved preset:
- # macOS / Linux: bash install.sh <preset> (or: bash install.sh <preset> --mods)
- # Windows PowerShell: ./install.ps1 <preset>
- #
- # 5. If "auto" mode blocks the install (it downloads code that runs on every
- # launch — declining to auto-approve that is correct), do NOT just stop:
- # still resolve the preset, then have the user run it themselves so it proceeds:
- # macOS / Linux: ! bash install.sh <preset> (add --mods for Mods)
- # Windows: ! irm https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.ps1 | iex
- Note: Runs a downloaded PowerShell script (iex / Invoke-Expression)
- Line 105 on GitHub
- # or have them leave auto mode (shift+tab) for the one install step.
- #
- # 6. Only a truly headless one-shot run (claude -p / hook / cron, no way to get
- # a reply) may default to large — and you must say that you did.
- # ============================================================================
- set -euo pipefail
- # --- paths ------------------------------------------------------------------
- CLAUDE_DIR="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
- SETTINGS="$CLAUDE_DIR/settings.json"
- DEST="$CLAUDE_DIR/awesome-statusline.sh"
- # Resolve script dir safely. Under `curl ... | bash` the script arrives on
- # stdin, so BASH_SOURCE is unset — with `set -u` that would crash here. Fall
- # back to an empty SCRIPT_DIR, which routes us to the repo-download branch.
- if [ -n "${BASH_SOURCE:-}" ]; then
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
- else
- SCRIPT_DIR=""
- fi
- SRC="$SCRIPT_DIR/scripts/awesome-statusline.sh"
- REPO_RAW="${AWESOME_STATUSLINE_RAW:-https://raw.githubusercontent.com/awesomezun/claude-statusline/main}"
- MOD_NAME="awesome-statusline-mod"
- MOD_DIR="$CLAUDE_DIR/$MOD_NAME"
- # The mod's files, relative to mods/awesome-statusline-mod/ in the repo.
- MOD_FILES=".claude-plugin/plugin.json .claude-plugin/marketplace.json hooks/hooks.json hooks/register.tsx hooks/ansi.ts hooks/cockpit.tsx hooks/gauges.ts hooks/dash.ts hooks/cluster.ts hooks/sources.ts types/index.d.ts"
- # --- output helpers ---------------------------------------------------------
- err() { printf '\033[31m%s\033[0m\n' "$*" >&2; }
- ok() { printf '\033[32m%s\033[0m\n' "$*"; }
- info() { printf '\033[36m%s\033[0m\n' "$*"; }
- # map abbreviation OR full name (optionally with -plain / -simple) -> canonical preset
- normalize_mode() {
- local s style=""
- s="$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')"
- case "$s" in
- *-plain) style="-plain"; s="${s%-plain}" ;;
- *-simple) style="-simple"; s="${s%-simple}" ;;
- esac
- case "$s" in
- xs|xsmall) echo "xsmall$style" ;;
- s|small) echo "small$style" ;;
- m|medium) echo "medium$style" ;;
- l|large) echo "large$style" ;;
- xl|xlarge) echo "xlarge$style" ;;
- simple) echo "small-simple" ;; # alias
- oneline|one-line|1line) echo "xsmall-simple" ;; # alias
- *) return 1 ;;
- esac
- }
- # --- dependency: jq (auto-install) ------------------------------------------
- install_jq() {
- info "jq not found — attempting automatic install…"
- if command -v brew >/dev/null 2>&1; then brew install jq
- elif command -v apt-get >/dev/null 2>&1; then sudo apt-get update && sudo apt-get install -y jq
- elif command -v dnf >/dev/null 2>&1; then sudo dnf install -y jq
- elif command -v yum >/dev/null 2>&1; then sudo yum install -y jq
- elif command -v pacman >/dev/null 2>&1; then sudo pacman -S --noconfirm jq
- elif command -v zypper >/dev/null 2>&1; then sudo zypper install -y jq
- elif command -v apk >/dev/null 2>&1; then sudo apk add jq
- elif command -v winget >/dev/null 2>&1; then winget install --silent --accept-package-agreements --accept-source-agreements jqlang.jq
- elif command -v scoop >/dev/null 2>&1; then scoop install jq
- elif command -v choco >/dev/null 2>&1; then choco install jq -y
- else
- err "No supported package manager found. Please install jq manually:"
- err " https://jqlang.github.io/jq/download/"
- return 1
- fi
- }
- ensure_jq() {
- if ! command -v jq >/dev/null 2>&1; then
- install_jq || exit 1
- command -v jq >/dev/null 2>&1 || { err "jq install did not succeed."; exit 1; }
- ok "jq installed."
- fi
- }
- # --- pick preset ------------------------------------------------------------
- # Precedence: explicit argument > interactive prompt > 'large' default.
- MODE="large"
- # Korean locale? Show the prompt in Korean; otherwise default to English.
- is_korean_locale() {
- case "${LC_ALL:-${LC_MESSAGES:-${LANG:-}}}" in
- ko|ko_*|ko.*|ko-*) return 0 ;;
- *) return 1 ;;
- esac
- }
- # Ask the user which size and style to install (default large, emoji). Reads stdin.
- prompt_size() {
- echo
- if is_korean_locale; then
- echo "statusline을 어떤 크기로 설치할까요? (예시는 github에서 확인)"
- echo " 예시: https://github.com/awesomezun/claude-statusline"
- echo
- echo " 1. xsmall (xs) 가장 작게 — 2줄, 핵심만"
- echo " 2. small (s) 작게 — 2줄, 라벨과 막대"
- echo " 3. medium (m) 중간 — 4줄, 넓은 컨텍스트 막대"
- echo " 4. large (l) 크게 — 5줄, 세션 시간·리셋 (추천 기본값)"
- echo " 5. xlarge (xl) 가장 크게 — 6줄, 전체 상세"
- echo
- printf '선택 [기본값: 4]: '
- else
- echo "Which size would you like to install? (see examples on GitHub)"
- echo " Examples: https://github.com/awesomezun/claude-statusline"
- echo
- echo " 1. xsmall (xs) smallest — 2 lines, essentials"
- echo " 2. small (s) small — 2 lines, labels + bars"
- echo " 3. medium (m) medium — 4 lines, wide context bar"
- echo " 4. large (l) large — 5 lines, session time / resets (recommended)"
- echo " 5. xlarge (xl) largest — 6 lines, full detail"
- echo
- printf 'Choice [default: 4]: '
- fi
- local answer=""
- read -r answer || answer=""
- case "$answer" in
- 1) MODE="xsmall" ;;
- 2) MODE="small" ;;
- 3) MODE="medium" ;;
- 4|"") MODE="large" ;;
- 5) MODE="xlarge" ;;
- *)
- # Allow typing a preset name/alias directly instead of a number.
- if ! MODE="$(normalize_mode "$answer")"; then
- if is_korean_locale; then
- echo "알 수 없는 입력 '$answer' — 'large'로 설치합니다."
- else
- echo "Unknown input '$answer', using 'large'."
- fi
- MODE="large"
- fi
- ;;
- esac
- # A typed name may already carry its style (l-plain, m-simple, simple, …).
- case "$MODE" in *-plain|*-simple) return ;; esac
- echo
- if is_korean_locale; then
- echo "어떤 스타일로 할까요?"
- echo " 1. 이모지 있음 — 아이콘과 그래디언트 막대 (기본값)"
- echo " 2. 이모지 없음 — 같은 배치, 아이콘 대신 글자"
- echo " 3. 심플 텍스트형 — 막대·이모지 없이 글자만"
- printf '선택 [기본값: 1]: '
- else
- echo "Which style?"
- echo " 1. With emoji — icons and gradient bars (default)"
- echo " 2. No emoji — same layout, text labels instead of icons"
- echo " 3. Simple text — text only, no bars or emoji"
- printf 'Choice [default: 1]: '
- fi
- local style=""
- read -r style || style=""
- case "$style" in
- 2) MODE="$MODE-plain" ;;
- 3) MODE="$MODE-simple" ;;
- esac
- }
- # Ask where it should show (default Statusline). Reads stdin.
- prompt_display() {
- echo
- if is_korean_locale; then
- echo "어디에 표시할까요?"
- echo " 1. 상태줄 — 터미널 프롬프트 아래 (기본값)"
- echo " 2. Mods (베타) — 프롬프트 위 띠, Claude 데스크톱 앱에서도 보임"
- printf '선택 [기본값: 1]: '
- else
- echo "Where should it show?"
- echo " 1. Statusline — under the prompt, in the terminal (default)"
- echo " 2. Mods (beta) — a band above the prompt, also in the Claude desktop app"
- printf 'Choice [default: 1]: '
- fi
- local answer=""
- read -r answer || answer=""
- case "$answer" in
- 2|m|mods|--mods) DISPLAY_MODE="mods" ;;
- esac
- }
- # Where it shows: statusline (default) or mods (--mods).
- DISPLAY_MODE="statusline"
- PRESET_ARG=""
- DISPLAY_ARG=""
- for arg in "$@"; do
- case "$arg" in
- --mods|mods) DISPLAY_MODE="mods"; DISPLAY_ARG=1 ;;
- --statusline|statusline) DISPLAY_MODE="statusline"; DISPLAY_ARG=1 ;;
- *)
- if [ -n "$PRESET_ARG" ]; then err "Unexpected argument: '$arg'"; exit 1; fi
- PRESET_ARG="$arg" ;;
- esac
- done
- ask() {
- if [ -z "$PRESET_ARG" ]; then prompt_size; fi
- if [ -z "$DISPLAY_ARG" ]; then prompt_display; fi
- }
- if [ -n "$PRESET_ARG" ] && ! MODE="$(normalize_mode "$PRESET_ARG")"; then
- err "Unknown preset: '$PRESET_ARG'"
- err "Valid: xsmall|xs small|s medium|m large|l xlarge|xl — each optionally -plain or -simple (aliases: simple, oneline)"
- exit 1
- fi
- if [ -n "$PRESET_ARG" ] && [ -n "$DISPLAY_ARG" ]; then
- : # everything given: never prompt
- elif [ -n "$PRESET_ARG" ]; then
- : # a preset alone keeps the old one-argument behaviour: Statusline
- elif [ -t 0 ]; then
- # Normal `./install.sh` / `bash install.sh` — stdin is the terminal.
- ask
- elif { exec 3</dev/tty; } 2>/dev/null; then
- # Piped install (`curl ... | bash`): the script body is on stdin, but a
- # controlling terminal still exists — prompt through /dev/tty.
- ask <&3
- exec 3<&-
- fi
- # Truly non-interactive (CI, Claude Code, redirected stdin with no tty): no
- # branch prompts, so MODE stays 'large' (Statusline) and the install never blocks.
- if [ "$DISPLAY_MODE" = "mods" ]; then
- case "$(uname -s 2>/dev/null)" in
- MINGW*|MSYS*|CYGWIN*)
- err "Mods is macOS / Linux only for now. On Windows install the statusline: ./install.ps1 $MODE"
- exit 1 ;;
- esac
- fi
- # --- run --------------------------------------------------------------------
- ensure_jq
- mkdir -p "$CLAUDE_DIR"
- if [ -n "$SCRIPT_DIR" ] && [ -f "$SRC" ]; then
- cp "$SRC" "$DEST"
- else
- info "Local scripts/ not found, downloading the renderer from repo…"
- curl -fsSL "$REPO_RAW/scripts/awesome-statusline.sh" -o "$DEST" \
- || { err "Download failed. Check network or \$AWESOME_STATUSLINE_RAW."; exit 1; }
- fi
- chmod +x "$DEST"
- # --- Mods (beta): the same renderer, drawn by a Claude Code mod ----------------
- # Finds the claude CLI: PATH first, then where its installers put it.
- find_claude() {
- if command -v claude >/dev/null 2>&1; then command -v claude; return 0; fi
- local c
- for c in "$HOME/.local/bin/claude" "$HOME/.claude/local/claude" /opt/homebrew/bin/claude /usr/local/bin/claude; do
- if [ -x "$c" ]; then echo "$c"; return 0; fi
- done
- return 1
- }
- install_mods() {
- local claude_bin staged f terminal_opt
- if ! claude_bin="$(find_claude)"; then
- err "Mods needs the claude CLI (Claude Code) on this machine, and it was not found."
- err "Install Claude Code (https://claude.com/claude-code), or use the statusline: bash install.sh $MODE"
- exit 1
- fi
- # Stage the mod and swap it in whole, so a failed download leaves the old one.
- staged="$MOD_DIR.new"
- rm -rf "$staged"
- for f in $MOD_FILES; do
- mkdir -p "$staged/$(dirname "$f")"
- if [ -n "$SCRIPT_DIR" ] && [ -f "$SCRIPT_DIR/mods/$MOD_NAME/$f" ]; then
- cp "$SCRIPT_DIR/mods/$MOD_NAME/$f" "$staged/$f"
- else
- curl -fsSL "$REPO_RAW/mods/$MOD_NAME/$f" -o "$staged/$f" \
- || { err "Download failed: mods/$MOD_NAME/$f"; rm -rf "$staged"; exit 1; }
- fi
- done
- # The renderer travels with the mod, so the mod runs the version it was made for.
- cp "$DEST" "$staged/awesome-statusline.sh"
- rm -rf "$MOD_DIR"
- mv "$staged" "$MOD_DIR"
- # Keep a `terminal` option the person already set; default auto.
- terminal_opt="auto"
- if [ -f "$SETTINGS" ]; then
- terminal_opt="$(jq -r --arg k "$MOD_NAME@awesome-statusline-local" '.pluginConfigs[$k].options.terminal // "auto"' "$SETTINGS" 2>/dev/null || echo auto)"
- fi
- # Installing again only updates the options: the mod is read from $MOD_DIR in place.
- "$claude_bin" plugin install "$MOD_NAME" --marketplace "$MOD_DIR" \
- --config "preset=$MODE" --config "terminal=$terminal_opt" \
- || { err "claude plugin install failed. Run it yourself to see why:"; \
- err " claude plugin install $MOD_NAME --marketplace $MOD_DIR --config preset=$MODE"; exit 1; }
- # An Awesome Statusline statusLine would show the same lines a second time in
- # the terminal: remove it (backup first). Any other statusLine is left alone;
- # the band then stays hidden in the terminal while it is set (option `terminal`).
- if [ -f "$SETTINGS" ] && jq -e '(.statusLine.command // "") | test("awesome-statusline")' "$SETTINGS" >/dev/null 2>&1; then
- BACKUP="$SETTINGS.backup-$(date +%Y%m%d-%H%M%S)"
- cp "$SETTINGS" "$BACKUP"
- jq 'del(.statusLine)' "$SETTINGS" > "$SETTINGS.tmp" && mv "$SETTINGS.tmp" "$SETTINGS"
- info "Removed the Awesome Statusline statusLine (the mod shows it now). Backup: $BACKUP"
- elif [ -f "$SETTINGS" ] && jq -e '(.statusLine.command // "") != ""' "$SETTINGS" >/dev/null 2>&1; then
- info "Another statusLine is set: the terminal keeps it and the band shows in the desktop app."
- info " To show the band in the terminal too: /plugin configure $MOD_NAME@awesome-statusline-local (terminal: show)"
- fi
- }
- # Invoke via `bash <script>` (not the bare path) so the statusline runs
- # identically on every platform. On Windows a bare `.sh` path is opened through
- # its file association (`bash --login -i ...`), which spawns visible terminal
- # windows and breaks stdin/stdout — calling bash explicitly avoids that.
- STATUSLINE_JSON="$(jq -n --arg c "bash ~/.claude/awesome-statusline.sh $MODE" '{type:"command",command:$c}')"
- if [ "$DISPLAY_MODE" = "mods" ]; then
- install_mods
- elif [ -f "$SETTINGS" ]; then
- BACKUP="$SETTINGS.backup-$(date +%Y%m%d-%H%M%S)"
- cp "$SETTINGS" "$BACKUP"
- jq --argjson sl "$STATUSLINE_JSON" '.statusLine = $sl' "$SETTINGS" > "$SETTINGS.tmp" \
- && mv "$SETTINGS.tmp" "$SETTINGS"
- info "Existing settings backed up to: $BACKUP"
- else
- jq -n --argjson sl "$STATUSLINE_JSON" '{statusLine: $sl}' > "$SETTINGS"
- fi
- # --- tmux: keep 24-bit colour ------------------------------------------------
- # Inside tmux, Claude Code downgrades every colour to 256 unless
- # CLAUDE_CODE_TMUX_TRUECOLOR is set, which turns the gradient bars into uneven
- # bands. If this tmux passes 24-bit colour (RGB) through, switch it on (it takes
- # effect in new Claude Code sessions); otherwise the statusline falls back to
- # its own 256-colour palette and we print how to enable RGB in tmux.
- if [ -n "${TMUX:-}" ] && command -v tmux >/dev/null 2>&1; then
- if tmux display -p '#{client_termfeatures}' 2>/dev/null | grep -q 'RGB'; then
- jq '.env = ((.env // {}) + {"CLAUDE_CODE_TMUX_TRUECOLOR": "1"})' "$SETTINGS" > "$SETTINGS.tmp" \
- && mv "$SETTINGS.tmp" "$SETTINGS"
- info "tmux with 24-bit colour detected: set env.CLAUDE_CODE_TMUX_TRUECOLOR=1 so gradients stay smooth."
- else
- info "tmux without 24-bit colour detected: the statusline uses its 256-colour palette."
- info " For smooth gradients add to ~/.tmux.conf: set -as terminal-features ',xterm*:RGB'"
- fi
- fi
- if [ "$DISPLAY_MODE" = "mods" ]; then
- ok "Installed Awesome Statusline as a mod (preset: $MODE)"
- echo " mod: $MOD_DIR"
- echo " plugin: $MOD_NAME@awesome-statusline-local (user scope)"
- echo
- echo "Start a new Claude Code session (terminal, or the desktop app's Code tab):"
- echo "the band shows above the prompt."
- else
- ok "Installed Awesome CC Statusline (preset: $MODE)"
- echo " script: $DEST"
- echo " settings: $SETTINGS (statusLine set)"
- echo
- echo "Restart Claude Code (or reload) to see it."
- fi
- echo "To switch preset later, just ask your AI agent to reinstall with the one you want."
- echo
- echo "⭐ If you like Awesome Statusline, a GitHub star really helps:"
- echo " https://github.com/awesomezun/claude-statusline"
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.