statusline-config

Customize Claude Code statusline. Use when: user says 'statusline', 'status line', 'customize statusline', 'modify statusline', 'statusline settings', 'statusline theme', 'change theme', 'color scheme', wants to add/remove/change segments (cost, git, model, context), switch color themes (catppuccin, dracula, nord), or asks what can be shown in the statusline.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "statusline-config" with this command: npx skills add sd0xdev/sd0x-dev-flow/sd0xdev-sd0x-dev-flow-statusline-config

StatusLine Config

Customize ~/.claude/statusline-command.sh — segments, themes, and colors.

When NOT to Use

ScenarioUse Instead
Setting statusline for the first time (no customization needed)Built-in statusline-setup agent (Claude Code agent type) — applies defaults automatically
Editing settings.json directlyManual edit — this skill manages statusline-command.sh, not settings.json
Debugging Claude Code startup issues/claude-health — config health check

Segments

SegmentJSON FieldDefaultNotes
Directoryworkspace.current_dirONTruncate deep paths: ~/.../last-dir
Git branchshell gitON--no-optional-locks, cache 5s
Modelmodel.display_nameON-
Context %context_window.remaining_percentageONGreen >40%, Yellow 20-40%, Red <=20%
Costcost.total_cost_usdONShow when >= $0.005, est $X.XX
>200k alertexceeds_200k_tokensONShow only when true

For full JSON schema, see json-schema.md.

Themes

ThemeTypeDefaultNotes
ansi-defaultANSI 16Safe fallback, works everywhere
catppuccin-mochaTrueColorRecommended — pastel, WCAG AA >=4.5:1
draculaTrueColorVibrant purple/pink accents
nordTrueColorArctic blue, muted tones
noneNo colors (NO_COLOR auto-triggers)

Switch via: export CLAUDE_STATUSLINE_THEME=catppuccin-mocha

For complete token→hex mappings, see themes.md.

Semantic Tokens

Scripts use semantic tokens instead of hardcoded colors:

TokenRoleExample
C_CWDDirectory pathblue / sapphire
C_BRANCHGit branch namemagenta / mauve
C_MODELModel display namecyan / teal
C_CTX_OKContext >= 41%green
C_CTX_WARNContext 21-40%yellow
C_CTX_BADContext <= 20%red
C_COSTCost displaymuted text
C_ALERT>200k token warningorange/peach + bold
C_SEPPipe separator |dim/overlay
C_MUTEDSecondary infosubtext
C_TEXTGeneral textforeground
C_RESETReset all formatting\033[0m

Workflow

No args → Apply best-practice defaults (all ON segments + ansi-default theme). Go to step 4.

Theme change (e.g. "use catppuccin-mocha", "switch to dracula") → Read themes.md, apply requested theme. Go to step 4. Aliases: catppuccincatppuccin-mocha.

Custom requests (e.g. "add cost", "remove git", "no colors") → Interactive flow:

  1. Read current script: cat ~/.claude/statusline-command.sh
  2. Ask segments to enable/disable (AskUserQuestion multiSelect)
  3. Ask theme preference (AskUserQuestion with theme options)
  4. Generate script following Script Rules + selected theme from themes.md
  5. Write to ~/.claude/statusline-command.sh
  6. Verify: echo '{"model":{"display_name":"Opus 4.6"},"workspace":{"current_dir":"/tmp/test"},"context_window":{"remaining_percentage":55},"cost":{"total_cost_usd":0.42},"exceeds_200k_tokens":false}' | ~/.claude/statusline-command.sh

Script Rules

  • Shebang: #!/bin/sh (POSIX)
  • Read stdin: input=$(cat)
  • Parse JSON: jq -r '.field // fallback'
  • Theme from env: theme="${CLAUDE_STATUSLINE_THEME:-ansi-default}"
  • NO_COLOR: [ -n "${NO_COLOR:-}" ] && theme="none"
  • Theme aliases: catppuccincatppuccin-mocha
  • Invalid theme: fallback to ansi-default
  • Color output: printf "%b" for ANSI/TrueColor, printf "%s" for none
  • TrueColor format: \033[38;2;R;G;Bm (24-bit foreground)
  • Git: git --no-optional-locks -C "$dir"
  • Git cache: /tmp/claude-statusline-git-cache-$(id -u), 5s TTL, stat -f %m (macOS) / stat -c %Y (Linux)
  • CWD truncation: depth >2 → ~/.../basename
  • Cost: only when >= 0.005, format est $X.XX
  • Alert style: C_ALERT + bold (\033[1m) to distinguish from C_CTX_BAD

Script Structure

#!/bin/sh
input=$(cat)
# ... extract JSON fields ...

theme="${CLAUDE_STATUSLINE_THEME:-ansi-default}"
[ -n "${NO_COLOR:-}" ] && theme="none"

case "$theme" in
  catppuccin|catppuccin-mocha) # set C_* tokens with TrueColor values ;;
  dracula)          # ... ;;
  nord)             # ... ;;
  none)             # all C_* = "" ;;
  *)                # ansi-default: ANSI 16 colors ;;
esac

# ... build output using C_* tokens ...
if [ "$theme" = "none" ]; then
  printf "%s" "$out"
else
  printf "%b" "$out"
fi

Example Output

~/.../my-project | feat/auth | Opus 4.6 | ctx 48% left · est $0.12
~/.../my-project | main | Opus 4.6 | ctx 18% left · est $1.23 · >200k

Output

ArtifactPathDescription
StatusLine script~/.claude/statusline-command.shPOSIX shell script consuming JSON stdin

Verification

After generating the script, verify:

  • ~/.claude/statusline-command.sh exists and is executable (chmod +x)
  • Test echo passes: echo '{"model":{"display_name":"Opus 4.6"},"workspace":{"current_dir":"/tmp/test"},"context_window":{"remaining_percentage":55},"cost":{"total_cost_usd":0.42},"exceeds_200k_tokens":false}' | ~/.claude/statusline-command.sh
  • Output contains expected segments (directory, model, context %)
  • Theme matches user selection (check color codes in script)
  • NO_COLOR=1 produces uncolored output

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

tech-spec

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated