status-line-customization

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Status Line Meta Skill

状态栏元技能

🚨 MANDATORY: Invoke docs-management First

STOP - Before providing ANY response about status line configuration:
  1. INVOKE
    docs-management
    skill
  2. QUERY for the user's specific topic
  3. BASE all responses EXCLUSIVELY on official documentation loaded
Skipping this step results in outdated or incorrect information.

Verification Checkpoint

Before responding, verify:
  • Did I invoke docs-management skill?
  • Did official documentation load?
  • Is my response based EXCLUSIVELY on official docs?
If ANY checkbox is unchecked, STOP and invoke docs-management first.

🚨 强制要求:先调用docs-management技能

注意 - 在提供任何关于状态栏配置的响应之前:
  1. 调用
    docs-management
    技能
  2. 查询用户的具体主题
  3. 完全基于加载的官方文档生成所有响应
跳过此步骤会导致信息过时或错误。

验证检查点

回复前请验证:
  • 是否调用了docs-management技能?
  • 是否加载了官方文档?
  • 我的响应是否完全基于官方文档?
如果有任何复选框未勾选,请停止操作并先调用docs-management技能。

Overview

概述

Central authority for Claude Code status line configuration. This skill uses 100% delegation to docs-management - it contains NO duplicated official documentation.
Architecture: Pure delegation with keyword registry. All official documentation is accessed via docs-management skill queries.
Claude Code状态栏配置的核心管理模块。本技能100%委托给docs-management处理,不包含任何重复的官方文档。
架构: 纯委托模式搭配关键词注册表。所有官方文档均通过docs-management技能的查询获取。

When to Use This Skill

何时使用本技能

Keywords: status line, statusline, /statusline command, custom status line, status line configuration, statusLine setting, status line script, status line JSON input, model display, workspace info, cost tracking display, session info display, ANSI colors status line, git-aware status line, PS1-style prompt
Use this skill when:
  • Creating custom status lines
  • Configuring status line settings
  • Understanding status line JSON input structure
  • Writing status line scripts (Bash, Python, Node.js)
  • Adding git information to status line
  • Styling status lines with ANSI colors
  • Troubleshooting status line issues
  • Displaying model, cost, or workspace information
关键词: status line、statusline、/statusline command、custom status line、status line configuration、statusLine setting、status line script、status line JSON input、model display、workspace info、cost tracking display、session info display、ANSI colors status line、git-aware status line、PS1-style prompt
在以下场景使用本技能:
  • 创建自定义状态栏
  • 配置状态栏设置
  • 理解状态栏JSON输入结构
  • 编写状态栏脚本(Bash、Python、Node.js)
  • 为状态栏添加Git信息
  • 使用ANSI颜色为状态栏设置样式
  • 排查状态栏问题
  • 显示模型、成本或工作区信息

Keyword Registry for docs-management Queries

docs-management查询关键词注册表

Use these keywords when querying docs-management skill for official documentation:
查询docs-management技能获取官方文档时,请使用以下关键词:

Status Line Fundamentals

状态栏基础

TopicKeywords
Overview"status line", "statusline", "custom status line"
Purpose"status line purpose", "contextual information display"
Behavior"status line update", "status line refresh rate"
主题关键词
概述"status line", "statusline", "custom status line"
用途"status line purpose", "contextual information display"
行为"status line update", "status line refresh rate"

Configuration Methods

配置方法

TopicKeywords
Slash Command"/statusline command", "statusline setup"
Settings"statusLine setting", "settings.json statusLine"
Command Type"statusLine type command", "status line command config"
Padding"statusLine padding", "status line edge"
主题关键词
斜杠命令"/statusline command", "statusline setup"
设置"statusLine setting", "settings.json statusLine"
命令类型"statusLine type command", "status line command config"
内边距"statusLine padding", "status line edge"

JSON Input Structure

JSON输入结构

