From sejas-ai-code-skills
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 this skill is triggered — by the user, by Claude, or both
Slash command
/sejas-ai-code-skills:context-window-statuslineThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate and install a customizable status line (footer bar) for Claude Code that visualizes context window usage, token counts, session cost, and more.
Generate and install a customizable status line (footer bar) for Claude Code that visualizes context window usage, token counts, session cost, and more.
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
Copy scripts/statusline.sh to ~/.claude/statusline.sh and make it executable:
cp scripts/statusline.sh ~/.claude/statusline.sh
chmod +x ~/.claude/statusline.sh
Add to ~/.claude/settings.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).
The script receives session data as JSON via stdin. Extract fields with jq:
| Field | Description |
|---|---|
model.display_name | Current model name (e.g. "Opus 4.6") |
| 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 |
| 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 |
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.
Adjust the percentage thresholds in the color-selection block:
< 40% — plenty of room< 70% — getting warm< 90% — watch out>= 90% — near compactionChange BAR_WIDTH=20 to any value. Wider bars give more granularity.
Extend the script by reading additional JSON fields or injecting external data (git branch, active timers, etc.) into the output lines.
The ready-to-use script is at scripts/statusline.sh. It includes:
jq is installed (brew install jq)~ in the command fieldnpx claudepluginhub joshuarweaver/cascade-code-general-misc-3 --plugin sejas-ai-code-skillsCreates, edits, and verifies skills using a test-driven development approach with pressure scenarios and subagents.