New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Native /statusline extension with context bar, rate limits, and a spend budget for seats without limits.

version
1.5.3
GitHub stars
37
View on GitHub

What it does

  • Adds /statusline-wizard and /statusline-edit to build and change a status line with progress bar, 5h/7d limits, and session cost
  • Shows context usage as a color-coded bar, plus 5-hour and 7-day rate-limit percentages when your plan has them
  • Tracks month-to-date spend against a USD cap for Enterprise and API seats that receive no rate-limit data
  • Offers a sandbox indicator and per-segment toggles, and edits the script without regenerating it

Builds on Claude Code's native /statusline with a context progress bar, 5h/7d rate limits, a month-to-date spend budget for Enterprise/API seats without rate limits, the reasoning-effort level, a sandbox indicator, cost and duration, and a wizard to change any of it

Add marketplace

/plugin marketplace add charlesjones-dev/claude-code-plugins-dev

Run it inside Claude Code once, then install the plugin below.

Install

/plugin install ai-statusline@ai-agent-plugins

Run it inside Claude Code after adding the marketplace.

Files

Discovered from source

Status Line Edit

Edit your existing Claude Code status line configuration.

Instructions

CRITICAL: This command MUST NOT accept any arguments. If the user provided any text after this command, COMPLETELY IGNORE it.

Phase 1: Detect Existing Configuration

  1. Detect the operating system using Bash: uname -s
    • "Darwin" = macOS, "Linux" = Linux, otherwise assume Windows
  2. Check if the status line script exists:
    • Mac/Linux: ~/.claude/statusline.sh
    • Windows: C:/Users/USERNAME/.claude/statusline.ps1
  3. If the script does NOT exist, display:
    No status line script found at ~/.claude/statusline.sh
    
    Run /statusline-wizard to set up your status line first.
    
    Then STOP - do not continue.

Phase 2: Read Current Configuration

Read the existing script file and parse the current SHOW_* variable values:

For Bash scripts, look for lines like:

SHOW_MODEL=true
SHOW_EFFORT=true
SHOW_SANDBOX=false
SHOW_TOKEN_COUNT=true
SHOW_PROGRESS_BAR=true
SHOW_DIRECTORY=true
SHOW_GIT_BRANCH=true
SHOW_COST=false
SHOW_DURATION=true
SHOW_TIME=true
SHOW_VERSION=true
SHOW_RATE_LIMITS=true
SHOW_SPEND_BUDGET=false
SPEND_LIMIT_USD=0
SPEND_RESET_DAY=1
SPEND_RESET_TIME=00:00

For PowerShell scripts, look for lines like:

$SHOW_MODEL = $true
$SHOW_EFFORT = $true
$SHOW_TOKEN_COUNT = $true
$SHOW_PROGRESS_BAR = $true
$SHOW_DIRECTORY = $true
$SHOW_GIT_BRANCH = $true
$SHOW_COST = $false
$SHOW_DURATION = $true
$SHOW_TIME = $true
$SHOW_VERSION = $true
$SHOW_RATE_LIMITS = $true
$SHOW_SPEND_BUDGET = $false
$SPEND_LIMIT_USD = 0
$SPEND_RESET_DAY = 1
$SPEND_RESET_TIME = '00:00'

Store the current values to use as defaults in the wizard.

Note: Scripts generated by older plugin versions may lack SHOW_EFFORT (pre-1.3.0), SHOW_SPEND_BUDGET / SPEND_LIMIT_USD / SPEND_RESET_DAY / SPEND_RESET_TIME (pre-1.4.0), or SHOW_SANDBOX (pre-1.5.0). If a variable is not present in the script, OMIT the matching option from the wizard (toggling it would have no effect) and, after the update completes, mention that re-running /statusline-wizard will regenerate the script with support for the missing segment(s). The exception is SHOW_SANDBOX in a PowerShell script: it's never there, because the sandbox doesn't run on native Windows, so omit the option without suggesting a re-run.

Scripts generated before 1.5.2 have older rate-limit code. If the script has SHOW_RATE_LIMITS but no rate_limit_pct function (Bash) or Get-RateLimitPercent function (PowerShell), keep the option, and after the update mention that re-running /statusline-wizard updates the rate-limit code. The newer code leaves out a rate-limit window that is empty or malformed, instead of showing 5h:0% or printing errors, which matters on accounts without a 5-hour limit.