TopicKeywords
Input Format"status line JSON input", "statusline stdin JSON"
Model Info"status line model", "model display_name", "model id"
Workspace Info"status line workspace", "current_dir", "project_dir"
Session Info"status line session_id", "transcript_path"
Cost Info"status line cost", "total_cost_usd", "lines_added"
Version Info"status line version", "output_style"
Context Usage"used_percentage", "remaining_percentage", "context window usage", "context capacity"
主题关键词
输入格式"status line JSON input", "statusline stdin JSON"
模型信息"status line model", "model display_name", "model id"
工作区信息"status line workspace", "current_dir", "project_dir"
会话信息"status line session_id", "transcript_path"
成本信息"status line cost", "total_cost_usd", "lines_added"
版本信息"status line version", "output_style"
上下文使用情况"used_percentage", "remaining_percentage", "context window usage", "context capacity"

Script Examples

脚本示例

TopicKeywords
Bash Scripts"status line bash script", "statusline.sh"
Python Scripts"status line python", "statusline python example"
Node.js Scripts"status line nodejs", "statusline javascript"
Helper Functions"status line helper functions", "statusline helpers"
主题关键词
Bash脚本"status line bash script", "statusline.sh"
Python脚本"status line python", "statusline python example"
Node.js脚本"status line nodejs", "statusline javascript"
辅助函数"status line helper functions", "statusline helpers"

Git Integration

Git集成

TopicKeywords
Git-Aware Status"git-aware status line", "git branch status line"
Git Branch Display"status line git branch", "show git branch"
主题关键词
Git感知状态栏"git-aware status line", "git branch status line"
Git分支显示"status line git branch", "show git branch"

Styling and Display

样式与显示

TopicKeywords
ANSI Colors"status line ANSI", "status line colors", "styling status line"
Emojis"status line emojis", "status line icons"
Concise Display"status line concise", "fit on one line"
主题关键词
ANSI颜色"status line ANSI", "status line colors", "styling status line"
表情符号"status line emojis", "status line icons"
简洁显示"status line concise", "fit on one line"

Troubleshooting

故障排查

TopicKeywords
Not Appearing"status line not appearing", "statusline troubleshooting"
Executable Issues"status line chmod", "script not executable"
Output Issues"status line stdout", "statusline stderr"
Testing"test status line script", "mock JSON input"
主题关键词
不显示"status line not appearing", "statusline troubleshooting"
可执行性问题"status line chmod", "script not executable"
输出问题"status line stdout", "statusline stderr"
测试"test status line script", "mock JSON input"

Quick Decision Tree

快速决策树

What do you want to do?
  1. Create a status line quickly -> Query docs-management: "/statusline command", "statusline setup"
  2. Configure status line in settings -> Query docs-management: "statusLine setting", "settings.json statusLine"
  3. Understand JSON input -> Query docs-management: "status line JSON input", "statusline stdin JSON"
  4. Show model information -> Query docs-management: "status line model", "model display_name"
  5. Show cost/usage -> Query docs-management: "status line cost", "total_cost_usd"
  6. Add git branch -> Query docs-management: "git-aware status line", "git branch status line"
  7. Write bash script -> Query docs-management: "status line bash script", "statusline.sh"
  8. Write Python script -> Query docs-management: "status line python", "statusline python example"
  9. Add colors -> Query docs-management: "status line ANSI", "status line colors"
  10. Fix status line issues -> Query docs-management: "statusline troubleshooting", "status line not appearing"
