claudeline

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2026 License: BSD-3-Clause

README ΒΆ

claudeline

CI Go License

Real-time statusline for Claude Code showing live quota usage directly from stdin data.

Example output

πŸ€– Claude | πŸ’° $1.37 | 🟒 7d: 45% (4d 2h) | 🟒 5h: 12% (4h 23m)
πŸ€– Claude | πŸ’° $0.00 | ⚠️ degraded | 🧠 67% | πŸ”„ 2 | 🟠 7d: 74% (1d 17h) | πŸ”΄ 5h: 91% (27m)

Segments

Segment Description
πŸ€– Model Active model name
πŸ’° Cost Cumulative session cost in USD
⚠️/πŸ”Ά/πŸ”΄ Status Anthropic platform status: ⚠️ degraded, πŸ”Ά major outage, πŸ”΄ critical (hidden when all clear)
🧠 Context Context window usage percentage (color-coded)
πŸ”„ Compactions Number of context compactions in current session
🟒/🟑/🟠/πŸ”΄ 7d 7-day rolling quota utilization with time until reset
🟒/🟑/🟠/πŸ”΄ 5h 5-hour rolling quota utilization with time until reset (⬆ during off-peak promotions)

Quota indicators compare your usage rate against elapsed time to warn about hitting limits:

  • 🟒 usage pace is sustainable
  • 🟑 usage is slightly ahead of schedule
  • 🟠 usage is significantly ahead of schedule
  • πŸ”΄ on track to hit the limit before reset
Off-peak promotions

During Anthropic usage promotions, off-peak hours provide boosted 5-hour limits. claudeline shows ⬆ next to the 5h quota segment when a promotion is active and you are in an off-peak window. The 7-day limit is unaffected β€” only bonus usage above the normal 5h cap is excluded from weekly counting.

Disable with --no-offpeak or offpeak = false in config.

Requirements

  • Claude Code v2.1.80+ (provides rate_limits in statusline stdin)

Installation

Homebrew
brew install lexfrei/tap/claudeline
From source
go install github.com/lexfrei/claudeline/cmd/claudeline@latest

Usage

Add the statusLine block to ~/.claude/settings.json:

{
  "statusLine": {
    "type": "command",
    "command": "claudeline",
    "padding": 0
  }
}

Claude Code pipes session data as JSON to stdin. claudeline reads it and outputs a formatted statusline string.

Restart Claude Code after changing settings.

Configuration

Optional config file at ~/.claudelinerc.toml:

[segments]
model = true
cost = true
status = true
context = true
compactions = true
quota = true
offpeak = true

[cache]
status_ttl = "15s"

Set any segment to false to hide it.

CLI flags

Flags override config file settings:

claudeline --no-cost --no-status
claudeline --config /path/to/config.toml

Available flags: --no-model, --no-cost, --no-status, --no-context, --no-compactions, --no-quota, --no-offpeak.

Advanced: --mac-insecure mode

For additional data not available in stdin, claudeline can access the Anthropic usage API directly via macOS Keychain. This gives you:

  • Per-model 7-day quotas (Opus, Sonnet, Cowork, OAuth apps)
  • Extra credit usage (πŸ’³ segment)

Security note: this mode reads your OAuth token from macOS Keychain. Only enable it if you understand the implications.

claudeline --mac-insecure --per-model-quota
mac_insecure = true

[segments]
per_model_quota = true
credits = true

[cache]
usage_ttl = "10m"

Additional flags with --mac-insecure: --per-model-quota, --no-credits.

Known limitations of --mac-insecure: the Anthropic usage API has a very low rate limit (~5 requests per window). Responses are cached for 10 minutes by default (usage_ttl). macOS only.

License

BSD-3-Clause

Directories ΒΆ

Path Synopsis
cmd
claudeline command
Package main is the entry point for the claudeline CLI.
Package main is the entry point for the claudeline CLI.
internal
cache
Package cache provides file-based caching with TTL for statusline data.
Package cache provides file-based caching with TTL for statusline data.
compaction
Package compaction counts context compactions in Claude Code session transcripts.
Package compaction counts context compactions in Claude Code session transcripts.
config
Package config provides configuration loading from TOML files and CLI flags.
Package config provides configuration loading from TOML files and CLI flags.
fmtutil
Package fmtutil provides formatting helpers for the Claude Code statusline.
Package fmtutil provides formatting helpers for the Claude Code statusline.
httpclient
Package httpclient provides a simple HTTP GET function for statusline API calls.
Package httpclient provides a simple HTTP GET function for statusline API calls.
keychain
Package keychain provides macOS Keychain access for OAuth tokens.
Package keychain provides macOS Keychain access for OAuth tokens.
promotion
Package promotion provides client-side detection of Anthropic usage promotions.
Package promotion provides client-side detection of Anthropic usage promotions.
status
Package status checks the Claude platform status for active incidents.
Package status checks the Claude platform status for active incidents.
usage
Package usage provides access to the Anthropic quota usage API.
Package usage provides access to the Anthropic quota usage API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL