← Back to Skills Marketplace
mark-heartflow

Claude Statusline

by mark-HeartFlow · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
54
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install claude-statusline-skill
Description
Claude Code 状态栏 - 显示Git分支、模型、Context用量、输出Token、花费、时长、代码改动行数 功能:实时显示Claude Code会话状态
README (SKILL.md)

Claude Code 状态栏

显示 Claude Code 会话的状态信息。

功能

  • Git分支显示
  • 当前使用模型
  • Context用量
  • 输出Token数量
  • 会话时长
  • 代码改动行数

安装

第一步:配置 settings.json

~/.claude/settings.json 中添加:

{
  "statusLine": {
    "type": "command",
    "command": "bash ~/.claude/statusline-command.sh"
  }
}

第二步:创建脚本

将以下脚本保存到 ~/.claude/statusline-command.sh

#!/bin/bash
# Claude Code Status Line Script

get_git_branch() {
    if command -v git >/dev/null 2>&1 && git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
        git_branch=$(git branch --show-current 2>/dev/null | tr -d '\
')
        [ -z "$git_branch" ] && git_branch=$(git symbolic-ref --short HEAD 2>/dev/null | tr -d '\
')
    fi
    [ -z "$git_branch" ] && git_branch="no-git"
}

get_model() {
    model_name=$(grep -o '"model": *"[^"]*"' ~/.claude/settings.json 2>/dev/null | cut -d'"' -f4 | tr -d '\
')
    [ -z "$model_name" ] && model_name="unknown"
}

get_changed_lines() {
    if command -v git >/dev/null 2>&1 && git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
        changed=$(git diff --stat 2>/dev/null | tail -1 | awk '{print $1"+"$4}' | tr -d '\
')
        [ -z "$changed" ] || [ "$changed" = "+" ] && changed="0+0"
        changed_lines="$changed"
    else
        changed_lines="no-git"
    fi
}

main() {
    get_git_branch
    get_model
    get_changed_lines
    echo "${git_branch} | ${model_name} | N/A | N/A | N/A | N/A | ${changed_lines}"
}

main

第三步:添加执行权限

chmod +x ~/.claude/statusline-command.sh

效果

重新启动 Claude Code 后,状态栏将显示:

git_branch | model_name | N/A | N/A | N/A | N/A | 10+5

前提条件

  • 需要 jq(用于解析 JSON):brew install jq
  • 需要在 Git 仓库中(否则显示 no-git)

自定义

可根据需要修改脚本,例如:

  • 添加 Context 用量检测
  • 添加 Token 统计
  • 添加花费计算
  • 添加会话时长

MIT License

Usage Guidance
Review the statusLine configuration and the referenced script before installing. Install only if you are comfortable with Claude Code automatically running that local command during status-line rendering, and prefer a version that documents exactly what files and commands it touches.
Capability Assessment
Purpose & Capability
The described capability fits a Claude Code status-line helper, and the supplied scanner evidence says the bundled script appears simple and mostly read-only.
Instruction Scope
The skill reportedly instructs users to configure Claude Code to run a local shell command whenever the status line renders, but does not clearly explain that this creates recurring automatic code execution in the user's environment.
Install Mechanism
The install/configuration path appears to persist a statusLine command in Claude Code configuration, which is more sensitive than a one-time manual command because it can run automatically after setup.
Credentials
Local shell access is proportionate for a status-line integration only if the script scope is narrow and inspectable; the missing warning makes that boundary less clear to users.
Persistence & Privilege
The status-line hook is a persistent execution point. No supplied evidence shows credential theft, exfiltration, or destructive behavior, and VirusTotal telemetry was clean, but the automatic execution path is under-disclosed.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install claude-statusline-skill
  3. After installation, invoke the skill by name or use /claude-statusline-skill
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
claude-statusline-skill 1.0.0 - Initial release. - Adds a status line for Claude Code sessions displaying Git branch, model, context usage, output tokens, cost, duration, and code changed lines. - Provides setup instructions and an example Bash script for integration. - Supports customization through user script modification.
Metadata
Slug claude-statusline-skill
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Claude Statusline?

Claude Code 状态栏 - 显示Git分支、模型、Context用量、输出Token、花费、时长、代码改动行数 功能:实时显示Claude Code会话状态. It is an AI Agent Skill for Claude Code / OpenClaw, with 54 downloads so far.

How do I install Claude Statusline?

Run "/install claude-statusline-skill" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Claude Statusline free?

Yes, Claude Statusline is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Claude Statusline support?

Claude Statusline is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Claude Statusline?

It is built and maintained by mark-HeartFlow (@mark-heartflow); the current version is v1.0.0.

💬 Comments