Phase 3: Configuration Wizard with Pre-selected Values

Use AskUserQuestion with these grouped questions. Pre-select options based on current values from Phase 2.

Question 1 - Context Display (multiSelect: true): Options (pre-select based on current config):

  • Model name - select if SHOW_MODEL=true
  • Effort level - select if SHOW_EFFORT=true
  • Token count (50k/100k) - select if SHOW_TOKEN_COUNT=true
  • Progress bar - select if SHOW_PROGRESS_BAR=true

Question 2 - Project Display (multiSelect: true): Options (pre-select based on current config):

  • Current directory - select if SHOW_DIRECTORY=true
  • Git branch - select if SHOW_GIT_BRANCH=true
  • Sandbox indicator - select if SHOW_SANDBOX=true. Description: "Shows 'Sandbox' in orange after the effort level while Claude Code's Bash sandbox is on for this session. Hidden when it's off."

Question 3 - Session Display (multiSelect: true): Options (pre-select based on current config):

  • Session duration - select if SHOW_DURATION=true
  • Current time - select if SHOW_TIME=true
  • Claude Code version - select if SHOW_VERSION=true
  • Session cost - select if SHOW_COST=true

Question 4 - Usage Limits (multiSelect: true): Options (pre-select based on current config):

  • Rate limit usage (5h/7d) - select if SHOW_RATE_LIMITS=true. Description: "Only shown on plans with rolling rate-limit windows (Pro, Max and Ultra). Each window shows only when your plan has it, so an account without a 5-hour limit shows 7d alone. Enterprise and API seats billed against a monthly spend cap have no rate limits, so the segment stays hidden. Pick Monthly spend budget instead."
  • Monthly spend budget (mo:$47.20/$2000 2.4%) - select if SHOW_SPEND_BUDGET=true. Description: "Month-to-date spend across all Claude Code sessions on this machine, as estimated locally by Claude Code."

Questions 5 and 6 - Spend cap and reset (only ask if "Monthly spend budget" is selected; send both in one AskUserQuestion call, single select each):

Question 5 - Monthly spend cap (USD): offer "No cap - show bare total", "$500", "$1000", "$2000", pre-selecting the option that matches the current SPEND_LIMIT_USD (or describe the current custom value in the question text). The user can pick "Other" and type any amount; write the numeric value (digits and optional decimal point only) into SPEND_LIMIT_USD. 0 means no cap.

Question 6 - When does the cap reset?: offer "1st of the month at 00:00 UTC" (Anthropic console default), "1st of the month at midnight local time", and "Keep current: day N at HH:MM UTC" showing the values read in Phase 2. The user can pick "Other" and paste what the console shows (e.g., "Resets Wed, Sep 30, 8:00 PM EDT"); convert it to UTC and write the day of month (1-28) to SPEND_RESET_DAY and HH:MM (24-hour) to SPEND_RESET_TIME. Tell the user the UTC values you wrote.

Phase 4: Update Script

Update ONLY the SHOW_* variables (and SPEND_LIMIT_USD, SPEND_RESET_DAY, SPEND_RESET_TIME) at the top of the existing script file based on wizard selections.

For Bash: Use Edit tool to replace the configuration block:

SHOW_MODEL=true           # Show model name (e.g., "Claude Opus 4.8")
SHOW_EFFORT=true          # Show reasoning effort level (e.g., "high")
SHOW_SANDBOX=false        # Show "Sandbox" when Claude Code's Bash sandbox is enabled for this session
SHOW_TOKEN_COUNT=true     # Show token usage count (e.g., "50k/100k")
...

For PowerShell: Use Edit tool to replace the configuration block:

$SHOW_MODEL = $true           # Show model name (e.g., "Claude Opus 4.8")
$SHOW_EFFORT = $true          # Show reasoning effort level (e.g., "high")
$SHOW_TOKEN_COUNT = $true     # Show token usage count (e.g., "50k/100k")
...

