Statusline customization

From MadAppGang/claude-code · View interactive version

Statusline customization is an AI agent skill from the GitHub repository MadAppGang/claude-code. Configuration reference and troubleshooting for the statusline plugin — sections, themes, bar widths, and script architecture

How to use this skill

Skill file

Statusline Customization Reference

Config File

Location: ~/.claude/statusline-config.json

Schema

{
  "sections": {
    "model": true,         // Model name (Opus/Sonnet/Haiku)
    "branch": true,        // Git branch name
    "worktree": true,      // Worktree indicator (wt:name)
    "cost": true,          // Session cost ($X.XX)
    "duration": true,      // Session duration (Xm Xs)
    "context_bar": true,   // Context window usage bar
    "plan_limits": true    // Plan limit bars with reset countdowns
  },
  "context_bar_width": 12, // Width of context bar in chars (8-20)
  "plan_bar_width": 10,    // Width of plan limit bar in chars (6-16)
  "theme": "default"       // Color theme name
}

All fields are optional. Missing fields use defaults shown above.

Sections Reference

| Section | Color | Description |

|---------|-------|-------------|

| model | Cyan (bold) | Shortened model name with * prefix |

| branch | Green | Current git branch or short commit hash |

| worktree | Orange (bold) | wt:name — only shown when inside a linked worktree |

| cost | Yellow | Cumulative session cost in USD |

| duration | Magenta | Session duration in minutes/seconds |

| context_bar | Green→Red gradient | Visual bar + token count (90k/200k) + compaction indicator (⟳) |

| plan_limits | Teal→Red gradient | Dual bar: top=5h, bottom=7d plan usage with reset countdowns |

Plan Limits Bar Characters

Reset Countdown Format

After each percentage, a countdown shows when the limit resets:

Example: █▄▄------- 5h:18% ↻1h40m 7d:35% ↻3d12h

Context Bar Token Count

After the percentage, a dim token count shows current/max context usage:

Compaction Detection

A bold magenta ⟳ appears after the token count when auto-compaction is detected:

Themes

| Theme | Description |

|-------|-------------|

| default | Warm/cool ANSI palette — bright cyan, green, yellow, orange, red |

| monochrome | White and gray only — no colors |

| minimal | Muted dim ANSI colors (30-series) — subtle and low-contrast |

| neon | 256-color bright variants — vivid and high-contrast |

Script Architecture

Data Flow

  1. Claude Code pipes JSON session data to stdin
  2. Script reads config from ~/.claude/statusline-config.json
  3. Extracts fields with jq
  4. Detects git branch and worktree from cwd
  5. Reads plan usage from non-blocking background cache
  6. Renders ANSI-colored output to stdout

Non-Blocking API Cache

Input JSON Schema (from Claude Code)

{
  "model": { "display_name": "Claude Opus 4.6" },
  "cost": { "total_cost_usd": 1.23, "total_duration_ms": 180000 },
  "context_window": { "used_percentage": 45.2 },
  "cwd": "/path/to/project"
}

Troubleshooting

jq not found

The script requires jq for JSON parsing. Install with:

brew install jq

No plan limits showing

Config not taking effect

Script not executable

chmod +x ~/.claude/statusline-command.sh
# or for project-level:
chmod +x .claude/statusline-command.sh

Reset countdown not showing

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.