你想要做什么?
  1. 快速创建状态栏 -> 查询docs-management:"/statusline command", "statusline setup"
  2. 在设置中配置状态栏 -> 查询docs-management:"statusLine setting", "settings.json statusLine"
  3. 理解JSON输入 -> 查询docs-management:"status line JSON input", "statusline stdin JSON"
  4. 显示模型信息 -> 查询docs-management:"status line model", "model display_name"
  5. 显示成本/使用情况 -> 查询docs-management:"status line cost", "total_cost_usd"
  6. 添加Git分支 -> 查询docs-management:"git-aware status line", "git branch status line"
  7. 编写Bash脚本 -> 查询docs-management:"status line bash script", "statusline.sh"
  8. 编写Python脚本 -> 查询docs-management:"status line python", "statusline python example"
  9. 添加颜色 -> 查询docs-management:"status line ANSI", "status line colors"
  10. 修复状态栏问题 -> 查询docs-management:"statusline troubleshooting", "status line not appearing"

Topic Coverage

主题覆盖范围

Status Line Configuration

状态栏配置

  • /statusline slash command for quick setup
  • statusLine setting in settings.json
  • Command type configuration
  • Padding configuration (edge alignment)
  • Script path specification
  • 用于快速设置的/statusline斜杠命令
  • settings.json中的statusLine设置
  • 命令类型配置
  • 内边距配置(边缘对齐)
  • 脚本路径指定

JSON Input Data

JSON输入数据

  • hook_event_name (always "Status")
  • session_id (current session identifier)
  • transcript_path (path to transcript file)
  • cwd (current working directory)
  • model object (id and display_name)
  • workspace object (current_dir and project_dir)
  • version (Claude Code version)
  • output_style object (current style name)
  • cost object (usage metrics)
  • hook_event_name(始终为"Status")
  • session_id(当前会话标识符)
  • transcript_path(转录文件路径)
  • cwd(当前工作目录)
  • model对象(id和display_name)
  • workspace对象(current_dir和project_dir)
  • version(Claude Code版本)
  • output_style对象(当前样式名称)
  • cost对象(使用指标)

Cost Tracking Fields

成本跟踪字段

  • total_cost_usd (session cost)
  • total_duration_ms (session duration)
  • total_api_duration_ms (API call time)
  • total_lines_added (lines added)
  • total_lines_removed (lines removed)
  • total_cost_usd(会话成本)
  • total_duration_ms(会话时长)
  • total_api_duration_ms(API调用时间)
  • total_lines_added(新增行数)
  • total_lines_removed(删除行数)

Script Implementation Patterns

脚本实现模式

  • Bash with jq for JSON parsing
  • Python with json module
  • Node.js with JSON.parse
  • Helper function patterns for complex scripts
  • Reading from stdin
  • Outputting to stdout (first line only)
  • 使用jq解析JSON的Bash脚本
  • 使用json模块的Python脚本
  • 使用JSON.parse的Node.js脚本
  • 复杂脚本的辅助函数模式
  • 从标准输入读取数据
  • 输出到标准输出(仅第一行)

Git Integration Patterns

Git集成模式

  • Detecting git repository
  • Reading current branch
  • Branch display formatting
  • Error handling for non-git directories
  • 检测Git仓库
  • 读取当前分支
  • 分支显示格式
  • 非Git目录的错误处理

Styling Approaches

样式设置方法

  • ANSI color code support
  • Emoji usage for visual indicators
  • Concise formatting (one line)
  • Information density considerations
  • ANSI颜色代码支持
  • 用于视觉指示的表情符号
  • 简洁格式(单行显示)
  • 信息密度考量

Update Behavior

更新行为

  • Updates on conversation message changes
  • 300ms rate limiting
  • First line of stdout becomes status text
  • ANSI color code preservation
  • 会话消息变化时更新
  • 300ms速率限制
  • 标准输出的第一行成为状态文本
  • 保留ANSI颜色代码

Delegation Patterns

委托模式

Standard Query Pattern

标准查询模式

text
User asks: "How do I create a custom status line?"

1. Invoke docs-management skill
2. Use keywords: "/statusline command", "custom status line"
3. Load official documentation
4. Provide guidance based EXCLUSIVELY on official docs
text
用户提问:"如何创建自定义状态栏?"

1. 调用docs-management技能
2. 使用关键词:"/statusline command", "custom status line"
3. 加载官方文档
4. 完全基于官方文档提供指导

