|
| 1 | +# AI-Statusline Plugin |
| 2 | + |
| 3 | +**AI-powered status line customization for Claude Code.** Interactive setup and edit wizards for configuring a custom status line with progress bars and customizable display options. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## What This Plugin Does |
| 8 | + |
| 9 | +Provides interactive commands to configure Claude Code's status line with visual elements like progress bars, token counts, git branch info, and more. The plugin generates cross-platform scripts (Bash for Mac/Linux, PowerShell for Windows) that dynamically display real-time session information. |
| 10 | + |
| 11 | +### Example Status Line |
| 12 | + |
| 13 | +``` |
| 14 | +Claude Opus 4.5 · 42k/100k ▓▓▓▓░░░░░░ 42% · my-project · main · 5m 23s · 2:45pm · v1.0.24 |
| 15 | +``` |
| 16 | + |
| 17 | +--- |
| 18 | + |
| 19 | +## Available Commands |
| 20 | + |
| 21 | +### `/statusline-wizard` |
| 22 | + |
| 23 | +Interactive setup wizard for configuring Claude Code's custom status line from scratch. |
| 24 | + |
| 25 | +**What it does:** |
| 26 | + |
| 27 | +- Detects your operating system (Mac/Linux/Windows) |
| 28 | +- Checks for existing configuration and offers to back up if present |
| 29 | +- Runs an interactive wizard using grouped questions |
| 30 | +- Creates the appropriate script file (`statusline.sh` or `statusline.ps1`) |
| 31 | +- Updates `~/.claude/settings.json` with the statusLine configuration |
| 32 | +- Makes the script executable on Mac/Linux |
| 33 | + |
| 34 | +**Usage:** |
| 35 | + |
| 36 | +``` |
| 37 | +/statusline-wizard |
| 38 | +``` |
| 39 | + |
| 40 | +**Wizard Questions:** |
| 41 | + |
| 42 | +The wizard asks about three categories of display options: |
| 43 | + |
| 44 | +1. **Context Display** (what to show about your Claude session) |
| 45 | + - Token count (e.g., "50k/100k") |
| 46 | + - Progress bar (visual percentage indicator) |
| 47 | + - Model name (e.g., "Claude Opus 4.5") |
| 48 | + |
| 49 | +2. **Project Display** (what to show about your project) |
| 50 | + - Current directory name |
| 51 | + - Git branch name |
| 52 | + |
| 53 | +3. **Session Display** (what to show about timing/costs) |
| 54 | + - Session duration |
| 55 | + - Current time |
| 56 | + - Claude Code version |
| 57 | + - Session cost (disabled by default) |
| 58 | + |
| 59 | +### `/statusline-edit` |
| 60 | + |
| 61 | +Edit your existing status line configuration. |
| 62 | + |
| 63 | +**What it does:** |
| 64 | + |
| 65 | +- Detects your OS and locates the existing script file |
| 66 | +- Reads current configuration values from the script |
| 67 | +- Presents the same questions as wizard command |
| 68 | +- Updates only the configuration variables (preserves the rest of the script) |
| 69 | + |
| 70 | +**Usage:** |
| 71 | + |
| 72 | +``` |
| 73 | +/statusline-edit |
| 74 | +``` |
| 75 | + |
| 76 | +**Note:** If no status line script exists, you'll be prompted to run `/statusline-wizard` first. |
| 77 | + |
| 78 | +--- |
| 79 | + |
| 80 | +## Available Skills |
| 81 | + |
| 82 | +### `statusline-setup` |
| 83 | + |
| 84 | +Guide for configuring Claude Code's status line with customizable display options and progress bars. This skill provides the methodology and templates used by both commands. |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +## Quick Start |
| 89 | + |
| 90 | +### Installation |
| 91 | + |
| 92 | +``` |
| 93 | +/plugin install ai-statusline@claude-code-plugins-dev |
| 94 | +``` |
| 95 | + |
| 96 | +### Usage |
| 97 | + |
| 98 | +``` |
| 99 | +# Step 1: Run the setup wizard |
| 100 | +/statusline-wizard |
| 101 | +
|
| 102 | +# Step 2: Answer the interactive questions |
| 103 | +# Select which elements you want displayed |
| 104 | +
|
| 105 | +# Step 3: Your new status line appears immediately! |
| 106 | +
|
| 107 | +# Later: Edit your configuration |
| 108 | +/statusline-edit |
| 109 | +``` |
| 110 | + |
| 111 | +--- |
| 112 | + |
| 113 | +## Configuration Options |
| 114 | + |
| 115 | +| Option | Default | Description | |
| 116 | +|--------|---------|-------------| |
| 117 | +| Model name | On | Display model name (e.g., "Claude Opus 4.5") | |
| 118 | +| Token count | On | Display token usage (e.g., "50k/100k") | |
| 119 | +| Progress bar | On | Display visual progress bar with percentage | |
| 120 | +| Current directory | On | Display current working directory name | |
| 121 | +| Git branch | On | Display current git branch | |
| 122 | +| Session duration | On | Display how long the session has been running | |
| 123 | +| Current time | On | Display current time | |
| 124 | +| Claude Code version | On | Display Claude Code version number | |
| 125 | +| Session cost | Off | Display session cost in USD | |
| 126 | + |
| 127 | +--- |
| 128 | + |
| 129 | +## Features |
| 130 | + |
| 131 | +### Visual Progress Bar |
| 132 | + |
| 133 | +The progress bar uses Unicode block characters to show context usage: |
| 134 | + |
| 135 | +``` |
| 136 | +▓▓▓▓░░░░░░ 42% (Green - under 70%) |
| 137 | +▓▓▓▓▓▓▓░░░ 74% (Yellow - 70-79%) |
| 138 | +▓▓▓▓▓▓▓▓░░ 85% (Red - 80%+) |
| 139 | +``` |
| 140 | + |
| 141 | +Color changes automatically based on usage level to help you monitor context consumption. |
| 142 | + |
| 143 | +### Cross-Platform Support |
| 144 | + |
| 145 | +- **Mac/Linux**: Generates `~/.claude/statusline.sh` (Bash script) |
| 146 | +- **Windows**: Generates `~/.claude/statusline.ps1` (PowerShell script) |
| 147 | + |
| 148 | +Both scripts are automatically configured in your `~/.claude/settings.json`. |
| 149 | + |
| 150 | +### Smart Configuration |
| 151 | + |
| 152 | +- **Backup existing configs**: Automatically backs up existing scripts before overwriting |
| 153 | +- **Pre-selected defaults**: Edit command shows your current configuration |
| 154 | +- **Minimal updates**: Edit command only modifies configuration variables, preserving any customizations |
| 155 | + |
| 156 | +### Real-Time Information |
| 157 | + |
| 158 | +The status line displays live data from Claude Code including: |
| 159 | + |
| 160 | +- Current context window usage (input tokens + cache tokens) |
| 161 | +- Context window size |
| 162 | +- Session cost tracking |
| 163 | +- Session duration in human-readable format (5s, 3m 45s, 1h 23m) |
| 164 | +- Current git branch (with fallback to '-' if not in a repo) |
| 165 | + |
| 166 | +--- |
| 167 | + |
| 168 | +## How It Works |
| 169 | + |
| 170 | +1. **Script Generation**: The wizard creates a shell script that reads JSON input from stdin (provided by Claude Code) |
| 171 | + |
| 172 | +2. **JSON Parsing**: |
| 173 | + - Mac/Linux: Uses `jq` to parse the JSON data |
| 174 | + - Windows: Uses PowerShell's `ConvertFrom-Json` |
| 175 | + |
| 176 | +3. **Dynamic Output**: The script builds output segments based on enabled options, joining them with separators |
| 177 | + |
| 178 | +4. **ANSI Colors**: Uses standard ANSI escape codes for cross-terminal color support |
| 179 | + |
| 180 | +### Script Location |
| 181 | + |
| 182 | +| OS | Script Path | Settings Path | |
| 183 | +|----|-------------|---------------| |
| 184 | +| Mac/Linux | `~/.claude/statusline.sh` | `~/.claude/settings.json` | |
| 185 | +| Windows | `C:/Users/USERNAME/.claude/statusline.ps1` | `C:/Users/USERNAME/.claude/settings.json` | |
| 186 | + |
| 187 | +--- |
| 188 | + |
| 189 | +## Requirements |
| 190 | + |
| 191 | +### Mac/Linux |
| 192 | + |
| 193 | +- **jq**: Required for JSON parsing |
| 194 | + ```bash |
| 195 | + # macOS |
| 196 | + brew install jq |
| 197 | + |
| 198 | + # Ubuntu/Debian |
| 199 | + sudo apt install jq |
| 200 | + |
| 201 | + # Fedora |
| 202 | + sudo dnf install jq |
| 203 | + ``` |
| 204 | + |
| 205 | +### Windows |
| 206 | + |
| 207 | +- PowerShell 5.1+ (included with Windows 10/11) or PowerShell Core 7+ |
| 208 | +- No additional dependencies required |
| 209 | + |
| 210 | +### Terminal Support |
| 211 | + |
| 212 | +- Unicode support for progress bar characters (`▓` and `░`) |
| 213 | +- ANSI color code support (most modern terminals) |
| 214 | + |
| 215 | +--- |
| 216 | + |
| 217 | +## Customization |
| 218 | + |
| 219 | +### Manual Configuration |
| 220 | + |
| 221 | +After running the wizard, you can manually edit the configuration variables at the top of the script file: |
| 222 | + |
| 223 | +**Bash (`~/.claude/statusline.sh`):** |
| 224 | +```bash |
| 225 | +SHOW_MODEL=true # Show model name |
| 226 | +SHOW_TOKEN_COUNT=true # Show token usage count |
| 227 | +SHOW_PROGRESS_BAR=true # Show visual progress bar |
| 228 | +SHOW_DIRECTORY=true # Show current directory name |
| 229 | +SHOW_GIT_BRANCH=true # Show current git branch |
| 230 | +SHOW_COST=false # Show session cost |
| 231 | +SHOW_DURATION=true # Show session duration |
| 232 | +SHOW_TIME=true # Show current time |
| 233 | +SHOW_VERSION=true # Show Claude Code version |
| 234 | +``` |
| 235 | + |
| 236 | +**PowerShell (`~/.claude/statusline.ps1`):** |
| 237 | +```powershell |
| 238 | +$SHOW_MODEL = $true |
| 239 | +$SHOW_TOKEN_COUNT = $true |
| 240 | +$SHOW_PROGRESS_BAR = $true |
| 241 | +$SHOW_DIRECTORY = $true |
| 242 | +$SHOW_GIT_BRANCH = $true |
| 243 | +$SHOW_COST = $false |
| 244 | +$SHOW_DURATION = $true |
| 245 | +$SHOW_TIME = $true |
| 246 | +$SHOW_VERSION = $true |
| 247 | +``` |
| 248 | + |
| 249 | +--- |
| 250 | + |
| 251 | +## Troubleshooting |
| 252 | + |
| 253 | +### Status line not appearing |
| 254 | + |
| 255 | +1. Verify the script exists at the expected location |
| 256 | +2. Check that `~/.claude/settings.json` contains the `statusLine` configuration |
| 257 | +3. Restart Claude Code after making changes |
| 258 | + |
| 259 | +### Colors not displaying |
| 260 | + |
| 261 | +- Ensure your terminal supports ANSI escape codes |
| 262 | +- Try a different terminal emulator if colors don't appear |
| 263 | + |
| 264 | +### Progress bar characters look wrong |
| 265 | + |
| 266 | +- Ensure your terminal font supports Unicode block characters |
| 267 | +- Try a font like "Fira Code", "JetBrains Mono", or "Cascadia Code" |
| 268 | + |
| 269 | +### jq not found (Mac/Linux) |
| 270 | + |
| 271 | +Install jq using your package manager (see Requirements section above). |
| 272 | + |
| 273 | +--- |
| 274 | + |
| 275 | +## Plugin Details |
| 276 | + |
| 277 | +- **Name:** AI-Statusline |
| 278 | +- **Version:** 1.1.0 |
| 279 | +- **Type:** UI Customization |
| 280 | +- **Features:** |
| 281 | + - Commands: `/statusline-wizard`, `/statusline-edit` |
| 282 | + - Skills: `statusline-setup` |
| 283 | +- **License:** MIT |
| 284 | +- **Author:** Charles Jones |
| 285 | + |
| 286 | +--- |
| 287 | + |
| 288 | +## Contributing |
| 289 | + |
| 290 | +Found a bug or have a suggestion? [Open an issue](https://github.com/charlesjones-dev/claude-code-plugins-dev/issues) or submit a pull request! |
| 291 | + |
| 292 | +--- |
| 293 | + |
| 294 | +## License |
| 295 | + |
| 296 | +MIT License - See [LICENSE](LICENSE) file for details. |
| 297 | + |
| 298 | +--- |
| 299 | + |
| 300 | +**Built for the Claude Code community** |
0 commit comments