Skip to content
Skills Library
AI & agents · Building & coding

context-window-statusline

/context-window-statusline

This skill should be used when the user asks to "set up a status line", "configure the footer", "show context window usage", "add a statusline", "visualize context window", "customize the Claude Code footer", or wants to display token counts, cost, or session metrics in the Claude Code terminal footer.

Author
sejas ↗
Licence
MIT
Last repository change
08.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 08.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

This skill should be used when the user asks to "set up a status line", "configure the footer", "show context window usage", "add a statusline", "visualize context window", "customize the Claude Code footer", or wants to display token counts, cost, or session metrics in the Claude Code terminal footer.

Triggers from the description

set up a status lineconfigure the footershow context window usageadd a statuslinevisualize context windowcustomize the Claude Code footer
Original author description

This skill should be used when the user asks to "set up a status line", "configure the footer", "show context window usage", "add a statusline", "visualize context window", "customize the Claude Code footer", or wants to display token counts, cost, or session metrics in the Claude Code terminal footer.

How it works

  1. What It Does
  2. Installation
  3. Available JSON Data
  4. Customization
  5. Bundled Script
  6. Troubleshooting
Original SKILL.md headings · 108 lines, 492 words
SKILL.md preview
---
name: context-window-statusline
description: This skill should be used when the user asks to "set up a status line", "configure the footer", "show context window usage", "add a statusline", "visualize context window", "customize the Claude Code footer", or wants to display token counts, cost, or session metrics in the Claude Code terminal footer.
user-invocable: true
---

# Context Window Status Line

Generate and install a customizable status line (footer bar) for Claude Code that visualizes context window usage, token counts, session cost, and more.

## What It Does

The status line displays a real-time dashboard at the bottom of the Claude Code terminal:

```
Opus 4.6 │ ████████░░░░░░░░░░░░ 42% (85.3kin 12.1kout cached:45.2k) of 200k
💰 $0.1234 │ ⏱  5m23s (api: 2m10s) │ +142 -37
```

## Installation

### Step 1: Copy the script

Copy `scripts/statusline.sh` to `~/.claude/statusline.sh` and make it executable:

```bash
cp scripts/statusline.sh ~/.claude/statusline.sh
chmod +x ~/.claude/statusline.sh
```

### Step 2: Configure settings.json

Add to `~/.claude/settings.json`:

```json
{
  "statusLine": {
    "type": "command",
    "command": "~/.claude/statusline.sh",
    "padding": 1
  }
}
```

The `padding` field adds blank lines around the status bar (0 = no padding, 1 = one line above and below).

## Available JSON Data

The script receives session data as JSON via `stdin`. Extract fields with `jq`:

### Model Information
| Field | Description |
|-------|-------------|
| `model.display_name` | Current model name (e.g. "Opus 4.6") |

### Context Window
| Field | Description |
|-------|-------------|
| `context_window.used_percentage` | Percentage of context used (0-100) |
| `context_window.remaining_percentage` | Percentage remaining |
| `context_window.context_window_size` | Total window size in tokens |
| `context_window.current_usage.input_tokens` | Input tokens consumed |
| `context_window.current_usage.output_tokens` | Output tokens generated |
| `context_window.current_usage.cache_read_input_tokens` | Tokens read from cache |
| `context_window.current_usage.cache_creation_input_tokens` | Tokens written to cache |

### Cost & Performance
| Field | Description |
|-------|-------------|
| `cost.total_cost_usd` | Total session cost in USD |
| `cost.total_duration_ms` | Total session wall time |
| `cost.total_api_duration_ms` | Time spent in API calls |
| `cost.total_lines_added` | Lines of code added |
| `cost.total_lines_removed` | Lines of code removed |

## Customization

### Minimal version (context bar only)

To display only the context window bar, remove line 2 from the script output. Keep only the `printf` that renders the model name, progress bar, and token counts.

### Color thresholds

Adjust the percentage thresholds in the color-selection block:
- Green: `< 40%` — plenty of room
- Cyan: `< 70%` — getting warm
- Yellow: `< 90%` — watch out
- Red: `>= 90%` — near compaction

### Bar width

Change `BAR_WIDTH=20` to any value. Wider bars give more granularity.

### Adding custom sections

Extend the script by reading additional JSON fields or injecting external data (git branch, active timers, etc.) into the output lines.

## Bundled Script

The ready-to-use script is at `scripts/statusline.sh`. It includes:
- Color-coded context window progress bar (20 chars wide)
- Token count formatting (auto-scales to k/M)
- Duration formatting (seconds/minutes/hours)
- Cost display with 4 decimal precision
- Lines added/removed counters

## Troubleshooting

- **No output**: Verify `jq` is installed (`brew install jq`)
- **Garbled colors**: Ensure terminal supports ANSI escape codes
- **Script not found**: Use absolute path or `~` in the command field
- **Slow updates**: The script runs on each render cycle; keep it fast (avoid network calls)

Versions

The database has no other skills named context-window-statusline.

Database snapshot: 13.11.2026 · package version 7a7b0d09ae32 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100statusline
    Configure a custom status line in the CLI. Use when the user mentions status line, statusline, statusLine, CLI status bar, prompt footer customization, or wants to add session context above the prompt.
  • 100claude-code-statusline-development
    This skill should be used when the user asks to "create a statusline", "customize the status line", "add a custom prompt", or mentions Claude Code statusline. Also suggest when the user wants to display git branch, context usage, model name, or session costs at the bottom of Claude Code.
  • 100claude-statusline
    Guide for creating and configuring the Claude Code status line. Use when building a custom status bar, configuring statusLine in settings.json, scripting token/model/git readouts, or debugging status-line output.
  • 100cc-statusline
    Install a ready-made two-line Claude Code status line (Dracula theme): model, context bar with token counts, session cost, effort level, output style, repo, worktree, git branch, plus 5h/7d rate-limit quotas with reset countdowns. Use when setting up or initializing the Claude…
  • 95usage-statusline
    Set up or restyle the claude-usage status line - Claude subscription usage and spend in the Claude Code footer. Applies a named style directly, or guides the user through setup when the request is open-ended. Use when asked to show usage/spend/limits in the status line or…
  • 100statusline-config
    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…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.