Multi-Topic Query Pattern

多主题查询模式

text
User asks: "I want a status line showing git branch and cost"

1. Invoke docs-management skill with multiple queries:
   - "git-aware status line", "git branch status line"
   - "status line cost", "total_cost_usd"
2. Synthesize guidance from official documentation
text
用户提问:"我想要一个显示Git分支和成本的状态栏"

1. 使用多个查询调用docs-management技能:
   - "git-aware status line", "git branch status line"
   - "status line cost", "total_cost_usd"
2. 整合官方文档中的指导内容

Troubleshooting Pattern

故障排查模式

text
User reports: "My status line script isn't showing up"

1. Invoke docs-management skill
2. Use keywords: "statusline troubleshooting", "status line not appearing"
3. Check official docs for common issues
4. Guide user through troubleshooting steps
text
用户反馈:"我的状态栏脚本不显示"

1. 调用docs-management技能
2. 使用关键词:"statusline troubleshooting", "status line not appearing"
3. 查阅官方文档中的常见问题
4. 引导用户完成故障排查步骤

Troubleshooting Quick Reference

故障排查快速参考

IssueKeywords for docs-management
Status line not appearing"statusline troubleshooting", "status line not appearing"
Script not executable"status line chmod", "script not executable"
Wrong output"status line stdout", "first line output"
JSON parsing errors"status line JSON input", "jq parsing"
Colors not working"status line ANSI", "terminal colors"
Git branch not showing"git-aware status line", "git branch display"
Slow updates"status line update", "rate limiting"
Settings not applied"statusLine setting", "settings.json"
问题docs-management关键词
状态栏不显示"statusline troubleshooting", "status line not appearing"
脚本不可执行"status line chmod", "script not executable"
输出错误"status line stdout", "first line output"
JSON解析错误"status line JSON input", "jq parsing"
颜色不生效"status line ANSI", "terminal colors"
Git分支不显示"git-aware status line", "git branch display"
更新缓慢"status line update", "rate limiting"
设置不生效"statusLine setting", "settings.json"

Repository-Specific Notes

仓库特定说明

This repository does not currently use custom status lines. Status line documentation is relevant for:
  • Understanding status line customization options
  • Potential custom status line creation for development workflows
  • Understanding session information available via JSON input
When working with status line topics, always use the docs-management skill to access official documentation.
本仓库目前未使用自定义状态栏。状态栏文档适用于:
  • 了解状态栏自定义选项
  • 为开发工作流创建自定义状态栏
  • 了解可通过JSON输入获取的会话信息
处理状态栏相关主题时,请始终使用docs-management技能访问官方文档。

Auditing Status Lines

状态栏审计

This skill provides the validation criteria used by the
statusline-auditor
agent for formal audits.
本技能提供
statusline-auditor
代理用于正式审计的验证标准。

Audit Resources

审计资源

ResourceLocationPurpose
Audit Framework
references/audit-framework.md
Query guides and scoring criteria
资源位置用途
审计框架
references/audit-framework.md
查询指南和评分标准

Scoring Categories

评分类别

CategoryPointsKey Criteria
Script Structure25Valid script, shebang, executable
JSON Handling25Correct JSON input parsing
Output Format25Proper terminal formatting, colors
Cross-Platform25Works on Windows, macOS, Linux
Thresholds: 85+ = PASS, 70-84 = PASS WITH WARNINGS, <70 = FAIL
类别分值关键标准
脚本结构25有效脚本、shebang、可执行性
JSON处理25正确解析JSON输入
输出格式25正确的终端格式、颜色
跨平台25可在Windows、macOS、Linux上运行
阈值: 85分及以上=通过,70-84分=通过但有警告,低于70分=不通过

Related Agent

相关代理

