webup-statusline

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Status Line Generator

状态栏生成工具

Generate a custom Claude Code status line script with your choice of columns and a color theme. Installs directly to
~/.claude/settings.json
.
生成符合你所选列和配色主题的自定义Claude Code状态栏脚本,可直接安装至
~/.claude/settings.json

How It Works

工作原理

Claude Code supports custom status lines via a shell script configured in
~/.claude/settings.json
. The script receives session JSON on stdin (model, context window, workspace, vim, worktree, etc.) and prints formatted text to stdout.
This skill generates a bash script tailored to your preferences and installs it automatically.
Claude Code通过配置在
~/.claude/settings.json
中的Shell脚本支持自定义状态栏。该脚本从标准输入接收会话JSON(包含model、上下文窗口、工作区、vim、工作树等信息),并将格式化后的文本输出到标准输出。
本技能会根据你的偏好生成定制化的Bash脚本,并自动完成安装。

Script Directory

脚本目录

Important: All scripts are located in the
scripts/
subdirectory of this skill.
Agent Execution Instructions:
  1. Determine this SKILL.md file's directory path as
    SKILL_DIR
  2. Script path =
    ${SKILL_DIR}/scripts/<script-name>.mjs
  3. Replace all
    ${SKILL_DIR}
    in this document with the actual path
Script Reference:
ScriptPurpose
scripts/generate.mjs
Generate and install status line script from chosen options
重要提示:所有脚本都位于本技能的
scripts/
子目录下。
Agent执行说明:
  1. 确定本SKILL.md文件的目录路径为
    SKILL_DIR
  2. 脚本路径 =
    ${SKILL_DIR}/scripts/<script-name>.mjs
  3. 将本文档中所有
    ${SKILL_DIR}
    替换为实际路径
脚本参考:
脚本用途
scripts/generate.mjs
根据所选选项生成并安装状态栏脚本

Prerequisites

前置依赖

  • jq — required by the generated status line script to parse JSON input from Claude Code
  • Bun — required to run the generator. Use
    npx -y bun
    if not installed globally.
  • jq — 生成的状态栏脚本需要它来解析Claude Code传入的JSON输入
  • Bun — 运行生成器的必要工具。若未全局安装,可使用
    npx -y bun

Usage

使用方法

bash
undefined
bash
undefined

Preview generated script

预览生成的脚本

npx -y bun ${SKILL_DIR}/scripts/generate.mjs --elements model,context,effort,git,dir --theme gruvbox
npx -y bun ${SKILL_DIR}/scripts/generate.mjs --elements model,context,effort,git,dir --theme gruvbox

Generate and install

生成并安装

npx -y bun ${SKILL_DIR}/scripts/generate.mjs --elements model,context,effort,git,dir --theme dracula --install
undefined
npx -y bun ${SKILL_DIR}/scripts/generate.mjs --elements model,context,effort,git,dir --theme dracula --install
undefined

Options

选项

FlagDefaultDescription
--elements <list>
model,context,cost,effort,style,git,dir
Comma-separated columns to display
--theme <name>
gruvbox
Color theme — see table below
--effort-icon <preset>
arrow
(
) for iconic themes, none otherwise
Override the effort prefix icon. Presets:
arrow
,
bolt
,
flash
,
reason
,
dot
,
none
. A raw character is also accepted.
--install
offWrite script to
~/.claude/scripts/statusline.sh
and update
settings.json
标志默认值描述
--elements <list>
model,context,cost,effort,style,git,dir
要显示的列,以逗号分隔
--theme <name>
gruvbox
配色主题 — 见下方表格
--effort-icon <preset>
图标主题默认使用
arrow
(
),其他主题默认无
覆盖effort前缀图标。预设值:
arrow
bolt
flash
reason
dot
none
。也可直接传入任意字符。
--install
关闭将脚本写入
~/.claude/scripts/statusline.sh
并更新
settings.json

Columns

列说明

