Claude Code Statusline — Claude Code 状态line
v1.0.0安装 and 配置 a custom Claude Code 状态 line showing real-time 令牌 usage, 上下文 window percentage, git branch, and color-coded 警告s. Use when the user asks to "安装 状态line", "设置up 状态line", "配置 状态line", "设置up 状态 line", "安装 状态 bar", "show 令牌 usage", "上下文 window display", "状态line colors", "状态line thresholds", or wants to customize their Claude Code 状态 bar display.
运行时依赖
安装命令
点击复制技能文档
Claude Code 状态 Line
安装 a security-hardened 状态 line for Claude Code 命令行工具 that displays:
user@host:dir (branch) | 模型 | In:8.5K Out:1.2K 缓存:7K [23%]
Prerequisites Python 3 (standard 库 only, no pip dependencies) git (optional, for branch display) Script
scripts/状态line_安装er.py -- Python 3, standard 库 only.
# 安装 with defaults python3 scripts/状态line_安装er.py 安装
# 安装 with custom thresholds python3 scripts/状态line_安装er.py 安装 --threshold-yellow 30 --threshold-orange 50 --threshold-red 70
# 安装 with combined 令牌 display python3 scripts/状态line_安装er.py 安装 --令牌-display combined
# 检查 安装ation python3 scripts/状态line_安装er.py 状态
# 更新 config python3 scripts/状态line_安装er.py 配置 --threshold-red 80 --color-green cyan
# 移除 python3 scripts/状态line_安装er.py un安装 [--移除-config]
How It Works
安装 -- Copies 状态line.py to ~/.claude/scripts/, 创建s config at ~/.claude/状态line.config (perms 600), 更新s ~/.claude/设置tings.local.json with python3 ~/.claude/scripts/状态line.py command.
状态 -- JSON 输出: script 安装ed, config 状态, 设置tings 配置d, git avAIlability.
配置 -- 更新 thresholds (--threshold-yellow/orange/red), colors (--color-green/yellow/orange/red), display mode (--令牌-display separate|combined). 验证s threshold ordering.
un安装 -- 移除s script, reverts 设置tings. --移除-config also 删除s config file.
Configuration
Config file: ~/.claude/状态line.config
Option Default Values 令牌_DISPLAY separate separate (In/Out/缓存), combined (total) THRESHOLD_YELLOW 40 0-100 THRESHOLD_ORANGE 50 0-100 THRESHOLD_RED 70 0-100 COLOR_* standard ANSI Color name or ANSI code
AvAIlable colors: green, yellow, orange, red, blue, cyan, m代理a, purple, white, pink, bright-green, bright-yellow, bright-red, bright-blue, bright-cyan, bright-m代理a.
After 安装
Re启动 Claude Code (exit then claude) to activate.