webup-statusline
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseStatus 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.jsonHow It Works
工作原理
Claude Code supports custom status lines via a shell script configured in . The script receives session JSON on stdin (model, context window, workspace, vim, worktree, etc.) and prints formatted text to stdout.
~/.claude/settings.jsonThis skill generates a bash script tailored to your preferences and installs it automatically.
Claude Code通过配置在中的Shell脚本支持自定义状态栏。该脚本从标准输入接收会话JSON(包含model、上下文窗口、工作区、vim、工作树等信息),并将格式化后的文本输出到标准输出。
~/.claude/settings.json本技能会根据你的偏好生成定制化的Bash脚本,并自动完成安装。
Script Directory
脚本目录
Important: All scripts are located in the subdirectory of this skill.
scripts/Agent Execution Instructions:
- Determine this SKILL.md file's directory path as
SKILL_DIR - Script path =
${SKILL_DIR}/scripts/<script-name>.mjs - Replace all in this document with the actual path
${SKILL_DIR}
Script Reference:
| Script | Purpose |
|---|---|
| Generate and install status line script from chosen options |
重要提示:所有脚本都位于本技能的子目录下。
scripts/Agent执行说明:
- 确定本SKILL.md文件的目录路径为
SKILL_DIR - 脚本路径 =
${SKILL_DIR}/scripts/<script-name>.mjs - 将本文档中所有替换为实际路径
${SKILL_DIR}
脚本参考:
| 脚本 | 用途 |
|---|---|
| 根据所选选项生成并安装状态栏脚本 |
Prerequisites
前置依赖
- jq — required by the generated status line script to parse JSON input from Claude Code
- Bun — required to run the generator. Use if not installed globally.
npx -y bun
- jq — 生成的状态栏脚本需要它来解析Claude Code传入的JSON输入
- Bun — 运行生成器的必要工具。若未全局安装,可使用。
npx -y bun
Usage
使用方法
bash
undefinedbash
undefinedPreview 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
undefinednpx -y bun ${SKILL_DIR}/scripts/generate.mjs --elements model,context,effort,git,dir --theme dracula --install
undefinedOptions
选项
| Flag | Default | Description |
|---|---|---|
| | Comma-separated columns to display |
| | Color theme — see table below |
| | Override the effort prefix icon. Presets: |
| off | Write script to |
| 标志 | 默认值 | 描述 |
|---|---|---|
| | 要显示的列,以逗号分隔 |
| | 配色主题 — 见下方表格 |
| 图标主题默认使用 | 覆盖effort前缀图标。预设值: |
| 关闭 | 将脚本写入 |
Columns
列说明
| Column | Description | Data source |
|---|---|---|
| Active model name (e.g. "Opus 4.7") | |
| Progress bar + percentage — color changes with remaining capacity | |
| Session API spend formatted as | |
| Reasoning effort level — color changes with level | |
| Output style name (e.g. Explanatory, Learning) — hidden when "default" | |
| Git branch name (yellow when dirty) | |
| Repo basename (original repo when in a worktree) | |
| Bold | |
| Vim mode indicator (hidden when inactive) | |
| 列 | 描述 | 数据来源 |
|---|---|---|
| 当前激活的模型名称(例如 "Opus 4.7") | |
| 进度条 + 百分比 — 颜色随剩余容量变化 | |
| 会话API花费,格式为 | 输入JSON中的 |
| 推理努力等级 — 颜色随等级变化 | |
| 输出样式名称(例如 Explanatory、Learning)— 为"default"时隐藏 | 输入JSON中的 |
| Git分支名称(分支有改动时显示为黄色) | |
| 仓库基础名称(处于工作树中时显示原始仓库名称) | |
| 加粗的 | |
| Vim模式指示器(未激活时隐藏) | |
Color-changing elements
颜色动态变化元素
context| Remaining | Color | Meaning |
|---|---|---|
| > 50% | green | plenty of context |
| 20–50% | yellow | watch out |
| < 20% | red | nearly full — compact soon |
effort| Level | Color |
|---|---|
| bold red |
| yellow |
| green |
| other / unset | dim (or hidden when completely unset) |
context| 剩余容量 | 颜色 | 含义 |
|---|---|---|
| > 50% | 绿色 | 上下文空间充足 |
| 20–50% | 黄色 | 需要注意 |
| < 20% | 红色 | 即将耗尽 — 需尽快精简内容 |
effort| 等级 | 颜色 |
|---|---|
| 加粗红色 |
| 黄色 |
| 绿色 |
| 其他/未设置 | 暗淡色(完全未设置时隐藏) |
Themes
主题说明
| Theme | Vibe | Icons rendered in bar |
|---|---|---|
| Warm retro, muted | |
| Modern dark, high saturation | |
| Classic oh-my-zsh | no prefix icons — colors + labels only |
| Default terminal colors | no prefix icons — plain text |
The column intentionally skips a prefix icon — the colored progress bar is already visually rich. The prefix () is baked into iconic themes and can be overridden with .
contexteffort↯--effort-icon| 主题 | 风格 | 状态栏中的图标 |
|---|---|---|
| 温暖复古、色调柔和 | |
| 现代深色、高饱和度 | |
| 经典oh-my-zsh风格 | 无前缀图标 — 仅显示颜色和标签 |
| 默认终端配色 | 无前缀图标 — 纯文本显示 |
contexteffort↯--effort-iconEffort icons
Effort图标
Pass to swap the glyph in front of the effort value. Presets:
--effort-icon <preset>| Preset | Glyph | Notes |
|---|---|---|
| | Electric arrow — default, narrow |
| | Greek koppa — narrow lightning |
| | Classic lightning — wide in emoji-presentation fonts |
| | Therefore |
| | Filled circle |
| (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 fields or via fallback), the column shows a bold label using the parent dir name (e.g. → ). The column prefers from the input JSON; the column prefers so the repo identity stays stable across worktrees.
worktree.*git rev-parse --git-common-dirworktreeworktree:<id>~/.codex/worktrees/46a6/clawmasterworktree:46a6gitworktree.branchdirworktree.original_repo_dir传入参数可替换effort值前的符号。预设值:
--effort-icon <preset>| 预设 | 符号 | 说明 |
|---|---|---|
| | 电光箭头 — 默认值,占用空间小 |
| | 希腊字母Koppa — 窄版闪电符号 |
| | 经典闪电符号 — 在表情字体中显示较宽 |
| | 所以符号 |
| | 实心圆 |
| (隐藏) | 完全移除图标 |
你也可以直接传入任意字符作为参数。
--effort-icon <char>工作树行为:当处于Git工作树中时(通过输入JSON的字段检测,或通过作为备选检测方式),列会显示加粗的标签(使用父目录名称,例如 → )。列优先使用输入JSON中的;列优先使用,确保在不同工作树中仓库标识保持一致。
worktree.*git rev-parse --git-common-dirworktreeworktree:<id>~/.codex/worktrees/46a6/clawmasterworktree:46a6gitworktree.branchdirworktree.original_repo_dirInvocation
调用方式
This skill can be invoked with or without arguments:
- No args (): Interactive prompt via
/webup-statuslineto pick columns and theme.AskUserQuestion - With args (): NLP parse for theme and column preferences.
/webup-statusline dracula
本技能可带参数或不带参数调用:
- 无参数 ():通过
/webup-statusline弹出交互式提示,选择列和主题。AskUserQuestion - 带参数 ():通过自然语言解析提取主题和列偏好。
/webup-statusline dracula
Arg parsing (natural language)
参数解析(自然语言)
The args string is free-form text. Use NLP to extract:
- theme — match against: gruvbox, robbyrussell, minimal, dracula. Recognize aliases (暗黑=dracula, 极简=minimal, 复古=gruvbox, レトロ=gruvbox).
- elements — look for mentions of: model, context/进度/コンテキスト, effort/推理强度/努力度, git/分支/ブランチ, dir/目录/ディレクトリ, worktree/工作树/ワークツリー, vim.
Unspecified fields use defaults: columns, theme.
model,context,effort,git,dirgruvbox参数字符串为自由格式文本。需通过自然语言提取以下信息:
- theme — 匹配以下主题:gruvbox、robbyrussell、minimal、dracula。支持别名(暗黑=dracula, 极简=minimal, 复古=gruvbox, レトロ=gruvbox)。
- elements — 识别以下提及内容:model、context/进度/コンテキスト、effort/推理强度/努力度、git/分支/ブランチ、dir/目录/ディレクトリ、worktree/工作树/ワークツリー、vim。
未指定的字段使用默认值:列默认,主题默认。
model,context,effort,git,dirgruvboxWorkflow
工作流程
-
If no args provided: Useto ask 2 questions in a single prompt.
AskUserQuestioncaps 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).AskUserQuestionQ1 — Column preset (single): Which columns to display? Offer these 3 curated presets —will auto-append an "Other" option that lets the user type a free-text column list or description.AskUserQuestion- "Everything (Recommended)" — (all columns that have a useful signal today;
model,context,cost,effort,style,git,dir,worktreeis excluded because most users don't use vim keybindings)vim - "Default" — (balanced — drops cost and worktree; matches the skill's default flag value)
model,context,effort,style,git,dir - "Essentials" — (lean; no effort, no style, no cost)
model,context,git,dir
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 toif parsing is ambiguous.DefaultQ2 — 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. - "Everything (Recommended)" —
-
Map user selections to script flags:
- Column preset → expand to the preset's canonical list:
--elements- →
Everythingmodel,context,cost,effort,style,git,dir,worktree - →
Defaultmodel,context,effort,style,git,dir - →
Essentialsmodel,context,git,dir - (auto-added by
Other) → parse the user's free text; keep only recognized column names (AskUserQuestion). If parsing is ambiguous, fall back tomodel,context,cost,effort,style,dir,worktree,git,vim.Default
- Theme → value (one of
--theme,gruvbox,dracula,robbyrussell)minimal
- Column preset → expand to the preset's canonical
-
Run the generator with:
--installbashnpx -y bun ${SKILL_DIR}/scripts/generate.mjs --elements <list> --theme <theme> --install -
Tell user to restart Claude Code to see the new status line.
-
无参数时:使用在一个提示中提出2个问题。
AskUserQuestion每个问题最多支持4个选项,因此为列提供精选预设而非完整的切换列表。若用户选择“其他”,将其自由文本解释为逗号分隔的列列表(或映射为列的自然语言描述)。AskUserQuestion问题1 — 列预设(单选):要显示哪些列?提供以下3个精选预设 —会自动添加“其他”选项,允许用户输入自由格式的列列表或描述。AskUserQuestion- "全部(推荐)" — (当前所有有用的列;排除
model,context,cost,effort,style,git,dir,worktree是因为大多数用户不使用vim快捷键)vim - "默认" — (平衡配置 — 移除cost和worktree;与技能的默认标志值一致)
model,context,effort,style,git,dir - " essentials" — (精简配置;无effort、style和cost)
model,context,git,dir
若用户选择自动添加的“其他”,将其自由文本视为逗号分隔的列列表,或映射为列的自然语言描述。若解析模糊,回退到“默认”配置。问题2 — 主题(单选):配色主题?- "Dracula" — 现代深色,紫/粉/青配色(推荐)
- "Gruvbox Dark" — 温暖复古调色板,24位真彩色
- "Robbyrussell" — 经典oh-my-zsh风格,无图标
- "Minimal" — 无装饰,仅显示暗淡分隔符
有参数时:从参数中解析主题和列。跳过提示步骤。 - "全部(推荐)" —
-
将用户选择映射为脚本标志:
- 列预设 → 展开为预设对应的标准列表:
--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
- 列预设 → 展开为预设对应的标准
-
带参数运行生成器:
--installbashnpx -y bun ${SKILL_DIR}/scripts/generate.mjs --elements <list> --theme <theme> --install -
告知用户重启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; gold session spend next to the bar; effort "high" bold red; purple sits between effort and dir; context carries no prefix icon — the bar is already visual enough)
$0.42❋ ExplanatoryGruvbox 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%;进度条旁显示金色的会话花费;effort“high”显示为加粗红色;紫色的位于effort和dir之间;context无前缀图标 — 进度条已足够直观)
$0.42❋ ExplanatoryGruvbox 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 to parse JSON input — make sure it's installed
jq - Git dirty detection uses to avoid interfering with other git operations
--no-optional-locks
- 生成的脚本保存至
~/.claude/scripts/statusline.sh - 再次运行本技能会覆盖现有脚本 — 重新运行即可更改主题或列配置
- 脚本使用解析JSON输入 — 确保已安装该工具
jq - Git改动检测使用参数,避免干扰其他Git操作 ",
--no-optional-locks