Statusline Generator A single-source-of-truth statusline for Claude Code. One script, two layouts, end-to-end self-verification. Quick health check (start here when something is wrong) Run this first whenever the statusline misbehaves. It catches the silent failures that account for most "configured but not working" reports: It validates four layers: 1. exists and is executable. Missing is the single most common silent-failure cause — Claude Code runs the script, fails, statusline goes blank. 2. has a valid block pointing at the script. 3. Mock stdin tests covering complete data, zero tokens,…

\\t' read -r model_full cwd ctx_size ctx_input ctx_cache_read ctx_cache_create ctx_pct cost_raw \u003c\u003c\u003c \"$parsed\"\n\ncwd=\"${cwd:-$PWD}\"\nctx_size=\"${ctx_size:-0}\"\nctx_used=$((${ctx_input:-0} + ${ctx_cache_read:-0} + ${ctx_cache_create:-0}))\nctx_pct_int=$(printf '%.0f' \"${ctx_pct:-0}\" 2>/dev/null || echo 0)\nshort_path=\"${cwd/#$HOME/~}\"\n\n# ---------- Helpers ----------\n# Format token counts: 999 / 108K / 1M / 1.5M\nhuman_tokens() {\n awk -v n=\"${1:-0}\" 'BEGIN {\n n = n + 0\n if (n >= 1000000) {\n m = n / 1000000\n if (m == int(m)) printf \"%dM\", m\n else printf \"%.1fM\", m\n } else if (n >= 1000) {\n printf \"%dK\", int(n/1000 + 0.5)\n } else {\n printf \"%d\", n\n }\n }'\n}\n\n# ---------- Minimal layout (default) ----------\nrender_minimal() {\n local out=\"$short_path\"\n [ -n \"$model_full\" ] && out=\"${out} ${model_full}\"\n if [ \"${ctx_size:-0}\" -gt 0 ] 2>/dev/null; then\n out=\"${out} ctx: $(human_tokens \"$ctx_used\") / $(human_tokens \"$ctx_size\")\"\n fi\n echo \"$out\"\n}\n\n# ---------- Full layout (multi-line: cost + git + percentage) ----------\nrender_full() {\n local username\n username=$(whoami)\n\n # Color threshold by ctx percentage\n local ctx_color=\"\\033[01;32m\" # green ≤50%\n if [ \"${ctx_pct_int:-0}\" -gt 80 ]; then\n ctx_color=\"\\033[01;31m\" # red >80%\n elif [ \"${ctx_pct_int:-0}\" -gt 50 ]; then\n ctx_color=\"\\033[01;33m\" # yellow 51-80%\n fi\n\n # Model name shortening: \"Sonnet 4.5 (with 1M token context)\" -> \"Sonnet 4.5 [1M]\"\n local model\n model=$(echo \"$model_full\" \\\n | sed -E 's/\\(with ([0-9]+[KM]) token context\\)/[\\1]/' \\\n | sed -E 's/\\[1m\\]/[1M]/' \\\n | sed 's/ *$//')\n\n # Git status (best-effort; silent if not a git repo or git missing)\n local git_info=\"\"\n if command -v git >/dev/null 2>&1 && \\\n git -C \"$cwd\" --no-optional-locks rev-parse --git-dir >/dev/null 2>&1; then\n local branch status=\"\"\n branch=$(git -C \"$cwd\" --no-optional-locks branch --show-current 2>/dev/null || echo \"detached\")\n if ! git -C \"$cwd\" --no-optional-locks diff --quiet 2>/dev/null || \\\n ! git -C \"$cwd\" --no-optional-locks diff --cached --quiet 2>/dev/null; then\n status=\"*\"\n fi\n if [ -n \"$(git -C \"$cwd\" --no-optional-locks ls-files --others --exclude-standard 2>/dev/null)\" ]; then\n status=\"${status}+\"\n fi\n if [ -n \"$status\" ]; then\n git_info=$(printf '\\033[01;31m[git:%s%s]\\033[00m' \"$branch\" \"$status\")\n else\n git_info=$(printf '\\033[01;33m[git:%s]\\033[00m' \"$branch\")\n fi\n fi\n\n # Cost via ccusage (cached, async; silent if ccusage unavailable)\n local cost_info=\"\"\n if command -v ccusage >/dev/null 2>&1; then\n local cache_file=\"/tmp/claude_cost_cache_$(date +%Y%m%d_%H%M).txt\"\n find /tmp -maxdepth 1 -name \"claude_cost_cache_*.txt\" -mmin +2 -delete 2>/dev/null\n if [ -f \"$cache_file\" ]; then\n cost_info=$(cat \"$cache_file\")\n else\n {\n local session daily\n if command -v jq >/dev/null 2>&1; then\n session=$(ccusage session --json --offline -o desc 2>/dev/null | jq -r '.sessions[0].totalCost // 0' | xargs printf \"%.2f\" 2>/dev/null)\n daily=$(ccusage daily --json --offline -o desc 2>/dev/null | jq -r '.daily[0].totalCost // 0' | xargs printf \"%.2f\" 2>/dev/null)\n else\n session=$(ccusage session --json --offline -o desc 2>/dev/null | python3 -c \"import json,sys; d=json.load(sys.stdin); s=d.get('sessions',[{}])[0]; print(f\\\"{s.get('totalCost',0):.2f}\\\")\" 2>/dev/null)\n daily=$(ccusage daily --json --offline -o desc 2>/dev/null | python3 -c \"import json,sys; d=json.load(sys.stdin); s=d.get('daily',[{}])[0]; print(f\\\"{s.get('totalCost',0):.2f}\\\")\" 2>/dev/null)\n fi\n if [ -n \"$session\" ] && [ -n \"$daily\" ]; then\n printf ' \\033[01;35m[$%s/$%s]\\033[00m' \"$session\" \"$daily\" > \"$cache_file\"\n fi\n } &\n local prev_cache\n prev_cache=$(find /tmp -maxdepth 1 -name \"claude_cost_cache_*.txt\" -mmin -10 2>/dev/null | head -1)\n [ -f \"$prev_cache\" ] && cost_info=$(cat \"$prev_cache\")\n fi\n fi\n\n # Context display\n local ctx_display=\"\"\n if [ \"${ctx_size:-0}\" -gt 0 ] 2>/dev/null; then\n ctx_display=$(printf \" ${ctx_color}ctx: %s/%s (%s%%)\\033[00m\" \\\n \"$(human_tokens \"$ctx_used\")\" \"$(human_tokens \"$ctx_size\")\" \"$ctx_pct_int\")\n fi\n\n # Three lines: header / path / git\n printf '\\033[01;32m%s\\033[00m \\033[01;36m(%s)\\033[00m%s%s\\n\\033[01;37m%s\\033[00m\\n%s' \\\n \"$username\" \"$model\" \"$cost_info\" \"$ctx_display\" \"$short_path\" \"$git_info\"\n}\n\ncase \"$LAYOUT\" in\n full) render_full ;;\n minimal|*) render_minimal ;;\nesac\n","content_type":"application/x-sh; charset=utf-8","language":"bash","size":7307,"content_sha256":"fbea0291ce34e7724325e331d7de195adabf29123ebb3e1aafb442edd37f2eb8"},{"filename":"scripts/health_check.sh","content":"#!/usr/bin/env bash\n# Statusline health check — verify configuration end-to-end.\n#\n# Runs four layers of verification:\n# 1. Script exists and is executable (chmod +x).\n# 2. settings.json points to the script and uses type=command.\n# 3. Mock stdin tests (minimal + edge cases) — script must output expected shape.\n# 4. Real stdin replay (if /tmp/.claude-statusline-last-stdin.json exists from CLAUDE_STATUSLINE_DEBUG).\n#\n# Usage:\n# bash health_check.sh # checks ~/.claude/statusline.sh\n# bash health_check.sh /custom/path.sh # checks custom script\n\nset -u\n\nSCRIPT_PATH=\"${1:-$HOME/.claude/statusline.sh}\"\nSETTINGS_FILE=\"$HOME/.claude/settings.json\"\nDEBUG_DUMP=\"/tmp/.claude-statusline-last-stdin.json\"\n\n# Color output only if stdout is a terminal\nif [ -t 1 ]; then\n G='\\033[01;32m'; R='\\033[01;31m'; Y='\\033[01;33m'; B='\\033[01;36m'; N='\\033[00m'\nelse\n G=''; R=''; Y=''; B=''; N=''\nfi\n\nPASS=0\nFAIL=0\nWARN=0\n\nok() { printf \"${G}✓${N} %s\\n\" \"$1\"; PASS=$((PASS+1)); }\nfail() { printf \"${R}✗${N} %s\\n\" \"$1\"; [ -n \"${2:-}\" ] && printf \" ${B}fix:${N} %s\\n\" \"$2\"; FAIL=$((FAIL+1)); }\nwarn() { printf \"${Y}⚠${N} %s\\n\" \"$1\"; [ -n \"${2:-}\" ] && printf \" ${B}note:${N} %s\\n\" \"$2\"; WARN=$((WARN+1)); }\nsection() { printf \"\\n${B}== %s ==${N}\\n\" \"$1\"; }\n\n# ---------- 1. Script existence + permissions ----------\nsection \"1. Script file\"\n\nif [ ! -f \"$SCRIPT_PATH\" ]; then\n fail \"Script not found: $SCRIPT_PATH\" \"copy generate_statusline.sh from this skill to that path\"\n echo\n printf \"${R}HARD FAIL — cannot continue checks${N}\\n\"\n exit 1\nfi\nok \"Script exists: $SCRIPT_PATH\"\n\nif [ ! -x \"$SCRIPT_PATH\" ]; then\n fail \"Script not executable (this is the #1 silent-failure cause)\" \"chmod +x '$SCRIPT_PATH'\"\nelse\n ok \"Script is executable (chmod +x)\"\nfi\n\n# ---------- 2. settings.json wiring ----------\nsection \"2. settings.json wiring\"\n\nif [ ! -f \"$SETTINGS_FILE\" ]; then\n fail \"settings.json not found: $SETTINGS_FILE\" \"create it with statusLine block, see SKILL.md Quick Start\"\nelif command -v jq >/dev/null 2>&1; then\n sl_type=$(jq -r '.statusLine.type // \"MISSING\"' \"$SETTINGS_FILE\" 2>/dev/null)\n sl_cmd=$(jq -r '.statusLine.command // \"MISSING\"' \"$SETTINGS_FILE\" 2>/dev/null)\n\n if [ \"$sl_type\" = \"MISSING\" ]; then\n fail \"settings.json has no statusLine block\" \"run install_statusline.sh\"\n elif [ \"$sl_type\" != \"command\" ]; then\n fail \"statusLine.type is '$sl_type', expected 'command'\" \"set statusLine.type to \\\"command\\\"\"\n else\n ok \"statusLine.type = command\"\n fi\n\n if [ \"$sl_cmd\" = \"MISSING\" ]; then\n fail \"statusLine.command is missing\" \"set it to a path or shell command\"\n else\n # Expand ~ for comparison\n sl_cmd_expanded=\"${sl_cmd/#\\~/$HOME}\"\n # Strip leading \"bash \" if user wrapped it\n sl_cmd_stripped=\"${sl_cmd_expanded#bash }\"\n if [ \"$sl_cmd_stripped\" = \"$SCRIPT_PATH\" ] || [ \"$sl_cmd_expanded\" = \"$SCRIPT_PATH\" ]; then\n ok \"statusLine.command points to $SCRIPT_PATH\"\n else\n warn \"statusLine.command = '$sl_cmd' (expected to reference $SCRIPT_PATH)\" \\\n \"edit settings.json statusLine.command if you intended to use this script\"\n fi\n fi\nelse\n warn \"jq not installed — cannot validate settings.json structure\" \"brew install jq (or apt install jq)\"\nfi\n\n# ---------- 3. Mock stdin tests ----------\nsection \"3. Mock stdin tests (minimal layout)\"\n\nrun_mock() {\n local label=\"$1\" json=\"$2\" expect_pattern=\"$3\"\n local out\n out=$(echo \"$json\" | \"$SCRIPT_PATH\" 2>&1)\n if echo \"$out\" | grep -Eq \"$expect_pattern\"; then\n ok \"$label\"\n printf \" output: %s\\n\" \"$out\"\n else\n fail \"$label — output didn't match expected shape\" \"expected pattern: $expect_pattern; got: $out\"\n fi\n}\n\n# Test 1: complete data\nrun_mock \"complete data → renders cwd + model + ctx\" \\\n '{\"workspace\":{\"current_dir\":\"/tmp/test\"},\"model\":{\"display_name\":\"TestModel\"},\"context_window\":{\"context_window_size\":1000000,\"current_usage\":{\"input_tokens\":50000,\"cache_read_input_tokens\":0,\"cache_creation_input_tokens\":50000}}}' \\\n 'TestModel.*ctx: 100K / 1M'\n\n# Test 2: zero tokens (session start)\nrun_mock \"0 tokens (session just started)\" \\\n '{\"workspace\":{\"current_dir\":\"/tmp/test\"},\"model\":{\"display_name\":\"M\"},\"context_window\":{\"context_window_size\":1000000,\"current_usage\":{\"input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation_input_tokens\":0}}}' \\\n 'ctx: 0 / 1M'\n\n# Test 3: missing context_window entirely\nrun_mock \"missing context_window field → no ctx segment\" \\\n '{\"workspace\":{\"current_dir\":\"/tmp/test\"},\"model\":{\"display_name\":\"M\"}}' \\\n '/tmp/test M'\n\n# Test 4: cwd in HOME → tilde shortening\nrun_mock \"cwd in HOME → ~ short path\" \\\n \"{\\\"workspace\\\":{\\\"current_dir\\\":\\\"$HOME/x/y\\\"},\\\"model\\\":{\\\"display_name\\\":\\\"M\\\"}}\" \\\n '~/x/y'\n\n# ---------- 4. Real stdin replay (if available) ----------\nsection \"4. Real stdin replay\"\n\nif [ -f \"$DEBUG_DUMP\" ]; then\n out=$(cat \"$DEBUG_DUMP\" | \"$SCRIPT_PATH\" 2>&1)\n if [ -n \"$out\" ]; then\n ok \"Real stdin from $DEBUG_DUMP renders successfully\"\n printf \" output: %s\\n\" \"$out\"\n else\n fail \"Real stdin produced empty output\" \"inspect $DEBUG_DUMP and run: cat $DEBUG_DUMP | $SCRIPT_PATH\"\n fi\nelse\n warn \"No real stdin dump available at $DEBUG_DUMP\" \\\n \"to capture: export CLAUDE_STATUSLINE_DEBUG=1, send any message in Claude Code, re-run this check\"\nfi\n\n# ---------- Summary ----------\nsection \"Summary\"\nprintf \"Pass: ${G}%d${N} Fail: ${R}%d${N} Warn: ${Y}%d${N}\\n\" \"$PASS\" \"$FAIL\" \"$WARN\"\n\nif [ \"$FAIL\" -gt 0 ]; then\n exit 1\nfi\nexit 0\n","content_type":"application/x-sh; charset=utf-8","language":"bash","size":5692,"content_sha256":"6748b94e4f7cd3e7f4d995f8b7b859b54c62548f0d61ef865d7eecceef5c60aa"},{"filename":"scripts/install_statusline.sh","content":"#!/usr/bin/env bash\n# Install statusline script + wire settings.json + run health check.\n#\n# After install, the script always finishes with a health_check.sh run so the\n# user sees concrete pass/fail evidence (not just \"Installation complete\").\n# This prevents the silent-failure mode where chmod is forgotten or the\n# settings.json command points to the wrong path.\n#\n# Usage:\n# bash install_statusline.sh # install to ~/.claude/statusline.sh\n# bash install_statusline.sh /custom/path.sh # install to custom path\n\nset -e\n\nTARGET_PATH=\"${1:-$HOME/.claude/statusline.sh}\"\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nSOURCE_SCRIPT=\"$SCRIPT_DIR/generate_statusline.sh\"\nHEALTH_CHECK=\"$SCRIPT_DIR/health_check.sh\"\nSETTINGS_FILE=\"$HOME/.claude/settings.json\"\nTARGET_DIR=$(dirname \"$TARGET_PATH\")\n\nif [ ! -f \"$SOURCE_SCRIPT\" ]; then\n echo \"ERROR: generate_statusline.sh not found at $SOURCE_SCRIPT\" >&2\n exit 1\nfi\n\nif [ ! -d \"$TARGET_DIR\" ]; then\n echo \">> Creating directory: $TARGET_DIR\"\n mkdir -p \"$TARGET_DIR\"\nfi\n\n# Backup existing target script if present\nif [ -f \"$TARGET_PATH\" ]; then\n backup=\"$TARGET_PATH.bak.$(date +%Y%m%d_%H%M%S)\"\n echo \">> Backing up existing script: $backup\"\n cp \"$TARGET_PATH\" \"$backup\"\nfi\n\necho \">> Installing: $SOURCE_SCRIPT -> $TARGET_PATH\"\ncp \"$SOURCE_SCRIPT\" \"$TARGET_PATH\"\nchmod +x \"$TARGET_PATH\" # critical — silent failure root cause if missed\n\n# Wire settings.json\nif [ ! -f \"$SETTINGS_FILE\" ]; then\n echo \">> Creating new settings.json with statusLine block\"\n cat > \"$SETTINGS_FILE\" \u003c\u003cEOF\n{\n \"statusLine\": {\n \"type\": \"command\",\n \"command\": \"$TARGET_PATH\",\n \"padding\": 0\n }\n}\nEOF\nelif command -v jq >/dev/null 2>&1; then\n settings_backup=\"$SETTINGS_FILE.bak.$(date +%Y%m%d_%H%M%S)\"\n cp \"$SETTINGS_FILE\" \"$settings_backup\"\n echo \">> Backed up settings.json: $settings_backup\"\n\n tmp=$(mktemp)\n jq --arg cmd \"$TARGET_PATH\" \\\n '.statusLine = {\"type\":\"command\",\"command\":$cmd,\"padding\":(.statusLine.padding // 0)}' \\\n \"$SETTINGS_FILE\" > \"$tmp\"\n mv \"$tmp\" \"$SETTINGS_FILE\"\n echo \">> Updated settings.json statusLine.command -> $TARGET_PATH\"\nelse\n echo \"WARN: jq not installed — cannot safely edit settings.json\" >&2\n echo \" Manually set statusLine.command to: $TARGET_PATH\" >&2\nfi\n\n# ---- Mandatory health check (do not let the user discover failures themselves) ----\necho\necho \"== Running health check ==\"\nif [ -x \"$HEALTH_CHECK\" ] || bash \"$HEALTH_CHECK\" --help >/dev/null 2>&1; then\n bash \"$HEALTH_CHECK\" \"$TARGET_PATH\" || {\n echo\n echo \"WARN: Health check reported issues. Review the output above.\" >&2\n echo \" Re-run anytime: bash $HEALTH_CHECK $TARGET_PATH\" >&2\n exit 1\n }\nelse\n echo \"WARN: health_check.sh not found or not executable — skipping post-install verification\" >&2\nfi\n\necho\necho \"Installation complete.\"\necho\necho \"Usage:\"\necho \" Default : minimal one-line layout (cwd + model + ctx tokens)\"\necho \" Full layout : add to ~/.zshrc or ~/.bashrc:\"\necho \" export CLAUDE_STATUSLINE_LAYOUT=full\"\necho \" (multi-line with cost via ccusage + git status + percentage)\"\necho \" Debug stdin : export CLAUDE_STATUSLINE_DEBUG=1\"\necho \" dumps each invocation's stdin to /tmp/.claude-statusline-last-stdin.json\"\necho\necho \"Verify anytime: bash $HEALTH_CHECK\"\n","content_type":"application/x-sh; charset=utf-8","language":"bash","size":3443,"content_sha256":"4c61274abff2b3ff328650814b94185401c95c5615863c680ac20b6bd82def79"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"Statusline Generator","type":"text"}]},{"type":"paragraph","content":[{"text":"A single-source-of-truth statusline for Claude Code. One script, two layouts, end-to-end self-verification.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Quick health check (start here when something is wrong)","type":"text"}]},{"type":"paragraph","content":[{"text":"Run this first whenever the statusline misbehaves. It catches the silent failures that account for most \"configured but not working\" reports:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"bash scripts/health_check.sh","type":"text"}]},{"type":"paragraph","content":[{"text":"It validates four layers:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"~/.claude/statusline.sh","type":"text","marks":[{"type":"code_inline"}]},{"text":" exists and is executable. ","type":"text"},{"text":"Missing ","type":"text","marks":[{"type":"strong"}]},{"text":"chmod +x","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" is the single most common silent-failure cause","type":"text","marks":[{"type":"strong"}]},{"text":" — Claude Code runs the script, ","type":"text"},{"text":"exec","type":"text","marks":[{"type":"code_inline"}]},{"text":" fails, statusline goes blank.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"~/.claude/settings.json","type":"text","marks":[{"type":"code_inline"}]},{"text":" has a valid ","type":"text"},{"text":"statusLine","type":"text","marks":[{"type":"code_inline"}]},{"text":" block pointing at the script.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Mock stdin tests covering complete data, zero tokens, missing fields, and ","type":"text"},{"text":"$HOME","type":"text","marks":[{"type":"code_inline"}]},{"text":" path shortening.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Real stdin replay from ","type":"text"},{"text":"/tmp/.claude-statusline-last-stdin.json","type":"text","marks":[{"type":"code_inline"}]},{"text":" if you previously ran with ","type":"text"},{"text":"CLAUDE_STATUSLINE_DEBUG=1","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Each failure prints a one-line fix command — you don't have to read documentation to recover.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Quick install","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"bash scripts/install_statusline.sh","type":"text"}]},{"type":"paragraph","content":[{"text":"This script:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Backs up any existing ","type":"text"},{"text":"~/.claude/statusline.sh","type":"text","marks":[{"type":"code_inline"}]},{"text":" and ","type":"text"},{"text":"settings.json","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Copies ","type":"text"},{"text":"generate_statusline.sh","type":"text","marks":[{"type":"code_inline"}]},{"text":" to ","type":"text"},{"text":"~/.claude/statusline.sh","type":"text","marks":[{"type":"code_inline"}]},{"text":" and ","type":"text"},{"text":"chmod +x","type":"text","marks":[{"type":"code_inline"}]},{"text":"s it.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Updates ","type":"text"},{"text":"settings.json","type":"text","marks":[{"type":"code_inline"}]},{"text":" ","type":"text"},{"text":"statusLine","type":"text","marks":[{"type":"code_inline"}]},{"text":" block via ","type":"text"},{"text":"jq","type":"text","marks":[{"type":"code_inline"}]},{"text":" (preserves other settings).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Mandatorily runs ","type":"text","marks":[{"type":"strong"}]},{"text":"health_check.sh","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" and shows the result","type":"text","marks":[{"type":"strong"}]},{"text":" — installation is not \"complete\" until verification passes.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Restart Claude Code (or send any new message) to see the statusline update.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"What you get","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Default — minimal one-line layout","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"~/code/myproject Opus 4.7 (1M context) ctx: 108K / 1M","type":"text"}]},{"type":"paragraph","content":[{"text":"Just the essentials: short path, model name, absolute token counts. No colors, no git, no cost, no percentage. Designed for users who want signal without noise.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Full — multi-line with cost and git","type":"text"}]},{"type":"paragraph","content":[{"text":"Set ","type":"text"},{"text":"CLAUDE_STATUSLINE_LAYOUT=full","type":"text","marks":[{"type":"code_inline"}]},{"text":" in your shell profile to enable:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"alex (Sonnet 4.6) [$0.42/$25.93] ctx: 108K/1M (11%)\n~/code/myproject\n[git:main*+]","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Line 1: user, model, ccusage session/daily costs, color-coded ctx (green ≤50%, yellow 51–80%, red >80%).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Line 2: short path.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Line 3: git branch with ","type":"text"},{"text":"*","type":"text","marks":[{"type":"code_inline"}]},{"text":" for modified, ","type":"text"},{"text":"+","type":"text","marks":[{"type":"code_inline"}]},{"text":" for untracked.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Layouts: how to switch","type":"text"}]},{"type":"paragraph","content":[{"text":"The script reads layout from environment, not flags (Claude Code passes JSON on stdin, so flags would conflict). Set in ","type":"text"},{"text":"~/.zshrc","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"~/.bashrc","type":"text","marks":[{"type":"code_inline"}]},{"text":":","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Minimal (default — same as not setting it)\nexport CLAUDE_STATUSLINE_LAYOUT=minimal\n\n# Full\nexport CLAUDE_STATUSLINE_LAYOUT=full","type":"text"}]},{"type":"paragraph","content":[{"text":"Restart your shell (or ","type":"text"},{"text":"source","type":"text","marks":[{"type":"code_inline"}]},{"text":" the rc file) so Claude Code inherits the change, then send a message — statusline refreshes within 300ms.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Debug stdin capture","type":"text"}]},{"type":"paragraph","content":[{"text":"To see exactly what JSON Claude Code sends your script:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"export CLAUDE_STATUSLINE_DEBUG=1","type":"text"}]},{"type":"paragraph","content":[{"text":"Each invocation writes its stdin to ","type":"text"},{"text":"/tmp/.claude-statusline-last-stdin.json","type":"text","marks":[{"type":"code_inline"}]},{"text":" (overwriting on every refresh). Inspect with ","type":"text"},{"text":"jq .","type":"text","marks":[{"type":"code_inline"}]},{"text":". Useful for:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Diagnosing why a field doesn't render the way you expect.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Re-running the script against real input: ","type":"text"},{"text":"cat /tmp/.claude-statusline-last-stdin.json | ~/.claude/statusline.sh","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Filing bug reports — paste the dump as ground truth.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Authoring rules (why this skill is shaped this way)","type":"text"}]},{"type":"paragraph","content":[{"text":"Two production failure modes drove the current design. Both are sealed in code, not just docs:","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Rule 1 — Always ","type":"text"},{"text":"chmod +x","type":"text","marks":[{"type":"code_inline"}]},{"text":", always verify by running","type":"text"}]},{"type":"paragraph","content":[{"text":"The single biggest silent-failure cause of any statusline is a script without the executable bit: Claude Code's ","type":"text"},{"text":"exec","type":"text","marks":[{"type":"code_inline"}]},{"text":" fails silently and the bar goes blank with no error. ","type":"text"},{"text":"install_statusline.sh","type":"text","marks":[{"type":"code_inline"}]},{"text":" always ","type":"text"},{"text":"chmod +x","type":"text","marks":[{"type":"code_inline"}]},{"text":"s; ","type":"text"},{"text":"health_check.sh","type":"text","marks":[{"type":"code_inline"}]},{"text":" flags the bit if missing. ","type":"text"},{"text":"If you hand-write or hand-edit a statusline script, mock-test it before declaring done:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"echo '{}' | bash your-script.sh","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Rule 2 — \"Configuration complete\" is meaningless without evidence","type":"text"}]},{"type":"paragraph","content":[{"text":"\"Wrote the file and updated settings.json\" is not the same as \"the script runs and produces the expected output.\" ","type":"text"},{"text":"install_statusline.sh","type":"text","marks":[{"type":"code_inline"}]},{"text":" therefore always runs ","type":"text"},{"text":"health_check.sh","type":"text","marks":[{"type":"code_inline"}]},{"text":" at the end and exits non-zero if any check fails. Treat any \"complete!\" report from any agent that lacks evidence as suspect.","type":"text"}]},{"type":"paragraph","content":[{"text":"For field-level traps (","type":"text"},{"text":"used_percentage","type":"text","marks":[{"type":"code_inline"}]},{"text":" null at session start, ","type":"text"},{"text":"total_input_tokens","type":"text","marks":[{"type":"code_inline"}]},{"text":" semantics across Claude Code versions, hardcoded ","type":"text"},{"text":"context_window_size","type":"text","marks":[{"type":"code_inline"}]},{"text":"), see ","type":"text"},{"text":"references/context-window-schema.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/context-window-schema.md","title":null}},{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Customization","type":"text"}]},{"type":"paragraph","content":[{"text":"For colors, custom segments (hostname, time, etc.), and disabling cost tracking, see ","type":"text"},{"text":"references/customization.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/customization.md","title":null}},{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Dependencies","type":"text"}]},{"type":"paragraph","content":[{"text":"The script auto-detects available tools and degrades gracefully:","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Tool","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Required for","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Fallback","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"jq","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"JSON parsing (preferred)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"falls back to ","type":"text"},{"text":"python3","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"python3","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"JSON parsing fallback","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"bare ","type":"text"},{"text":"cwd","type":"text","marks":[{"type":"code_inline"}]},{"text":" only","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"awk","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"token K/M formatting","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"required by both layouts","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"git","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"git status (full layout)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"silent skip if missing or not in repo","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"ccusage","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"cost (full layout)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"silent skip if missing","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"Install on macOS: ","type":"text"},{"text":"brew install jq","type":"text","marks":[{"type":"code_inline"}]},{"text":". On Debian/Ubuntu: ","type":"text"},{"text":"apt install jq","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Troubleshooting","type":"text"}]},{"type":"paragraph","content":[{"text":"For symptom-by-symptom diagnostics, see ","type":"text"},{"text":"references/troubleshooting-decision-tree.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/troubleshooting-decision-tree.md","title":null}},{"type":"code_inline"}]},{"text":". It walks through:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Statusline blank or never updates (chmod cause)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"ctx segment missing or wrong (field traps)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Want token counts not percentages (layout switch)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Colors render as raw escape codes (terminal compatibility)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Git segment missing (full layout)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Cost segment missing (ccusage / cache)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Edits have no effect (path mismatch)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Slow refresh (jq vs python3)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Resources","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"File","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Purpose","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"scripts/generate_statusline.sh","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"The statusline script. Single source of truth. Two layouts via ","type":"text"},{"text":"CLAUDE_STATUSLINE_LAYOUT","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"scripts/install_statusline.sh","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Idempotent installer. Backs up, copies, chmods, wires ","type":"text"},{"text":"settings.json","type":"text","marks":[{"type":"code_inline"}]},{"text":", runs health check.","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"scripts/health_check.sh","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Four-layer verification: file perms, settings.json wiring, mock stdin tests, real stdin replay.","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/troubleshooting-decision-tree.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Symptom-driven diagnostic flowchart. Load when statusline misbehaves.","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/customization.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Color changes, custom segments, threshold tuning, single-line full layout. Load when user wants to modify how the statusline looks.","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/context-window-schema.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Claude Code statusline JSON schema. Documents every field plus ","type":"text"},{"text":"current_usage","type":"text","marks":[{"type":"code_inline"}]},{"text":" vs ","type":"text"},{"text":"total_input_tokens","type":"text","marks":[{"type":"code_inline"}]},{"text":" semantics across versions.","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/color_codes.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"ANSI color codes reference. Load for color customization.","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/ccusage_integration.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"ccusage integration deep-dive: caching, JSON shape, troubleshooting. Load for cost-related issues.","type":"text"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}}]},"metadata":{"date":"2026-06-05","name":"statusline-generator","author":"@skillopedia","source":{"stars":1137,"repo_name":"claude-code-skills","origin_url":"https://github.com/daymade/claude-code-skills/blob/HEAD/daymade-claude-code/statusline-generator/SKILL.md","repo_owner":"daymade","body_sha256":"5fd1a872b03a8781de9e6c654351a43bfec695d5caf4154ad422f3c52c3f1304","cluster_key":"5be0ea1c71340ed3d904d198f013e20ac563b15899b87abd43b9c2a5308fd691","clean_bundle":{"format":"clean-skill-bundle-v1","source":"daymade/claude-code-skills/daymade-claude-code/statusline-generator/SKILL.md","attachments":[{"id":"cc9f4d82-5179-519d-a272-48ba90495393","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/cc9f4d82-5179-519d-a272-48ba90495393/attachment.md","path":"references/ccusage_integration.md","size":4198,"sha256":"c3dfa7bd37215cf9a3d16fdb66c207849a421d3f4eee9b70d0ad5009056194d0","contentType":"text/markdown; charset=utf-8"},{"id":"6291b698-d5a7-5406-8c7d-d899dcfc3ca6","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6291b698-d5a7-5406-8c7d-d899dcfc3ca6/attachment.md","path":"references/color_codes.md","size":2326,"sha256":"a6ae34ae696fc31f4e7752ff3f9b6087b9e33da7c4cc58f7eaa27fa4413a1f0c","contentType":"text/markdown; charset=utf-8"},{"id":"3fb2dab8-61de-5651-9a56-103ea46c8f88","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/3fb2dab8-61de-5651-9a56-103ea46c8f88/attachment.md","path":"references/context-window-schema.md","size":3905,"sha256":"5ee67c488fc1f04bd5631686b4e88d89f52eac926ee4f6a2c1215f4d0954733f","contentType":"text/markdown; charset=utf-8"},{"id":"9ad2ac0d-31c6-5716-af62-eb739891d912","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/9ad2ac0d-31c6-5716-af62-eb739891d912/attachment.md","path":"references/customization.md","size":3856,"sha256":"d7819d9b95c0da15e359677532a2dc8f53caf4022860f21291406ca256db080a","contentType":"text/markdown; charset=utf-8"},{"id":"1b69053b-6a35-5057-8fd2-bcefce7bf5a5","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/1b69053b-6a35-5057-8fd2-bcefce7bf5a5/attachment.md","path":"references/troubleshooting-decision-tree.md","size":7719,"sha256":"a2543ebbe8659e0bdb7b3c8535628a01fa963e043868bfc4dcfaba3a8bcc6685","contentType":"text/markdown; charset=utf-8"},{"id":"e99e5d89-56ee-5739-a16b-c5ee08c8ed95","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/e99e5d89-56ee-5739-a16b-c5ee08c8ed95/attachment.sh","path":"scripts/generate_statusline.sh","size":7307,"sha256":"fbea0291ce34e7724325e331d7de195adabf29123ebb3e1aafb442edd37f2eb8","contentType":"application/x-sh; charset=utf-8"},{"id":"29a26ec4-15af-5b96-bed5-d21f26db1a3b","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/29a26ec4-15af-5b96-bed5-d21f26db1a3b/attachment.sh","path":"scripts/health_check.sh","size":5692,"sha256":"6748b94e4f7cd3e7f4d995f8b7b859b54c62548f0d61ef865d7eecceef5c60aa","contentType":"application/x-sh; charset=utf-8"},{"id":"39d31c33-8274-5672-9a9c-9745766e7c2c","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/39d31c33-8274-5672-9a9c-9745766e7c2c/attachment.sh","path":"scripts/install_statusline.sh","size":3443,"sha256":"4c61274abff2b3ff328650814b94185401c95c5615863c680ac20b6bd82def79","contentType":"application/x-sh; charset=utf-8"}],"bundle_sha256":"3527ecf7020911bcd1d05228fcad31a93b69b0bfc01cf5f1258265da83d12b71","attachment_count":8,"text_attachments":8,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":0,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"daymade-claude-code/statusline-generator/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"design-ux","category_label":"Design"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"design-ux","import_tag":"clean-skills-v1","description":"Install, configure, customize, or troubleshoot the Claude Code statusline (the line above the prompt with cwd, model, and token counts). Use when the user wants to set up or change the statusline, switch between minimal and full layouts, show absolute token counts (e.g. ctx 108K / 1M) instead of a percentage, add cost via ccusage or git status, or fix a statusline that is blank, silent, stuck, shows \"permission denied\", or stopped updating after a script edit (commonly a missing chmod +x). Also covers debug-dumping the stdin JSON Claude Code passes the script. Trigger phrases include \"configure statusline\", \"statusline blank\", \"status line not showing\", \"statusline broken\", \"show token count in statusline\", 状态栏, 状态栏不显示, 状态栏空白, 显示工作目录, 显示 token 数."}},"renderedAt":1782980720314}

Statusline Generator A single-source-of-truth statusline for Claude Code. One script, two layouts, end-to-end self-verification. Quick health check (start here when something is wrong) Run this first whenever the statusline misbehaves. It catches the silent failures that account for most "configured but not working" reports: It validates four layers: 1. exists and is executable. Missing is the single most common silent-failure cause — Claude Code runs the script, fails, statusline goes blank. 2. has a valid block pointing at the script. 3. Mock stdin tests covering complete data, zero tokens,…