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.
What this skill does
# 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)
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.