groove-admin-claude-statusline

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

groove-admin-claude-statusline

groove-admin-claude-statusline

Install a rich single-line Claude Code statusline. Writes three scripts to
~/.claude/hooks/
and merges config into
~/.claude/settings.json
.
Use
--uninstall
to remove. Use
--list
to show current status.
安装功能丰富的单行Claude Code状态行。会将三个脚本写入
~/.claude/hooks/
,并将配置合并到
~/.claude/settings.json
中。
使用
--uninstall
参数进行卸载,使用
--list
参数查看当前状态。

Outcome

安装结果

~/.claude/settings.json
has
statusLine
pointing to the statusline script, plus PostToolUse and SessionEnd hooks to track active
/loop
cron jobs. The statusline shows on every Claude Code turn.
~/.claude/settings.json
中会添加指向状态行脚本的
statusLine
配置,同时添加PostToolUse和SessionEnd钩子来跟踪活跃的
/loop
定时任务。状态行会在每次Claude Code运行时显示。

What the statusline shows

状态行显示内容

claude-sonnet-4-6 | myrepo@main (+3 -1) | 42k/200k (21%) | effort: high | 5h 12% @8:00pm | 7d 3% @mar 16, 9:00am | 2 loops | check deployment @4:10pm
SectionDescription
ModelDisplay name of the active model
Repo@branchCWD folder name, git branch, staged diff
+N -N
TokensUsed / total context, % used
EffortCurrent effort level (low / med / high)
5h / 7dRate-limit utilisation with reset time (cached 60s)
LoopsCount of active
/loop
crons + soonest-firing prompt and time
claude-sonnet-4-6 | myrepo@main (+3 -1) | 42k/200k (21%) | effort: high | 5h 12% @8:00pm | 7d 3% @mar 16, 9:00am | 2 loops | check deployment @4:10pm
区域描述
Model显示当前活跃模型的名称
Repo@branch当前工作目录名称、Git分支、暂存区差异
+N -N
Tokens已使用token/总上下文token,使用百分比
Effort当前工作强度(低/中/高)
5h / 7d速率限制使用率及重置时间(缓存60秒)
Loops活跃
/loop
定时任务数量 + 最近要执行的任务及时间

Steps

操作步骤

--list

--list
参数

Read
~/.claude/settings.json
. Report whether
statusLine
is set, and whether each hook script exists in
~/.claude/hooks/
. Exit.
读取
~/.claude/settings.json
,报告
statusLine
是否已配置,以及每个钩子脚本是否存在于
~/.claude/hooks/
中,然后退出。

--uninstall

--uninstall
参数

Remove
statusLine
from
~/.claude/settings.json
. Remove the three
CronCreate|CronDelete
/
SessionEnd
hook entries added by this skill. Do not remove hook scripts (leave for manual cleanup). Report changes. Exit.
~/.claude/settings.json
中移除
statusLine
配置,移除该工具添加的三个
CronCreate|CronDelete
/
SessionEnd
钩子条目。不删除钩子脚本(留待手动清理)。报告变更后退出。

Default (install)

默认操作(安装)

  1. Create
    ~/.claude/hooks/
    if absent.
  2. Write the three scripts below to
    ~/.claude/hooks/
    . Never overwrite without showing a diff and confirming.
  3. Make all three scripts executable (
    chmod +x
    ).
  4. Read
    ~/.claude/settings.json
    (default
    {}
    ). Merge in the
    statusLine
    entry and the two hook entries below. Preserve all other keys. Do not create duplicate entries.
  5. Write
    ~/.claude/settings.json
    .
  6. Report:
    ✓ statusline.sh         → ~/.claude/hooks/statusline.sh
    ✓ cron-state.sh         → ~/.claude/hooks/cron-state.sh
    ✓ cron-state-clear.sh   → ~/.claude/hooks/cron-state-clear.sh
    ✓ ~/.claude/settings.json updated
    Note: restart Claude Code for changes to take effect.
  1. 如果
    ~/.claude/hooks/
    目录不存在则创建。
  2. 将下方三个脚本写入
    ~/.claude/hooks/
    。若目标文件已存在,必须先显示差异并获得确认后才能覆盖。
  3. 为三个脚本添加可执行权限(
    chmod +x
    )。
  4. 读取
    ~/.claude/settings.json
    (默认内容为
    {}
    ),将
    statusLine
    条目和下方两个钩子条目合并到现有配置中。保留所有原有配置项,不创建重复条目。
  5. 将合并后的配置写入
    ~/.claude/settings.json
  6. 输出报告:
