statusline-customization

Configuration reference and troubleshooting for the statusline plugin — sections, themes, bar widths, and script architecture

16 stars

Best use case

statusline-customization is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Configuration reference and troubleshooting for the statusline plugin — sections, themes, bar widths, and script architecture

Teams using statusline-customization should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/statusline-customization/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/tools/statusline-customization/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/statusline-customization/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How statusline-customization Compares

Feature / Agentstatusline-customizationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Configuration reference and troubleshooting for the statusline plugin — sections, themes, bar widths, and script architecture

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Statusline Customization Reference

## Config File

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

### Schema

```json
{
  "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

- `█` — both 5h and 7d usage at this position
- `▀` — only 5h usage (top half)
- `▄` — only 7d usage (bottom half)
- `-` — empty (unused capacity)

### Reset Countdown Format

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

- `↻1h40m` — resets in 1 hour 40 minutes
- `↻3d12h` — resets in 3 days 12 hours
- `↻now` — resetting now

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

### Context Bar Token Count

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

- `45% 90k/200k` — 90k tokens used out of 200k window
- `72% 144k/200k` — approaching limit
- Only shown when Claude Code provides token data in stdin

### Compaction Detection

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

- `25% 50k/200k ⟳` — compaction just happened (tokens dropped)
- The indicator appears for one render only, then disappears
- Detection works by caching `total_input_tokens` between renders; a drop means compaction occurred
- Cache file: `~/.claude/.statusline-token-cache`

## 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

- **Cache file:** `~/.claude/.statusline-usage-cache.json`
- **TTL:** 60 seconds
- **Mechanism:** Background subshell `( ... ) &` fires API call; current render uses stale cache
- **Token source:** macOS Keychain (`security find-generic-password -s "Claude Code-credentials"`)
- **API endpoint:** `https://api.anthropic.com/api/oauth/usage`

### Input JSON Schema (from Claude Code)

```json
{
  "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:
```bash
brew install jq
```

### No plan limits showing
- Check if cache file exists: `ls -la ~/.claude/.statusline-usage-cache.json`
- Verify Keychain access: `security find-generic-password -s "Claude Code-credentials" -w | head -c 20`
- If Keychain prompts are denied, the API call silently fails — grant access when prompted
- Plan limits only show when both 5h and 7d utilization data are available

### Config not taking effect
- Verify JSON syntax: `jq . ~/.claude/statusline-config.json`
- After changing config, the script picks it up on next render (no restart needed)
- To redeploy the script itself after a plugin update, run `/statusline:install-statusline`

### Script not executable
```bash
chmod +x ~/.claude/statusline-command.sh
# or for project-level:
chmod +x .claude/statusline-command.sh
```

### Reset countdown not showing
- Reset times come from the `resets_at` field in the usage API response
- If the field is missing from the API response, no countdown is shown
- Verify with: `jq '.five_hour.resets_at, .seven_day.resets_at' ~/.claude/.statusline-usage-cache.json`

Related Skills

copilot-customization-features

16
from diegosouzapw/awesome-omni-skill

Use when creating or modifying any GitHub Copilot customization features in VS Code, including custom instructions, AGENTS.md, agent skills, prompt files, custom agents, agent hooks, or AGENTS.md files. Helps select the correct feature type and create, review, or modify it for optimal performance.

user-customization

16
from diegosouzapw/awesome-omni-skill

指导用户如何自定义 Trae Skills 的配置,包括覆盖角色设定、调整技术偏好和定义全局规则。

agent-customization

16
from diegosouzapw/awesome-omni-skill

Create, update, review, fix, or debug VS Code agent customization files (.instructions.md, .prompt.md, .agent.md, SKILL.md, copilot-instructions.md, AGENTS.md). Use for: saving coding preferences; troubleshooting why instructions/skills/agents are ignored or not invoked; configuring applyTo patterns; defining tool restrictions; creating custom agent modes or specialized workflows; packaging domain knowledge; fixing YAML frontmatter syntax.

advanced-statusline

16
from diegosouzapw/awesome-omni-skill

Implement AI-powered statusline with session tracking, plan detection, workspace emojis, and intelligent caching for Claude Code

bgo

16
from diegosouzapw/awesome-omni-skill

Automated Blender build-go workflow. Automatically builds, removes old version, installs, enables, and launches Blender with your extension/add-on. Use when you want to quickly test changes, execute complete build-to-launch cycle, or run custom packaging scripts with automatic Blender launch.

Coding & Development

maintenance

16
from diegosouzapw/awesome-omni-skill

Cleans up and organizes project files. Use when user mentions '整理', 'cleanup', 'アーカイブ', 'archive', '肥大化', 'Plans.md', 'session-log', or asks to clean up old tasks, archive completed items, or organize files. Do NOT load for: 実装作業, レビュー, 新機能開発, デプロイ.

hello-skill

16
from diegosouzapw/awesome-omni-skill

每次对话开始时,声明"[Skills✏️已加载]"

zylvie-automation

16
from diegosouzapw/awesome-omni-skill

Automate Zylvie tasks via Rube MCP (Composio). Always search tools first for current schemas.

zoominfo-automation

16
from diegosouzapw/awesome-omni-skill

Automate Zoominfo tasks via Rube MCP (Composio). Always search tools first for current schemas.

zoho-invoice-automation

16
from diegosouzapw/awesome-omni-skill

Automate Zoho Invoice tasks via Rube MCP (Composio): invoices, estimates, expenses, clients, and payment tracking. Always search tools first for current schemas.

zoho-inventory-automation

16
from diegosouzapw/awesome-omni-skill

Automate Zoho Inventory tasks via Rube MCP (Composio): items, orders, warehouses, shipments, and stock management. Always search tools first for current schemas.

zoho-bigin-automation

16
from diegosouzapw/awesome-omni-skill

Automate Zoho Bigin tasks via Rube MCP (Composio): pipelines, contacts, companies, products, and small business CRM. Always search tools first for current schemas.