IMPORTANT: Do NOT regenerate the entire script. Only update the configuration variables section.

Success Message

After successful update, display:

Status line updated!

Check out your refreshed status line below!

Current configuration:
- Model name: [enabled/disabled]
- Effort level: [enabled/disabled]
- Sandbox indicator: [enabled/disabled] (omit this line on Windows)
- Token count: [enabled/disabled]
- Progress bar: [enabled/disabled]
- Directory: [enabled/disabled]
- Git branch: [enabled/disabled]
- Session cost: [enabled/disabled]
- Duration: [enabled/disabled]
- Time: [enabled/disabled]
- Version: [enabled/disabled]
- Rate limits: [enabled/disabled]
- Monthly spend budget: [enabled/disabled] (cap: $N or none; resets day N at HH:MM UTC)

If the monthly spend budget was just enabled, append:

Monthly spend note: the "mo:" segment is Claude Code's local cost estimate for sessions
on this machine rendered from now on. It will not match the Anthropic console exactly;
use the console usage page for the authoritative figure.

Readme

AI-Statusline plugin

Adds a context bar, rate limits, a spend budget, the effort level and a sandbox indicator to Claude Code's status line, with a wizard to change them.

Claude Code's built-in /statusline command covers basic setup: you describe what you want, or it builds a line from your shell prompt. This plugin adds:

  • a Unicode progress bar with color thresholds
  • 5-hour and 7-day rate-limit percentages with color coding
  • a month-to-date spend budget for Enterprise and API seats that have no rate limits
  • the reasoning-effort level in /effort-matched colors, including ultracode
  • a sandbox indicator that appears while the Bash sandbox is on
  • session cost and duration segments
  • a toggle for each segment
  • /statusline-edit, which changes the settings later without regenerating the script

Example status line

Opus 5 (1M context) · high · 420k/1000k ▓▓▓▓░░░░░░ 42% · 5h:12% 7d:4% · my-project · main · 5m 23s · 2:45pm · v2.1.80

On an account without a 5-hour limit, such as a verified Ultra plan, the rate-limit segment shows the weekly window alone:

Opus 5 (1M context) · high · 420k/1000k ▓▓▓▓░░░░░░ 42% · 7d:4% · my-project · main · 5m 23s · 2:45pm · v2.1.312

On an Enterprise or API seat with a monthly spend cap (no 5h/7d rate limits), with the optional spend budget enabled:

Opus 5 (1M context) · high · 71k/1000k ░░░░░░░░░░ 7% · mo:$47.20/$2000 2.4% · my-project · main · 7m 48s · 4:52pm · v2.1.267

With the optional sandbox indicator enabled, Sandbox appears in orange after the effort level while the Bash sandbox is on:

Opus 5 (1M context) · high · Sandbox · 420k/1000k ▓▓▓▓░░░░░░ 42% · 5h:12% 7d:4% · my-project · main · 5m 23s · 2:45pm · v2.1.293

Available skills

/statusline-wizard

Sets up Claude Code's status line from scratch through a wizard.

What it does
  • Detects your operating system (Mac/Linux/Windows)
  • Checks for existing configuration and offers to back up if present
  • Runs an interactive wizard using grouped questions
  • Creates the appropriate script file (statusline.sh or statusline.ps1)
  • Updates ~/.claude/settings.json with the statusLine configuration
  • Makes the script executable on Mac/Linux
Usage
/statusline-wizard
Wizard questions

The wizard asks about four categories of display options:

  1. Context display: what to show about your Claude session

    • Token count (e.g., "420k/1000k")
    • Progress bar (visual percentage indicator)
    • Model name (e.g., "Opus 5 (1M context)")
    • Effort level (e.g., "high", with /effort-matched colors)
  2. Project display: what to show about your project

    • Current directory name
    • Git branch name
    • Sandbox indicator (Mac/Linux; disabled by default, and shown only while the Bash sandbox is on)
  3. Session display: what to show about timing and costs

    • Session duration
    • Current time
    • Claude Code version
    • Session cost (disabled by default)
  4. Usage limits: how close you are to your plan's limits

    • Rate limit usage: the 5h and 7d windows (Pro, Max and Ultra plans; each window shows only when your plan has it)
    • Monthly spend budget: month-to-date spend across sessions on this machine (disabled by default; prompts for your monthly cap in USD and when it resets)

