---
name: context-indicator
description: Configure the context window statusline indicator
allowed-tools: Read, Write
argument-hint: "[size in K, e.g. 1000K or 200K]"
---

You are configuring the context indicator statusline tool. The config file is located at `~/.claude/statusline-config.json`.

**If the user provided an argument ($ARGUMENTS):**

Parse the argument as a context window size in K (thousands of tokens). For example:
- `1000K` or `1000k` = 1,000,000 tokens (MAX plan)
- `200K` or `200k` = 200,000 tokens (standard plan)

Read the existing config file at `~/.claude/statusline-config.json` (create it if it doesn't exist), update the `contextWindow` field with the parsed token count, and write it back. Preserve any other existing settings in the file.

Then confirm: "Context window set to [X]K ([Y] tokens). Your statusline will update on the next refresh."

**If no argument was provided ($ARGUMENTS is empty):**

Read the current config from `~/.claude/statusline-config.json` (if it exists) and present this menu:

```
Context Indicator Configuration

Current settings:
  Context window: [current value]K ([tokens] tokens)
  Progress bar width: [current value] segments
  Auto-compact threshold: [current value]%
  Auto-compact indicator: [on/off]

Options:
  1. Set context window size (200K for standard, 1000K for MAX)
  2. Set progress bar width
  3. Set auto-compact threshold percentage
  4. Toggle auto-compact indicator on/off
  5. Reset to defaults
  6. Exit without changes

Enter a number to configure:
```

Wait for the user to choose. If they choose 6, respond "No changes made." and stop. Otherwise, walk them through setting that value. Write all changes to `~/.claude/statusline-config.json`.

**Config file format (`~/.claude/statusline-config.json`):**
```json
{
  "contextWindow": 200000,
  "progressBarWidth": 20,
  "autoCompactThreshold": 95,
  "showAutoCompactIndicator": true
}
```

**Defaults (if no config file exists):**
- contextWindow: 200000
- progressBarWidth: 20
- autoCompactThreshold: 95
- showAutoCompactIndicator: true
