Skip to content

Commit 42dc139

Browse files
Merge pull request #6 from charlesjones-dev/feat/ai-statusline-rate-limits
feat(ai-statusline): add rate limit usage display
2 parents 47125b3 + d3ccf07 commit 42dc139

7 files changed

Lines changed: 99 additions & 14 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"metadata": {
88
"description": "A curated list of custom Claude Code plugins, agents, and skills for developers.",
9-
"version": "2.0.1",
9+
"version": "2.0.2",
1010
"pluginRoot": "./plugins"
1111
},
1212
"plugins": [
@@ -154,8 +154,8 @@
154154
{
155155
"name": "ai-statusline",
156156
"source": "./plugins/ai-statusline",
157-
"description": "AI-powered status line customization - Interactive setup and edit wizards for configuring Claude Code's status line with progress bars and customizable display options",
158-
"version": "1.2.1",
157+
"description": "AI-powered status line customization - Interactive setup and edit wizards for configuring Claude Code's status line with progress bars, rate limit display, and customizable display options",
158+
"version": "1.2.2",
159159
"keywords": [
160160
"ai",
161161
"statusline",

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [2.0.2] - 2026-03-19
11+
12+
### Added
13+
14+
#### AI-Statusline Plugin (v1.2.2)
15+
16+
- **Added rate limit usage display** - Shows 5-hour and 7-day rate limit percentages with color-coded thresholds (green <50%, yellow 50-79%, red 80%+)
17+
- New `SHOW_RATE_LIMITS` configuration option (enabled by default)
18+
- Reads `rate_limits.five_hour.used_percentage` and `rate_limits.seven_day.used_percentage` from the statusline JSON input
19+
- Requires Claude Code 2.1.80+ (gracefully hidden on older versions where the field is absent)
20+
- Updated both Bash and PowerShell script templates
21+
- Added to `/statusline-wizard` and `/statusline-edit` question flows
22+
1023
## [2.0.1] - 2026-02-17
1124

1225
### Fixed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Claude Code Plugins for Developers
22

3-
[![Version](https://img.shields.io/badge/version-2.0.1-blue.svg)](https://github.com/charlesjones-dev/claude-code-plugins-dev/releases)
3+
[![Version](https://img.shields.io/badge/version-2.0.2-blue.svg)](https://github.com/charlesjones-dev/claude-code-plugins-dev/releases)
44
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
55
[![GitHub Issues](https://img.shields.io/github/issues/charlesjones-dev/claude-code-plugins-dev.svg)](https://github.com/charlesjones-dev/claude-code-plugins-dev/issues)
66
[![GitHub Stars](https://img.shields.io/github/stars/charlesjones-dev/claude-code-plugins-dev.svg)](https://github.com/charlesjones-dev/claude-code-plugins-dev/stargazers)

plugins/ai-statusline/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ai-statusline",
3-
"version": "1.2.1",
3+
"version": "1.2.2",
44
"description": "AI-powered status line customization - Interactive setup and edit wizards for configuring Claude Code's status line with progress bars and customizable display options",
55
"author": {
66
"name": "Charles Jones",

plugins/ai-statusline/README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Provides interactive commands to configure Claude Code's status line with visual
1111
### Example Status Line
1212

1313
```
14-
Claude Opus 4.5 · 42k/100k ▓▓▓▓░░░░░░ 42% · my-project · main · 5m 23s · 2:45pm · v1.0.24
14+
Claude Opus 4.6 · 42k/100k ▓▓▓▓░░░░░░ 42% · 5h:12% 7d:4% · my-project · main · 5m 23s · 2:45pm · v2.1.80
1515
```
1616

1717
---
@@ -44,7 +44,7 @@ The wizard asks about three categories of display options:
4444
1. **Context Display** (what to show about your Claude session)
4545
- Token count (e.g., "50k/100k")
4646
- Progress bar (visual percentage indicator)
47-
- Model name (e.g., "Claude Opus 4.5")
47+
- Model name (e.g., "Claude Opus 4.6")
4848

4949
2. **Project Display** (what to show about your project)
5050
- Current directory name
@@ -55,6 +55,7 @@ The wizard asks about three categories of display options:
5555
- Current time
5656
- Claude Code version
5757
- Session cost (disabled by default)
58+
- Rate limit usage - 5h and 7d windows (requires Claude Code 2.1.80+)
5859

5960
### `/statusline-edit`
6061

@@ -106,7 +107,7 @@ Edit your existing status line configuration.
106107

107108
| Option | Default | Description |
108109
|--------|---------|-------------|
109-
| Model name | On | Display model name (e.g., "Claude Opus 4.5") |
110+
| Model name | On | Display model name (e.g., "Claude Opus 4.6") |
110111
| Token count | On | Display token usage (e.g., "50k/100k") |
111112
| Progress bar | On | Display visual progress bar with percentage |
112113
| Current directory | On | Display current working directory name |
@@ -115,6 +116,7 @@ Edit your existing status line configuration.
115116
| Current time | On | Display current time |
116117
| Claude Code version | On | Display Claude Code version number |
117118
| Session cost | Off | Display session cost in USD |
119+
| Rate limit usage | On | Display 5-hour and 7-day rate limit percentages (requires Claude Code 2.1.80+) |
118120

119121
---
120122

@@ -132,6 +134,18 @@ The progress bar uses Unicode block characters to show context usage:
132134

133135
Color changes automatically based on usage level to help you monitor context consumption.
134136

137+
### Rate Limit Display
138+
139+
Shows your 5-hour and 7-day rate limit usage with color coding:
140+
141+
```
142+
5h:12% 7d:4% (Green - under 50%)
143+
5h:65% 7d:42% (Yellow - 50-79%)
144+
5h:92% 7d:85% (Red - 80%+)
145+
```
146+
147+
Requires Claude Code 2.1.80 or later. The `rate_limits` field is not available in earlier versions.
148+
135149
### Cross-Platform Support
136150

137151
- **Mac/Linux**: Generates `~/.claude/statusline.sh` (Bash script)
@@ -223,6 +237,7 @@ SHOW_COST=false # Show session cost
223237
SHOW_DURATION=true # Show session duration
224238
SHOW_TIME=true # Show current time
225239
SHOW_VERSION=true # Show Claude Code version
240+
SHOW_RATE_LIMITS=true # Show rate limit usage (5h/7d, requires CC 2.1.80+)
226241
```
227242

228243
**PowerShell (`~/.claude/statusline.ps1`):**
@@ -236,6 +251,7 @@ $SHOW_COST = $false
236251
$SHOW_DURATION = $true
237252
$SHOW_TIME = $true
238253
$SHOW_VERSION = $true
254+
$SHOW_RATE_LIMITS = $true
239255
```
240256

241257
---
@@ -267,7 +283,7 @@ Install jq using your package manager (see Requirements section above).
267283
## Plugin Details
268284

269285
- **Name:** AI-Statusline
270-
- **Version:** 1.2.1
286+
- **Version:** 1.2.2
271287
- **Type:** UI Customization
272288
- **Features:**
273289
- Skills: `/statusline-wizard`, `/statusline-edit`

plugins/ai-statusline/skills/statusline-edit/SKILL.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ SHOW_COST=false
4242
SHOW_DURATION=true
4343
SHOW_TIME=true
4444
SHOW_VERSION=true
45+
SHOW_RATE_LIMITS=true
4546
```
4647

4748
**For PowerShell scripts**, look for lines like:
@@ -55,6 +56,7 @@ $SHOW_COST = $false
5556
$SHOW_DURATION = $true
5657
$SHOW_TIME = $true
5758
$SHOW_VERSION = $true
59+
$SHOW_RATE_LIMITS = $true
5860
```
5961

6062
Store the current values to use as defaults in the wizard.
@@ -80,21 +82,22 @@ Options (pre-select based on current config):
8082
- Current time - select if SHOW_TIME=true
8183
- Claude Code version - select if SHOW_VERSION=true
8284
- Session cost - select if SHOW_COST=true
85+
- Rate limit usage (5h/7d) - select if SHOW_RATE_LIMITS=true
8386

8487
### Phase 4: Update Script
8588

8689
Update ONLY the SHOW_* variables at the top of the existing script file based on wizard selections.
8790

8891
**For Bash**: Use Edit tool to replace the configuration block:
8992
```bash
90-
SHOW_MODEL=true # Show model name (e.g., "Claude Opus 4.5")
93+
SHOW_MODEL=true # Show model name (e.g., "Claude Opus 4.6")
9194
SHOW_TOKEN_COUNT=true # Show token usage count (e.g., "50k/100k")
9295
...
9396
```
9497

9598
**For PowerShell**: Use Edit tool to replace the configuration block:
9699
```powershell
97-
$SHOW_MODEL = $true # Show model name (e.g., "Claude Opus 4.5")
100+
$SHOW_MODEL = $true # Show model name (e.g., "Claude Opus 4.6")
98101
$SHOW_TOKEN_COUNT = $true # Show token usage count (e.g., "50k/100k")
99102
...
100103
```
@@ -120,4 +123,5 @@ Current configuration:
120123
- Duration: [enabled/disabled]
121124
- Time: [enabled/disabled]
122125
- Version: [enabled/disabled]
126+
- Rate limits: [enabled/disabled]
123127
```

plugins/ai-statusline/skills/statusline-wizard/SKILL.md

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Use AskUserQuestion with these grouped questions:
3939
- Current time - default selected
4040
- Claude Code version - default selected
4141
- Session cost - NOT selected by default
42+
- Rate limit usage (5h/7d) - default selected
4243

4344
### Success Message
4445

@@ -101,6 +102,7 @@ Use the AskUserQuestion tool to gather user preferences. Group questions logical
101102
- Show session duration (default: yes)
102103
- Show current time (default: yes)
103104
- Show Claude Code version (default: yes)
105+
- Show rate limit usage - 5h and 7d windows (default: yes)
104106

105107
### Phase 3: Create Script File
106108

@@ -154,7 +156,7 @@ Run `chmod +x ~/.claude/statusline.sh` to make the script executable.
154156
# Configuration - Set these to customize your status line
155157
# =============================================================================
156158

157-
SHOW_MODEL=true # Show model name (e.g., "Claude Opus 4.5")
159+
SHOW_MODEL=true # Show model name (e.g., "Claude Opus 4.6")
158160
SHOW_TOKEN_COUNT=true # Show token usage count (e.g., "50k/100k")
159161
SHOW_PROGRESS_BAR=true # Show visual progress bar
160162
SHOW_DIRECTORY=true # Show current directory name
@@ -163,6 +165,7 @@ SHOW_COST=false # Show session cost (useful for API/Pro users)
163165
SHOW_DURATION=true # Show session duration
164166
SHOW_TIME=true # Show current time
165167
SHOW_VERSION=true # Show Claude Code version
168+
SHOW_RATE_LIMITS=true # Show rate limit usage (5h/7d windows, requires Claude Code 2.1.80+)
166169

167170
# =============================================================================
168171

@@ -283,6 +286,25 @@ else
283286
fi
284287
fi
285288

289+
# Rate limits (requires Claude Code 2.1.80+)
290+
if [ "$SHOW_RATE_LIMITS" = true ]; then
291+
rl_5h=$(echo "$input" | jq -r '.rate_limits.five_hour.used_percentage // empty')
292+
rl_7d=$(echo "$input" | jq -r '.rate_limits.seven_day.used_percentage // empty')
293+
294+
if [ -n "$rl_5h" ] && [ -n "$rl_7d" ]; then
295+
if [ "$rl_5h" -lt 50 ]; then rl_5h_color='32'
296+
elif [ "$rl_5h" -lt 80 ]; then rl_5h_color='33'
297+
else rl_5h_color='31'; fi
298+
299+
if [ "$rl_7d" -lt 50 ]; then rl_7d_color='32'
300+
elif [ "$rl_7d" -lt 80 ]; then rl_7d_color='33'
301+
else rl_7d_color='31'; fi
302+
303+
[ -n "$output" ] && output="$output · "
304+
output="$output\033[${rl_5h_color}m5h:${rl_5h}%\033[0m \033[${rl_7d_color}m7d:${rl_7d}%\033[0m"
305+
fi
306+
fi
307+
286308
# Directory
287309
if [ "$SHOW_DIRECTORY" = true ]; then
288310
[ -n "$output" ] && output="$output · "
@@ -331,7 +353,7 @@ printf '%b' "$output"
331353
# Configuration - Set these to customize your status line
332354
# =============================================================================
333355
334-
$SHOW_MODEL = $true # Show model name (e.g., "Claude Opus 4.5")
356+
$SHOW_MODEL = $true # Show model name (e.g., "Claude Opus 4.6")
335357
$SHOW_TOKEN_COUNT = $true # Show token usage count (e.g., "50k/100k")
336358
$SHOW_PROGRESS_BAR = $true # Show visual progress bar
337359
$SHOW_DIRECTORY = $true # Show current directory name
@@ -340,6 +362,7 @@ $SHOW_COST = $false # Show session cost (useful for API/Pro users)
340362
$SHOW_DURATION = $true # Show session duration
341363
$SHOW_TIME = $true # Show current time
342364
$SHOW_VERSION = $true # Show Claude Code version
365+
$SHOW_RATE_LIMITS = $true # Show rate limit usage (5h/7d windows, requires Claude Code 2.1.80+)
343366
344367
# =============================================================================
345368
@@ -473,6 +496,34 @@ if ($null -ne $usage) {
473496
}
474497
}
475498
499+
# Rate limits (requires Claude Code 2.1.80+)
500+
if ($SHOW_RATE_LIMITS) {
501+
$rl = $data.rate_limits
502+
if ($null -ne $rl) {
503+
$rl_parts = @()
504+
505+
if ($null -ne $rl.five_hour) {
506+
$rl_5h = [int]$rl.five_hour.used_percentage
507+
if ($rl_5h -lt 50) { $rl_5h_color = $green }
508+
elseif ($rl_5h -lt 80) { $rl_5h_color = $yellow }
509+
else { $rl_5h_color = $red }
510+
$rl_parts += "${rl_5h_color}5h:${rl_5h}%$reset"
511+
}
512+
513+
if ($null -ne $rl.seven_day) {
514+
$rl_7d = [int]$rl.seven_day.used_percentage
515+
if ($rl_7d -lt 50) { $rl_7d_color = $green }
516+
elseif ($rl_7d -lt 80) { $rl_7d_color = $yellow }
517+
else { $rl_7d_color = $red }
518+
$rl_parts += "${rl_7d_color}7d:${rl_7d}%$reset"
519+
}
520+
521+
if ($rl_parts.Count -gt 0) {
522+
$segments += ($rl_parts -join " ")
523+
}
524+
}
525+
}
526+
476527
# Directory
477528
if ($SHOW_DIRECTORY) {
478529
$segments += "$blue$current_dir$reset"
@@ -511,7 +562,7 @@ Write-Host -NoNewline ($segments -join $sep)
511562

512563
| Variable | Default | Description |
513564
|----------|---------|-------------|
514-
| SHOW_MODEL | true | Display model name (e.g., "Claude Opus 4.5") |
565+
| SHOW_MODEL | true | Display model name (e.g., "Claude Opus 4.6") |
515566
| SHOW_TOKEN_COUNT | true | Display token usage (e.g., "50k/100k") |
516567
| SHOW_PROGRESS_BAR | true | Display visual progress bar with percentage |
517568
| SHOW_DIRECTORY | true | Display current working directory name |
@@ -520,6 +571,7 @@ Write-Host -NoNewline ($segments -join $sep)
520571
| SHOW_DURATION | true | Display session duration |
521572
| SHOW_TIME | true | Display current time |
522573
| SHOW_VERSION | true | Display Claude Code version |
574+
| SHOW_RATE_LIMITS | true | Display rate limit usage (5h/7d windows, requires Claude Code 2.1.80+) |
523575

524576
## Important Notes
525577

0 commit comments

Comments
 (0)