/statusline-edit

Edit your existing status line configuration.

What it does
  • Detects your OS and locates the existing script file
  • Reads current configuration values from the script
  • Asks the same questions as the wizard
  • Updates only the configuration variables (preserves the rest of the script)
Usage
/statusline-edit

If no status line script exists, it asks you to run /statusline-wizard first.

Installation

/plugin marketplace add charlesjones-dev/ai-agent-plugins
/plugin install ai-statusline@ai-agent-plugins

Usage

# Step 1: Run the setup wizard
/statusline-wizard

# Step 2: Answer the interactive questions
# Select which elements you want displayed

# Step 3: The new status line appears right away

# Later: Edit your configuration
/statusline-edit

Configuration options

OptionDefaultDescription
Model nameOnThe model name (e.g., "Opus 5 (1M context)")
Effort levelOnThe reasoning effort level, in /effort-matched colors
Sandbox indicatorOffSandbox in orange after the effort level while the Bash sandbox is on (Mac/Linux only)
Token countOnToken usage (e.g., "420k/1000k")
Progress barOnA progress bar with the percentage
Current directoryOnThe working directory's name
Git branchOnThe current git branch
Session durationOnHow long the session has run
Current timeOnThe current time
Claude Code versionOnThe Claude Code version number
Session costOffThe session cost in USD
Rate limit usageOnThe 5-hour and 7-day rate limit percentages. Each window is hidden when your account doesn't have it
Monthly spend budgetOffMonth-to-date spend across all sessions on this machine, e.g. mo:$47.20/$2000 2.4%
Monthly spend cap0 (none)USD cap used for the spend budget percentage and colors; 0 shows the bare total
Spend cap reset1st, 00:00 UTCDay of month (1-28) and time (UTC) the cap resets; the wizard converts what the console shows into UTC

Features

Progress bar

The progress bar uses Unicode block characters to show context usage:

▓▓▓▓░░░░░░ 42%  (Green - under 70%)
▓▓▓▓▓▓▓░░░ 74%  (Yellow - 70-79%)
▓▓▓▓▓▓▓▓░░ 85%  (Red - 80%+)

Rate limits

Shows your 5-hour and 7-day rate limit usage with color coding:

5h:12% 7d:4%    (Green - under 50%)
5h:65% 7d:42%   (Yellow - 50-79%)
5h:92% 7d:85%   (Red - 80%+)
Not on every plan

Claude Code only sends rate_limits for plans with rolling usage windows (Pro, Max and Ultra). Enterprise seats and API-billed accounts on a monthly spend cap receive no rate-limit data at all, so this segment stays hidden even when enabled. Use the monthly spend budget segment below instead.

Accounts without a 5-hour limit

Anthropic renamed its plans: Max 5x is now Max, and Max 20x is now Ultra. Verified Ultra accounts no longer have a 5-hour limit. Newer Ultra accounts keep one until they're verified. Weekly limits don't change. Without a 5-hour limit, Claude Code sends no five_hour window, so the segment shows the weekly window alone:

7d:4%

The script checks each window on its own. It leaves out a window whose used_percentage or resets_at is missing, null or not a number, so you don't see 5h:0%, N/A or an extra separator. When neither window is usable, the whole segment disappears.

Monthly spend budget

For accounts with no rolling rate limits, the optional spend segment shows month-to-date spend across all Claude Code sessions on this machine, colored on the same thresholds as the rate-limit segment:

mo:$47.20/$2000 2.4%    (Green - under 50% of cap)
mo:$1240.00/$2000 62.0% (Yellow - 50-79%)
mo:$1700.00/$2000 85.0% (Red - 80%+)
mo:$47.20               (No cap configured - bare total)

Enable it with SHOW_SPEND_BUDGET=true and set SPEND_LIMIT_USD to your seat's monthly cap (the "$0.96 of $2,000.00 spent" figure on the Anthropic console usage page). Leave the cap at 0 to show the bare total.

Reset day and time

