statusline-config
Original:🇺🇸 English
Translated
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.
3installs
Sourcesd0xdev/sd0x-dev-flow
Added on
NPX Install
npx skill4agent add sd0xdev/sd0x-dev-flow statusline-configTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →StatusLine Config
Customize — segments, themes, and colors.
~/.claude/statusline-command.shWhen NOT to Use
| Scenario | Use Instead |
|---|---|
| Setting statusline for the first time (no customization needed) | Built-in |
Editing | Manual edit — this skill manages |
| Debugging Claude Code startup issues | |
Segments
| Segment | JSON Field | Default | Notes |
|---|---|---|---|
| Directory | | ON | Truncate deep paths: |
| Git branch | shell | ON | |
| Model | | ON | - |
| Context % | | ON | Green >40%, Yellow 20-40%, Red <=20% |
| Cost | | ON | Show when >= $0.005, |
| >200k alert | | ON | Show only when |
For full JSON schema, see json-schema.md.
Themes
| Theme | Type | Default | Notes |
|---|---|---|---|
| ANSI 16 | ✅ | Safe fallback, works everywhere |
| TrueColor | — | Recommended — pastel, WCAG AA >=4.5:1 |
| TrueColor | — | Vibrant purple/pink accents |
| TrueColor | — | Arctic blue, muted tones |
| — | — | No colors ( |
Switch via:
export CLAUDE_STATUSLINE_THEME=catppuccin-mochaFor complete token→hex mappings, see themes.md.
Semantic Tokens
Scripts use semantic tokens instead of hardcoded colors:
| Token | Role | Example |
|---|---|---|
| Directory path | blue / sapphire |
| Git branch name | magenta / mauve |
| Model display name | cyan / teal |
| Context >= 41% | green |
| Context 21-40% | yellow |
| Context <= 20% | red |
| Cost display | muted text |
| >200k token warning | orange/peach + bold |
| Pipe separator | dim/overlay |
| Secondary info | subtext |
| General text | foreground |
| Reset all formatting | |
Workflow
No args → Apply best-practice defaults (all ON segments + theme). Go to step 4.
ansi-defaultTheme change (e.g. "use catppuccin-mocha", "switch to dracula") → Read themes.md, apply requested theme. Go to step 4. Aliases: → .
catppuccincatppuccin-mochaCustom requests (e.g. "add cost", "remove git", "no colors") → Interactive flow:
- Read current script:
cat ~/.claude/statusline-command.sh - Ask segments to enable/disable (AskUserQuestion multiSelect)
- Ask theme preference (AskUserQuestion with theme options)
- Generate script following Script Rules + selected theme from themes.md
- Write to
~/.claude/statusline-command.sh - 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: (POSIX)
#!/bin/sh - 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: for ANSI/TrueColor,
printf "%b"for noneprintf "%s" - TrueColor format: (24-bit foreground)
\033[38;2;R;G;Bm - Git:
git --no-optional-locks -C "$dir" - Git cache: , 5s TTL,
/tmp/claude-statusline-git-cache-$(id -u)(macOS) /stat -f %m(Linux)stat -c %Y - CWD truncation: depth >2 →
~/.../basename - Cost: only when , format
>= 0.005est $X.XX - Alert style: + bold (
C_ALERT) to distinguish from\033[1mC_CTX_BAD
Script Structure
sh
#!/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"
fiExample 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 · >200kOutput
| Artifact | Path | Description |
|---|---|---|
| StatusLine script | | POSIX shell script consuming JSON stdin |
Verification
After generating the script, verify:
- exists and is executable (
~/.claude/statusline-command.sh)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)
- produces uncolored output
NO_COLOR=1