ColumnDescriptionData source
model
Active model name (e.g. "Opus 4.7")
model.display_name
context
Progress bar + percentage — color changes with remaining capacity
context_window.remaining_percentage
cost
Session API spend formatted as
$X.XX
in gold — hidden when rounds to
$0.00
cost.total_cost_usd
from input JSON
effort
Reasoning effort level — color changes with level
effortLevel
in
~/.claude/settings.local.json
~/.claude/settings.json
style
Output style name (e.g. Explanatory, Learning) — hidden when "default"
output_style.name
from input JSON
git
Git branch name (yellow when dirty)
worktree.branch
→ git CLI
dir
Repo basename (original repo when in a worktree)
worktree.original_repo_dir
workspace.current_dir
worktree
Bold
worktree:<id>
label (hidden outside a worktree)
worktree.name
→ parent-dir basename via git CLI
vim
Vim mode indicator (hidden when inactive)
vim.mode
描述数据来源
model
当前激活的模型名称(例如 "Opus 4.7")
model.display_name
context
进度条 + 百分比 — 颜色随剩余容量变化
context_window.remaining_percentage
cost
会话API花费,格式为
$X.XX
(金色显示)— 当金额四舍五入为
$0.00
时隐藏
输入JSON中的
cost.total_cost_usd
effort
推理努力等级 — 颜色随等级变化
~/.claude/settings.local.json
~/.claude/settings.json
中的
effortLevel
style
输出样式名称(例如 Explanatory、Learning)— 为"default"时隐藏输入JSON中的
output_style.name
git
Git分支名称(分支有改动时显示为黄色)
worktree.branch
→ Git命令行工具
dir
仓库基础名称(处于工作树中时显示原始仓库名称)
worktree.original_repo_dir
workspace.current_dir
worktree
加粗的
worktree:<id>
标签(非工作树环境下隐藏)
worktree.name
→ 通过Git命令行工具获取父目录基础名称
vim
Vim模式指示器(未激活时隐藏)
vim.mode

Color-changing elements

颜色动态变化元素

context
— bar fill + percentage color scale with remaining capacity:
RemainingColorMeaning
> 50%greenplenty of context
20–50%yellowwatch out
< 20%rednearly full — compact soon
effort
— value + optional prefix icon color by level:
LevelColor
max
,
xhigh
,
high
bold red
medium
yellow
low
,
xlow
,
minimal
green
other / unsetdim (or hidden when completely unset)
context
— 进度条填充色 + 百分比颜色随剩余容量分级:
剩余容量颜色含义
> 50%绿色上下文空间充足
20–50%黄色需要注意
< 20%红色即将耗尽 — 需尽快精简内容
effort
— 值 + 可选前缀图标颜色随等级变化:
等级颜色
max
,
xhigh
,
high
加粗红色
medium
黄色
low
,
xlow
,
minimal
绿色
其他/未设置暗淡色(完全未设置时隐藏)

Themes

主题说明

ThemeVibeIcons rendered in bar
gruvbox
Warm retro, muted
model ·
effort ·
style ·
dir ·
worktree ·
git ·
vim
dracula
Modern dark, high saturation
model ·
effort ·
style ·
dir ·
worktree ·
git ·
vim
robbyrussell
Classic oh-my-zshno prefix icons — colors + labels only
minimal
Default terminal colorsno prefix icons — plain text
The
context
column intentionally skips a prefix icon — the colored progress bar is already visually rich. The
effort
prefix (
) is baked into iconic themes and can be overridden with
--effort-icon
.
主题风格状态栏中的图标
gruvbox
温暖复古、色调柔和
model ·
effort ·
style ·
dir ·
worktree ·
git ·
vim
dracula
现代深色、高饱和度
model ·
effort ·
style ·
dir ·
worktree ·
git ·
vim
robbyrussell
经典oh-my-zsh风格无前缀图标 — 仅显示颜色和标签
minimal
默认终端配色无前缀图标 — 纯文本显示
context
列刻意省略前缀图标 — 彩色进度条已经具备足够的视觉辨识度。
effort
的前缀图标(
)内置在图标主题中,可通过
--effort-icon
参数覆盖。

Effort icons

Effort图标

Pass
--effort-icon <preset>
to swap the glyph in front of the effort value. Presets:
PresetGlyphNotes
arrow
Electric arrow — default, narrow
bolt
ϟ
Greek koppa — narrow lightning
flash
Classic lightning — wide in emoji-presentation fonts
reason
Therefore
dot
Filled circle
none
(hidden)Drop the icon entirely
You can also pass any raw character as
--effort-icon <char>
.
Worktree behavior: When inside a git worktree (detected via the input JSON's
worktree.*
fields or via
git rev-parse --git-common-dir
fallback), the
worktree
column shows a bold
worktree:<id>
label using the parent dir name (e.g.
~/.codex/worktrees/46a6/clawmaster
worktree:46a6
). The
git
column prefers
worktree.branch
from the input JSON; the
dir
column prefers
worktree.original_repo_dir
so the repo identity stays stable across worktrees.
传入
--effort-icon <preset>
参数可替换effort值前的符号。预设值:
预设符号说明
arrow
电光箭头 — 默认值,占用空间小
bolt
ϟ
希腊字母Koppa — 窄版闪电符号
flash
经典闪电符号 — 在表情字体中显示较宽
reason
所以符号
dot
实心圆
none
(隐藏)完全移除图标
你也可以直接传入任意字符作为
--effort-icon <char>
参数。
工作树行为:当处于Git工作树中时(通过输入JSON的
worktree.*
字段检测,或通过
git rev-parse --git-common-dir
作为备选检测方式),
worktree
列会显示加粗的
worktree:<id>
标签(使用父目录名称,例如
~/.codex/worktrees/46a6/clawmaster
worktree:46a6
)。
git
列优先使用输入JSON中的
worktree.branch
dir
列优先使用
worktree.original_repo_dir
,确保在不同工作树中仓库标识保持一致。