The payload doesn't say when your cap resets, so you provide it. SPEND_RESET_DAY (1-28) and SPEND_RESET_TIME (HH:MM, 24-hour) are both in UTC and default to the 1st at 00:00 UTC, which is what the Anthropic console uses. The console shows that same instant in your local time ("Resets Wed, Sep 30, 8:00 PM EDT" is Oct 1 00:00 UTC), and the wizard does the conversion when you paste it. Invalid values fall back to the default rather than breaking the status line.

How the total is kept

Claude Code only reports the current session's cost, so each render writes it to ~/.claude/statusline-spend/<period-start>/<session_id> and the segment sums every file for the current billing period, where the period starts at the most recent reset day/time. One file per session means concurrent sessions never contend for a shared file. The script deletes the files for earlier periods. If the directory can't be created or written (read-only home, missing HOME), the segment silently falls back to the current session's cost.

Caveats
  • It's a local estimate, and it won't match your bill. The figure is Claude Code's own cost.total_cost_usd estimate and won't match the Anthropic console (in one observed case the console showed $0.96 spent while a single live session already reported $1.11). The authoritative sources are the console usage page and the Admin API cost report, which needs an org admin key most seat users don't have.
  • It doesn't backfill. Only sessions rendered after you enable the segment are counted.
  • It counts this machine only. It doesn't include claude.ai web/desktop usage or sessions on other machines.

Effort level

Shows the session's reasoning effort level, colored to match Claude Code's /effort picker:

LevelColor
lowYellow
mediumGreen
highLight purple
xhighDark purple
maxPer-character rainbow
ultracodePurple explosion (✦ultracode✦, cycling purple shades)

The segment reflects live /effort changes and is hidden entirely when the current model doesn't support the effort parameter.

Ultracode detection

Claude Code reports ultracode as plain xhigh in the status line payload, so the scripts scan the session transcript for the most recent /effort command output to tell them apart. If a session never ran /effort, the payload value is shown as-is.

Sandbox indicator

Shows Sandbox in orange, right after the effort level, while Claude Code's Bash sandbox is on for the session. It's hidden while the sandbox is off. It's disabled by default: select it in the wizard, or set SHOW_SANDBOX=true.