✓ statusline.sh         → ~/.claude/hooks/statusline.sh
✓ cron-state.sh         → ~/.claude/hooks/cron-state.sh
✓ cron-state-clear.sh   → ~/.claude/hooks/cron-state-clear.sh
✓ ~/.claude/settings.json 已更新
注意:请重启Claude Code以使更改生效。

Scripts

脚本说明

The three shell scripts live in
scripts/
per the Agent Skills specification:
ScriptInstalled toPurpose
scripts/statusline.sh
~/.claude/hooks/statusline.sh
Main statusline renderer
scripts/cron-state.sh
~/.claude/hooks/cron-state.sh
Tracks
/loop
cron jobs in
/tmp/claude/loops.json
scripts/cron-state-clear.sh
~/.claude/hooks/cron-state-clear.sh
Clears loop state on session end
Copy each script from
scripts/
to
~/.claude/hooks/
. Never overwrite an existing script without showing a diff and confirming.
根据Agent Skills 规范,这三个Shell脚本位于
scripts/
目录下:
脚本安装路径用途
scripts/statusline.sh
~/.claude/hooks/statusline.sh
状态行主渲染脚本
scripts/cron-state.sh
~/.claude/hooks/cron-state.sh
/tmp/claude/loops.json
中跟踪
/loop
定时任务
scripts/cron-state-clear.sh
~/.claude/hooks/cron-state-clear.sh
在会话结束时清除任务循环状态
将每个脚本从
scripts/
复制到
~/.claude/hooks/
。若目标脚本已存在,必须先显示差异并获得确认后才能覆盖。

~/.claude/settings.json
entries

~/.claude/settings.json
配置条目

Merge these into the existing settings. Preserve all other keys. Do not create duplicates.
json
{
  "statusLine": {
    "type": "command",
    "command": "~/.claude/hooks/statusline.sh"
  },
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "CronCreate|CronDelete",
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/hooks/cron-state.sh",
            "async": true
          }
        ]
      }
    ],
    "SessionEnd": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/hooks/cron-state-clear.sh",
            "async": true
          }
        ]
      }
    ]
  }
}
将以下条目合并到现有配置中,保留所有原有配置项,不创建重复条目。
json
{
  "statusLine": {
    "type": "command",
    "command": "~/.claude/hooks/statusline.sh"
  },
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "CronCreate|CronDelete",
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/hooks/cron-state.sh",
            "async": true
          }
        ]
      }
    ],
    "SessionEnd": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/hooks/cron-state-clear.sh",
            "async": true
          }
        ]
      }
    ]
  }
}

Constraints

约束条件

  • Write to
    ~/.claude/hooks/
    (user-global), not
    .claude/
    (project-local)
  • Never overwrite an existing script without showing a diff and confirming
  • Never discard existing keys in
    ~/.claude/settings.json
  • Requires:
    jq
    ,
    curl
    ,
    python3
    ,
    git
    (all standard on macOS/Linux)
  • The 5h/7d usage section requires a Claude Pro/Max OAuth session; it silently omits if no token is found
  • After install: restart Claude Code for the statusLine and hooks to take effect
  • 写入到
    ~/.claude/hooks/
    (用户全局目录),而非
    .claude/
    (项目本地目录)
  • 若目标脚本已存在,必须先显示差异并获得确认后才能覆盖
  • 不得丢弃
    ~/.claude/settings.json
    中的任何原有配置项
  • 依赖:
    jq
    curl
    python3
    git
    (这些在macOS/Linux中均为标准工具)
  • 5小时/7天使用量统计功能需要Claude Pro/Max OAuth会话;如果未找到token,该部分会自动隐藏
  • 安装完成后:请重启Claude Code以使状态行和钩子生效