Invocation

调用方式

This skill can be invoked with or without arguments:
  • No args (
    /webup-statusline
    ): Interactive prompt via
    AskUserQuestion
    to pick columns and theme.
  • With args (
    /webup-statusline dracula
    ): NLP parse for theme and column preferences.
本技能可带参数或不带参数调用:
  • 无参数 (
    /webup-statusline
    ):通过
    AskUserQuestion
    弹出交互式提示,选择列和主题。
  • 带参数 (
    /webup-statusline dracula
    ):通过自然语言解析提取主题和列偏好。

Arg parsing (natural language)

参数解析(自然语言)

The args string is free-form text. Use NLP to extract:
  1. theme — match against: gruvbox, robbyrussell, minimal, dracula. Recognize aliases (暗黑=dracula, 极简=minimal, 复古=gruvbox, レトロ=gruvbox).
  2. elements — look for mentions of: model, context/进度/コンテキスト, effort/推理强度/努力度, git/分支/ブランチ, dir/目录/ディレクトリ, worktree/工作树/ワークツリー, vim.
Unspecified fields use defaults:
model,context,effort,git,dir
columns,
gruvbox
theme.
参数字符串为自由格式文本。需通过自然语言提取以下信息:
  1. theme — 匹配以下主题:gruvbox、robbyrussell、minimal、dracula。支持别名(暗黑=dracula, 极简=minimal, 复古=gruvbox, レトロ=gruvbox)。
  2. elements — 识别以下提及内容:model、context/进度/コンテキスト、effort/推理强度/努力度、git/分支/ブランチ、dir/目录/ディレクトリ、worktree/工作树/ワークツリー、vim。
未指定的字段使用默认值:列默认
model,context,effort,git,dir
,主题默认
gruvbox

Workflow