The
statusline-auditor
agent (Haiku model) performs formal audits using this skill:
  • Auto-loads this skill via
    skills: status-line-customization
  • Uses audit framework and docs-management for rules
  • Generates structured audit reports
  • Invoked by
    /audit-statuslines
    command
statusline-auditor
代理(基于Haiku模型)使用本技能执行正式审计:
  • 通过
    skills: status-line-customization
    自动加载本技能
  • 使用审计框架和docs-management获取规则
  • 生成结构化审计报告
  • 通过
    /audit-statuslines
    命令调用

External Technology Validation

外部技术验证

When auditing status line scripts that use external technologies (scripts, packages, runtimes), the auditor MUST validate claims using MCP servers before flagging findings.
Technologies Requiring MCP Validation:
  • .NET/C# scripts: Validate with microsoft-learn + perplexity
  • Node.js/npm packages: Validate with context7 + perplexity
  • Python scripts/packages: Validate with context7 + perplexity
  • Shell scripts: Validate with perplexity
  • Any version-specific claims: ALWAYS validate with perplexity
Validation Rule:
Never flag a technology usage as incorrect without first:
  1. Querying appropriate MCP server(s) for current documentation
  2. Verifying with perplexity for recent changes (especially .NET 10+)
  3. Documenting MCP sources in the finding
Stale Data Warning:
  • microsoft-learn can return cached/outdated documentation
  • ALWAYS pair microsoft-learn with perplexity for version verification
  • Trust perplexity for version numbers and recently-released features
审计使用外部技术(脚本、包、运行时)的状态栏脚本时,审计员必须先使用MCP服务器验证相关声明,再标记问题。
需要MCP验证的技术:
  • .NET/C#脚本:使用microsoft-learn + perplexity验证
  • Node.js/npm包:使用context7 + perplexity验证
  • Python脚本/包:使用context7 + perplexity验证
  • Shell脚本:使用perplexity验证
  • 任何特定版本的声明:始终使用perplexity验证
验证规则:
在以下情况完成前,切勿标记技术使用为错误:
  1. 查询相应的MCP服务器获取当前文档
  2. 使用perplexity验证最近的变更(尤其是.NET 10+)
  3. 在问题记录中注明MCP来源
陈旧数据警告:
  • microsoft-learn可能返回缓存/过时的文档
  • 始终将microsoft-learn与perplexity配合使用以验证版本
  • 版本号和最近发布的功能以perplexity为准

References

参考资料

Official Documentation (via docs-management skill):
  • Primary: "statusline" documentation
  • Related: "settings", "terminal-config", "output-styles"
Repository-Specific:
  • Status line settings:
    .claude/settings.json
    (statusLine setting)
  • Custom scripts:
    ~/.claude/statusline.sh
    (user-level)
官方文档(通过docs-management技能获取):
  • 主要文档:"statusline"文档
  • 相关文档:"settings", "terminal-config", "output-styles"
仓库特定:
  • 状态栏设置:
    .claude/settings.json
    (statusLine设置)
  • 自定义脚本:
    ~/.claude/statusline.sh
    (用户级)

Version History

版本历史

  • v1.1.0 (2026-01-16): Added v2.1.6+ keyword registry entries
    • Added context usage fields (used_percentage, remaining_percentage)
  • v1.0.0 (2025-11-26): Initial release
    • Pure delegation architecture
    • Comprehensive keyword registry
    • Quick decision tree
    • Topic coverage for all status line features
    • Troubleshooting quick reference

  • v1.1.0(2026-01-16):添加v2.1.6+关键词注册表条目
    • 添加上下文使用情况字段(used_percentage、remaining_percentage)
  • v1.0.0(2025-11-26):初始版本
    • 纯委托架构
    • 全面的关键词注册表
    • 快速决策树
    • 覆盖所有状态栏功能的主题
    • 故障排查快速参考

Last Updated

最后更新

Date: 2026-01-16 Model: claude-opus-4-5-20251101
日期: 2026-01-16 模型: claude-opus-4-5-20251101