Skip to content
Back to skills

Smart Statusline

BSecurity

Install a Claude Code statusline that shows model name, session cost, a 10-block context usage bar, and color-coded warnings (/compact prompts at 50%, urgency at 70%, new-session warning at 90%). Use when the user types /smart-statusline, asks to set up a statusline, wants to see context usage in their terminal, asks how full their context window is, wants cost tracking in Claude Code, or says things like 'show me context percentage', 'set up my statusline', or 'I want to see how much context...

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 6, 2026
ai-agentsgobash

Works with

  • claude code
  • terminal
  • cli

Security analysis

B85/100
  • highPerforms destructive filesystem operations

Pro scans all 2 files and shows the line behind each finding

Scanned December 6, 2026

npx -y skills add flopperj/dotfiles-core --skill smart-statusline --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Smart Statusline?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Smart Statusline
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/flopperj-smart-statusline/badge)](https://www.skillsdirectory.com/skills/flopperj-smart-statusline)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: smart-statusline
description: "Install a Claude Code statusline that shows model name, session cost, a 10-block context usage bar, and color-coded warnings (/compact prompts at 50%, urgency at 70%, new-session warning at 90%). Use when the user types /smart-statusline, asks to set up a statusline, wants to see context usage in their terminal, asks how full their context window is, wants cost tracking in Claude Code, or says things like 'show me context percentage', 'set up my statusline', or 'I want to see how much context I have left'."
user-invocable: true
---

# Claude Code Statusline

> **Just installed this skill? Say: "install my statusline"** — Claude will set everything up automatically.



Installs a statusline script for Claude Code that shows at a glance:
- **Model name** — which Claude model is active
- **Session cost** — estimated session cost (client-side list price; resets to $0 on /clear; not the billed amount), shown as `~$`
- **Context bar** — 10-block progress bar (each block = 10% of context window)
- **Color-coded warnings** — green → yellow → orange → red as context fills up
- **Branch and lines changed** — on a second line; lines changed are counted against the merge-base with `origin/<default branch>`, so upstream commits are not attributed to the session; the default branch comes from `origin/HEAD`, falling back to `origin/main` then `origin/master` when it is unset, and the segment is omitted when none of them exists

Example output:
```
🤖 Sonnet 4.6 | 💰 ~$0.42 | CTX ███████░░░ 72% — run /compact now
```

Color thresholds:
- **Green** (0–49%) — plenty of room
- **Yellow** (50–69%) — consider `/compact`
- **Orange** (70–89%) — run `/compact` now
- **Red** (90%+) — start a new session

## Installation

Two things are needed: the script file and a `settings.json` entry.

### Step 1: Copy the script

The script is bundled at `scripts/statusline-command.sh` relative to this SKILL.md. Copy it to `~/.claude/`:

```bash
cp <skill-dir>/scripts/statusline-command.sh ~/.claude/statusline-command.sh
chmod +x ~/.claude/statusline-command.sh
```

The skill directory is usually `~/.claude/skills/smart-statusline/` (global) or `.claude/skills/smart-statusline/` (project).

### Step 2: Add to settings.json

Add the `statusLine` key to your Claude Code `settings.json`. For **global** (all projects):

```json
// ~/.claude/settings.json
{
  "statusLine": {
    "command": "bash ~/.claude/statusline-command.sh"
  }
}
```

For **project-scoped** (just this repo), add to `.claude/settings.json` in your project root instead.

### Step 3: Verify

Open Claude Code — the statusline should appear immediately. If it doesn't show, check that `jq` is installed (`brew install jq` on macOS, `apt install jq` on Linux).

## When Claude installs this

If the user asks you to install the statusline for them:

1. Find the skill directory — check `~/.claude/skills/smart-statusline/` (global install) or `.claude/skills/smart-statusline/` (project install)
2. Copy the script: `cp <skill-dir>/scripts/statusline-command.sh ~/.claude/statusline-command.sh`
3. Read the user's `~/.claude/settings.json` (create it if missing), add the `statusLine` block, write it back
4. Confirm: "Statusline installed — reopen Claude Code to see it. Once you've confirmed it's working, I can remove the `statusline` skill directory (`<skill-dir>`) since it's no longer needed — the script and settings.json are all that's required going forward."
5. After the user confirms it's working, clean up: `rm -rf <skill-dir>`

Use the project-scoped `.claude/settings.json` if the user is working in a specific repo and says so. Default to global `~/.claude/settings.json` otherwise.

## Requirements

- `jq` — JSON parsing in the script (`brew install jq` / `apt install jq`)
- Claude Code with statusline support (any recent version)
- Bash

## Maintenance

If you discover something during this task that would improve this skill,
propose the change and ask me to confirm before saving it.

Files in this skill

  • SKILL.md4 KB
  • scripts/statusline-command.sh3.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.