工作流程

  1. If no args provided: Use
    AskUserQuestion
    to ask 2 questions in a single prompt.
    AskUserQuestion
    caps each question at 4 options, so offer curated presets for columns rather than an exhaustive toggle list. If the user picks "Other", interpret their free text as a comma-separated column list (or a natural-language description that maps to one).
    Q1 — Column preset (single): Which columns to display? Offer these 3 curated presets —
    AskUserQuestion
    will auto-append an "Other" option that lets the user type a free-text column list or description.
    • "Everything (Recommended)" —
      model,context,cost,effort,style,git,dir,worktree
      (all columns that have a useful signal today;
      vim
      is excluded because most users don't use vim keybindings)
    • "Default" —
      model,context,effort,style,git,dir
      (balanced — drops cost and worktree; matches the skill's default flag value)
    • "Essentials" —
      model,context,git,dir
      (lean; no effort, no style, no cost)
    If the user picks the auto-added "Other", treat their free text as a comma-separated column list, or as a natural-language description to map to columns. Fall back to
    Default
    if parsing is ambiguous.
    Q2 — Theme (single): Color theme?
    • "Dracula" — modern dark, purple/pink/cyan (Recommended)
    • "Gruvbox Dark" — warm retro palette, 24-bit true color
    • "Robbyrussell" — classic oh-my-zsh style, no icons
    • "Minimal" — no decoration, dim separators only
    If args provided: Parse theme and columns from args. Skip the prompt.
  2. Map user selections to script flags:
    • Column preset → expand to the preset's canonical
      --elements
      list:
      • Everything
        model,context,cost,effort,style,git,dir,worktree
      • Default
        model,context,effort,style,git,dir
      • Essentials
        model,context,git,dir
      • Other
        (auto-added by
        AskUserQuestion
        ) → parse the user's free text; keep only recognized column names (
        model,context,cost,effort,style,dir,worktree,git,vim
        ). If parsing is ambiguous, fall back to
        Default
        .
    • Theme →
      --theme
      value (one of
      gruvbox
      ,
      dracula
      ,
      robbyrussell
      ,
      minimal
      )
  3. Run the generator with
    --install
    :
    bash
    npx -y bun ${SKILL_DIR}/scripts/generate.mjs --elements <list> --theme <theme> --install
  4. Tell user to restart Claude Code to see the new status line.
  1. 无参数时:使用
    AskUserQuestion
    在一个提示中提出2个问题。
    AskUserQuestion
    每个问题最多支持4个选项,因此为列提供精选预设而非完整的切换列表。若用户选择“其他”,将其自由文本解释为逗号分隔的列列表(或映射为列的自然语言描述)。
    问题1 — 列预设(单选):要显示哪些列?提供以下3个精选预设 —
    AskUserQuestion
    会自动添加“其他”选项,允许用户输入自由格式的列列表或描述。
    • "全部(推荐)" —
      model,context,cost,effort,style,git,dir,worktree
      (当前所有有用的列;排除
      vim
      是因为大多数用户不使用vim快捷键)
    • "默认" —
      model,context,effort,style,git,dir
      (平衡配置 — 移除cost和worktree;与技能的默认标志值一致)
    • " essentials" —
      model,context,git,dir
      (精简配置;无effort、style和cost)
    若用户选择自动添加的“其他”,将其自由文本视为逗号分隔的列列表,或映射为列的自然语言描述。若解析模糊,回退到“默认”配置。
    问题2 — 主题(单选):配色主题?
    • "Dracula" — 现代深色,紫/粉/青配色(推荐)
    • "Gruvbox Dark" — 温暖复古调色板,24位真彩色
    • "Robbyrussell" — 经典oh-my-zsh风格,无图标
    • "Minimal" — 无装饰,仅显示暗淡分隔符
    有参数时:从参数中解析主题和列。跳过提示步骤。
  2. 将用户选择映射为脚本标志:
    • 列预设 → 展开为预设对应的标准
      --elements
      列表:
      • "全部" →
        model,context,cost,effort,style,git,dir,worktree
      • "默认" →
        model,context,effort,style,git,dir
      • " essentials" →
        model,context,git,dir
      • "其他"(由
        AskUserQuestion
        自动添加)→ 解析用户的自由文本;仅保留可识别的列名(
        model,context,cost,effort,style,dir,worktree,git,vim
        )。若解析模糊,回退到“默认”配置。
    • 主题 →
      --theme
      参数值(
      gruvbox
      dracula
      robbyrussell
      minimal
      之一)
  3. --install
    参数运行生成器:
    bash
    npx -y bun ${SKILL_DIR}/scripts/generate.mjs --elements <list> --theme <theme> --install
  4. 告知用户重启Claude Code以查看新状态栏。

Output Examples

输出示例

Dracula (all columns), remaining=49%, cost=$0.42, effort=high, output style=Explanatory, inside a worktree:
◈ Opus 4.7 | [■■■■■■■■■■□□□□□□□□□□] 51% | $0.42 | ↯ high | ❋ Explanatory | ⌂ clawmaster | ⊕ worktree:46a6 | ⎇ feat/xyz
(bar yellow — 49% remaining;
$0.42
gold session spend next to the bar; effort "high" bold red; purple
❋ Explanatory
sits between effort and dir; context carries no prefix icon — the bar is already visual enough)
Gruvbox Dark (model + context + effort + dir + git), remaining=88%, effort=medium:
✦ Opus 4.7 | [■■□□□□□□□□□□□□□□□□□□] 12% | ↯ medium | ⌂ skills-cc | ⎇ main
(bar green — 88% remaining; effort "medium" yellow)
Minimal (model + effort + dir + git), effort=low:
Claude Opus 4.7 · low · skills-cc · main
(no prefix icons in minimal; effort "low" green)
Dracula主题(所有列),剩余容量=49%,花费=$0.42,effort=high,输出样式=Explanatory,处于工作树中:
◈ Opus 4.7 | [■■■■■■■■■■□□□□□□□□□□] 51% | $0.42 | ↯ high | ❋ Explanatory | ⌂ clawmaster | ⊕ worktree:46a6 | ⎇ feat/xyz
(进度条为黄色 — 剩余49%;进度条旁显示金色的会话花费
$0.42
;effort“high”显示为加粗红色;紫色的
❋ Explanatory
位于effort和dir之间;context无前缀图标 — 进度条已足够直观)
Gruvbox Dark主题(model + context + effort + dir + git),剩余容量=88%,effort=medium:
✦ Opus 4.7 | [■■□□□□□□□□□□□□□□□□□□] 12% | ↯ medium | ⌂ skills-cc | ⎇ main
(进度条为绿色 — 剩余88%;effort“medium”显示为黄色)
Minimal主题(model + effort + dir + git),effort=low:
Claude Opus 4.7 · low · skills-cc · main
(minimal主题无前缀图标;effort“low”显示为绿色)

Notes

注意事项

  • Generated script is saved to
    ~/.claude/scripts/statusline.sh
  • Running the skill again overwrites the existing script — just re-run to change theme or columns
  • The script uses
    jq
    to parse JSON input — make sure it's installed
  • Git dirty detection uses
    --no-optional-locks
    to avoid interfering with other git operations
  • 生成的脚本保存至
    ~/.claude/scripts/statusline.sh
  • 再次运行本技能会覆盖现有脚本 — 重新运行即可更改主题或列配置
  • 脚本使用
    jq
    解析JSON输入 — 确保已安装该工具
  • Git改动检测使用
    --no-optional-locks
    参数,避免干扰其他Git操作 ",