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.
5h: 85% left · 7d: 82% left — displays remaining (100 - used); color thresholds match context %: Green >40%, Yellow 20-40%, Red <=20%; OAuth users only
Worktree
worktree.name + worktree.branch
ON (conditional)
[WT:{name}] {branch} or [WT:{name}] if branch absent; replaces Directory + Git branch when present; color: C_BRANCH
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
Token format: %.1fk via awk (e.g. 8500 → 8.5k); values < 1000 show raw number
Tier format: >=1M → (1M), >=1000 → ({N}k), else raw; used for model suffix + context absolute
Model tier suffix: append (1M) or (200k) from context_window_size; skip if display_name already containscontext, 1M, or 200k
Context absolute: ctx 60% left (600k/1M) — remaining tokens calculated from remaining_percentage * context_window_size / 100
Sanitize free-text: strip control chars (tr -d '[:cntrl:]') + truncate 30 chars for agent.name, worktree.name, worktree.branch
Worktree replace: when worktree.name present, replace Directory + Git branch with [WT:{name}] {branch} (or [WT:{name}] if worktree.branch absent — hook-based worktrees)
Rate limits: show when rate_limits present; display remaining % (100 - used_percentage) with "left" suffix; format 5h: {rem}% left · 7d: {rem}% left; color by worst remaining — Green >40% (C_CTX_OK), Yellow 20-40% (C_CTX_WARN), Red <=20% (C_CTX_BAD); thresholds match context %; OAuth users only
Rate limits resets_at: extracted but not displayed in v1 (too verbose for statusline)
#!/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
Normal mode (1M context):
~/.../my-project | feat/auth | Opus 4.6 (1M) | ctx 60% left (600k/1M) · 85.0k/12.0k · est $18.12
Normal mode (200k context):
~/.../my-project | main | Sonnet 4.6 (200k) | ctx 30% left (60k/200k) · 120.0k/8.0k · est $3.50
With agent:
~/.../my-project | feat/auth | security-reviewer | Opus 4.6 (1M) | ctx 48% left (480k/1M) · est $0.12
Worktree mode:
[WT:fix-123] bugfix/issue-123 | Opus 4.6 (1M) | ctx 22% left (220k/1M) · 42.0k/8.0k · est $1.23
With rate limits (OAuth user, green):
~/.../my-project | feat/auth | Opus 4.6 (1M) | ctx 60% left (600k/1M) · 85.0k/12.0k · est $18.12 · 5h: 58% left · 7d: 82% left
Rate limits warning (yellow):
~/.../my-project | main | Opus 4.6 (1M) | ctx 30% left (300k/1M) · 5h: 25% left · 7d: 35% left
Rate limits critical (red):
~/.../my-project | main | Opus 4.6 (1M) | ctx 30% left (300k/1M) · 5h: 8% left · 7d: 55% left
display_name already has context info (no duplicate suffix):
~/.../my-project | main | Opus 4.6 (1M context) | ctx 60% left (600k/1M) · est $18.12
Output
Artifact
Path
Description
StatusLine script
~/.claude/statusline-command.sh
POSIX shell script consuming JSON stdin
Verification
After generating the script, verify:
~/.claude/statusline-command.sh exists and is executable (chmod +x)
v2 test passes: echo '{"model":{"display_name":"Opus 4.6"},"cwd":"/tmp/test","workspace":{"current_dir":"/tmp/test","project_dir":"/tmp/test"},"context_window":{"remaining_percentage":55,"used_percentage":45,"context_window_size":200000,"total_input_tokens":85000,"total_output_tokens":12000,"current_usage":{"input_tokens":8500,"output_tokens":1200,"cache_creation_input_tokens":5000,"cache_read_input_tokens":2000}},"cost":{"total_cost_usd":0.42},"exceeds_200k_tokens":false,"session_id":"test","version":"2.1.80","output_style":{"name":"default"},"rate_limits":{"five_hour":{"used_percentage":42.5,"resets_at":"2026-03-21T14:30:00Z"},"seven_day":{"used_percentage":18.2,"resets_at":"2026-03-25T00:00:00Z"}}}' | ~/.claude/statusline-command.sh
Run npx skillmds@latest add sd0xdev/statusline-config in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
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. It is listed under AI & ML on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
sd0xdev (@sd0xdev) published this skill. Their other Agent Skills are listed on their SkillMD profile.