# Statusline Generator

Installs, configures, customizes, or troubleshoots the Claude Code statusline (cwd...

- Repository: https://github.com/daymade/claude-code-skills (1509 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add daymade/claude-code-skills --skill statusline-generator -g -a claude-code -y`
Codex: `npx skills add daymade/claude-code-skills --skill statusline-generator -g -a codex -y`
Cursor: `npx skills add daymade/claude-code-skills --skill statusline-generator -g -a cursor -y`
Gemini CLI: `npx skills add daymade/claude-code-skills --skill statusline-generator -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add daymade/claude-code-skills`

## Description

Installs, configures, customizes, or troubleshoots the Claude Code statusline (cwd, model, token counts). Use when the user wants to set up or change the statusline, switch minimal vs full layouts, show absolute token counts instead of a percentage, add cost via ccusage, or fix a statusline that is blank, silent, stuck, or stopped updating. Trigger phrases: 状态栏, 状态栏不显示, 状态栏空白, "statusline blank", "statusline broken".

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Statusline Generator

A single-source-of-truth statusline for Claude Code. One script, two layouts,
end-to-end self-verification.

## Quick health check (start here when something is wrong)

Run this first whenever the statusline misbehaves. It catches the silent failures
that account for most "configured but not working" reports:

```bash
bash scripts/health_check.sh
```

It validates four layers:
1. `~/.claude/statusline.sh` exists and is executable. **Missing `chmod +x` is
   the single most common silent-failure cause**, Claude Code runs the script,
   `exec` fails, statusline goes blank.
2. `~/.claude/settings.json` has a valid `statusLine` block pointing at the script.
3. Mock stdin tests covering complete data, zero tokens, missing fields,
   `$HOME` path shortening, and zero-fork git-branch rendering (via a synthetic
   `.git/HEAD`, no git binary required).
4. Real stdin replay from `/tmp/.claude-statusline-last-stdin.json` if you
   previously ran with `CLAUDE_STATUSLINE_DEBUG=1`.

Each failure prints a one-line fix command, you don't have to read documentation
to recover.

## Quick install

```bash
bash scripts/install_statusline.sh
```

This script:
- Backs up any existing `~/.claude/statusline.sh` and `settings.json`.
- Copies `generate_statusline.sh` to `~/.claude/statusline.sh` and `chmod +x`s it.
- Updates `settings.json` `statusLine` block via `jq` (preserves other settings).
- **Mandatorily runs `health_check.sh` and shows the result**, installation
  is not "complete" until verification passes.

Restart Claude Code (or send any new message) to see the statusline update.

## What you get

### Default, minimal one-line layout

```
~/code/myproject  [main]  Opus 4.7 (1M context)  ctx: 108K / 1M
```

The rest: https://github.com/daymade/claude-code-skills/blob/HEAD/daymade-claude-code/statusline-generator/SKILL.md