The status line payload doesn't say whether the sandbox is on, so the script works it out from your settings the way Claude Code does. The first of these that sets sandbox.enabled wins:

  1. Managed settings: managed-settings.json and managed-settings.d/ in /Library/Application Support/ClaudeCode/ (macOS) or /etc/claude-code/ (Linux, WSL2)
  2. --settings on the claude command line, as inline JSON or a file path, such as claude --settings '{"sandbox": {"enabled": true}}'
  3. .claude/settings.local.json, where /sandbox saves its choices (at the repository root, or the main checkout's root in a worktree)
  4. .claude/settings.json in the directory Claude Code started in
  5. ~/.claude/settings.json

Turning the sandbox on or off with /sandbox shows up on the next refresh.

The indicator reflects your settings. It can't confirm that the sandbox started, and it can't read MDM profiles or server-managed settings. On Linux and WSL2 it stays hidden when bwrap or socat is missing, because the sandbox can't start without them, but other startup failures go unnoticed. When it matters, such as before a security audit, ask Claude to run touch ~/sandbox-probe and check that it fails. The sandbox doesn't run on native Windows, so the PowerShell script has no sandbox indicator.

How it works

  1. The wizard writes one script for your OS (Bash on Mac/Linux, PowerShell on Windows) and adds it to your settings.json (paths below). Claude Code sends the script JSON on stdin.
  2. The script parses the JSON with jq on Mac/Linux, or with PowerShell's ConvertFrom-Json on Windows.
  3. It builds a segment for each option you turned on and joins them with separators.
  4. It colors the segments with standard ANSI escape codes.

Script location

OSScript PathSettings Path
Mac/Linux~/.claude/statusline.sh~/.claude/settings.json
WindowsC:/Users/USERNAME/.claude/statusline.ps1C:/Users/USERNAME/.claude/settings.json

Requirements

Mac/Linux

  • jq, which parses the JSON:
    # macOS
    brew install jq
    
    # Ubuntu/Debian
    sudo apt install jq
    
    # Fedora
    sudo dnf install jq
    

Windows

  • PowerShell 5.1+ (included with Windows 10/11) or PowerShell Core 7+

Terminal support

  • Unicode support for the progress bar characters (▓ and ░)
  • ANSI color codes

Customization

Manual configuration

After running the wizard, you can manually edit the configuration variables at the top of the script file:

Bash, in ~/.claude/statusline.sh:

SHOW_MODEL=true           # Show model name
SHOW_EFFORT=true          # Show reasoning effort level
SHOW_SANDBOX=false        # Show "Sandbox" while the Bash sandbox is on
SHOW_TOKEN_COUNT=true     # Show token usage count
SHOW_PROGRESS_BAR=true    # Show visual progress bar
SHOW_DIRECTORY=true       # Show current directory name
SHOW_GIT_BRANCH=true      # Show current git branch
SHOW_COST=false           # Show session cost
SHOW_DURATION=true        # Show session duration
SHOW_TIME=true            # Show current time
SHOW_VERSION=true         # Show Claude Code version
SHOW_RATE_LIMITS=true     # Show rate limit usage (5h/7d windows)
SHOW_SPEND_BUDGET=false   # Show month-to-date spend across sessions on this machine
SPEND_LIMIT_USD=0         # Monthly spend cap in USD (0 = no cap, show bare total)
SPEND_RESET_DAY=1         # Day of the month (1-28) the cap resets, UTC
SPEND_RESET_TIME=00:00    # Time (HH:MM, 24h, UTC) the cap resets

PowerShell, in C:/Users/USERNAME/.claude/statusline.ps1:

$SHOW_MODEL = $true
$SHOW_EFFORT = $true
$SHOW_TOKEN_COUNT = $true
$SHOW_PROGRESS_BAR = $true
$SHOW_DIRECTORY = $true
$SHOW_GIT_BRANCH = $true
$SHOW_COST = $false
$SHOW_DURATION = $true
$SHOW_TIME = $true
$SHOW_VERSION = $true
$SHOW_RATE_LIMITS = $true
$SHOW_SPEND_BUDGET = $false
$SPEND_LIMIT_USD = 0
$SPEND_RESET_DAY = 1
$SPEND_RESET_TIME = '00:00'

Troubleshooting

Status line not appearing

  1. Verify the script exists at the expected location
  2. Check that ~/.claude/settings.json contains the statusLine configuration
  3. Restart Claude Code if it still doesn't appear

Colors not displaying

Your terminal needs to support ANSI escape codes.

Progress bar characters look wrong

Use a font with Unicode block characters, such as "Fira Code", "JetBrains Mono" or "Cascadia Code".

jq not found (Mac/Linux)

Install jq using your package manager (see Requirements section above).

Rate limits (5h/7d) never appear

Your account has no rolling rate-limit windows, so Claude Code doesn't send rate_limits in the status line payload. This is expected for Enterprise seats and API-billed accounts on a monthly spend cap. Turn on the monthly spend budget segment (SHOW_SPEND_BUDGET=true) for a comparable month-to-date view.

Only the 7d window appears

Your account has no 5-hour limit, as on a verified Ultra plan, so Claude Code sends only the weekly window. This is expected. Run /usage in Claude Code to see which limits your plan has. If your script was generated before version 1.5.2, re-run /statusline-wizard to get the newer rate-limit code.

Spend budget only shows the current session

The script couldn't write to ~/.claude/statusline-spend/ (read-only home directory or HOME not set), so it fell back to the current session's cost. Make that directory writable to restore cross-session totals.

Plugin details

  • Name: AI-Statusline
  • Version: 1.5.3
  • License: MIT
  • Author: Charles Jones

Contributing

Bug reports and fixes are welcome. See CONTRIBUTING.md.

License

MIT License. See LICENSE.

Details

Marketplace
charlesjones-dev/claude-code-plugins-dev
Source
plugins/ai-statusline
Author
Charles Jones
Category
Community
Keywords
ai, statusline, status, customization, ui, progress-bar, configuration, utilities
Listed since
Apr 7, 2026

More from charlesjones-dev/claude-code-plugins-dev

All 17

Similar to ai-statusline

More Developer Tools