Claude Code statusline with real subscription usage data
Project description
Claude Vibeline
A custom statusline for Claude Code that shows session details, prompt cache status, and rate limits — designed for Pro, Max, and Team users.
my-project │ Opus 4.7 (xhigh) │ cache ◷ 4m │ ctx 1M [###-----] 42% │
sess [##------] 19% 3h12m │ week [--------] 3% 5d20h
Sections wrap to multiple lines based on --columns width, with a trailing │ to indicate continuation.
Note: This project was developed almost entirely through AI-assisted coding with Claude Code, with human oversight over all design decisions, architecture, and code review.
Features
From Claude Code's session data:
- Project & model - project name, active model, and effort level (resolved from session transcript with
settings.jsonfallback) - Context window - how much of the context window is used, with size indicator (e.g.
200k,1M) - Prompt cache - 5-minute prompt cache TTL, shown as a live countdown
- Session limit - 5-hour rate limit utilization with reset countdown
- Weekly limit - 7-day rate limit utilization with reset countdown
Opt-in via --usage-api (from Anthropic's OAuth API):
- Per-model limits - weekly Opus and Sonnet limits with reset countdowns
- Extra usage - spend against your monthly extra usage cap with reset countdown
Every section is individually toggleable via CLI flags.
Installation
Available on PyPI. We recommend using uv.
To install:
uv tool install claude-vibeline
To update:
uv tool upgrade claude-vibeline
You don't have to track new releases — the statusline shows an update notification when a newer version is available on PyPI:
my-project │ Opus 4.7 (xhigh) │ ctx 1M [###-----] 42%
update available: 2.0.0 → 2.0.1 · uv tool upgrade claude-vibeline
PyPI is queried on the first render of a new session, and at most once per 24 hours overall. The cached latest version is reused on every render in between. Disable with --no-update.
The notification shares a second line below the statusline with error messages; errors take precedence when both apply.
Setup
Add to ~/.claude/settings.json:
{
// ...
"statusLine": {
"type": "command",
"command": "claude-vibeline",
"refreshIntervalSeconds": 30
}
}
refreshIntervalSeconds tells Claude Code to re-invoke the statusline at the given interval so the prompt cache countdown stays current.
Options
| Flag | Description |
|---|---|
--columns N |
Terminal width in characters (default: 80) |
--bar-width N |
Progress bar width in characters (default: 8) |
--currency S |
Currency symbol for extra usage (default: €) |
--no-project |
Hide project name |
--no-model |
Hide model and effort level |
--no-cache |
Hide prompt cache status |
--no-context |
Hide context window usage |
--no-session |
Hide session (5h) rate limit |
--no-weekly |
Hide weekly (7d) rate limit |
--usage-api |
Fetch per-model and extra usage from OAuth API (off by default) |
--opus |
Show weekly Opus rate limit (requires --usage-api) |
--sonnet |
Show weekly Sonnet rate limit (requires --usage-api) |
--extra |
Show extra usage spend (requires --usage-api) |
--no-update |
Hide update notification |
--debug |
Log each statusline output to debug file |
Example with all API sections enabled:
{
// ...
"statusLine": {
"type": "command",
"command": "claude-vibeline --usage-api --opus --sonnet --extra --currency $"
}
}
my-project │ Opus 4.7 (xhigh) │ cache ◷ 4m │ ctx 1M [###-----] 42% │
sess [##------] 19% 3h12m │ week [--------] 3% 5d20h │
opus [#-------] 10% 5d20h │ sonnet [--------] 2% 5d20h │
extra 1.23/20$ 7d0h
Rate limits
Stdin rate limits
Session and weekly limits are read directly from Claude Code's session data — no API call or authentication needed. Shown by default; disable with --no-session or --no-weekly.
OAuth API usage
Per-model and extra usage data is fetched from an undocumented Anthropic OAuth endpoint (see Limitations).
- Requires a valid OAuth token from a Claude Pro, Max, or Team subscription.
- Responses are cached locally for 60 seconds, and the cache is reused when the token expires or the API is unavailable.
- If no token or cache exists, sections render as pending.
- The API is only called when
--usage-apiis passed with at least one of--opus,--sonnet, or--extra.
Prompt cache
Tracks the 5-minute prompt cache TTL. Each user message or tool use result resets the timer. Computed from timestamps in the session transcript.
Status icons:
◷— warm⚠— warm, but expiring soon✗— expired↻— expired at some point since the last user message (prefix)
The countdown is live (◷ 4m, ⚠ 47s, ✗ 0s), so set refreshIntervalSeconds in your statusline config to keep it current.
Pending and reset states
Segments with no data yet or with a rolled-over window always render their label rather than disappearing. Two placeholders distinguish the states:
—— pending. No data yet (fresh session before the first message, or API fetch failed with no cache). Applies tosess,week,cache,opus,sonnet, andextra.↻— reset. The rate-limit window has rolled over and a fresh number is on the way. Applies tosess,week,opus,sonnet, andextra(new calendar month).
extra is the one exception: when the API reports is_enabled: false or omits the field (account has no extra usage configured), the segment is omitted entirely rather than rendered as pending.
Error messages
CLI parse errors (unknown flag, invalid value, missing argument), unexpected render failures, and malformed stdin JSON are shown on the same second line as update notifications, prefixed with the program name so it's unambiguous where the error comes from:
my-project │ Opus 4.7 (xhigh) │ ctx 1M [###-----] 42%
claude-vibeline: Unrecognized arguments: --bogus
The statusline still renders with defaults when the args are bad, so a bad flag no longer silences the output entirely. When stdin JSON is unparseable there is nothing to render and only the error message appears. Error messages are always shown — there is no opt-out.
Session data caching
Claude Vibeline caches per-session data to avoid redundant transcript parsing on every invocation. The cache stores:
- Effort level — the resolved effort and the timestamp of the latest transcript entry processed, so subsequent invocations only scan new entries instead of re-reading the entire transcript.
- Last user message timestamp — used by the prompt cache countdown as a fallback when the transcript cannot be read.
Stale session files (older than 30 days) are cleaned up whenever a new session writes its first cache entry.
All locally cached data (usage responses, session state, update check) is version-stamped and automatically invalidated on upgrade.
Limitations
- Undocumented API — the OAuth usage endpoint is undocumented and may break without notice.
- Limited stdin data — the statusline process receives only a JSON blob on stdin. Claude Code's own CLI arguments (e.g.
--model) and internal environment variables are not accessible. - Effort level is inferred — effort is not provided in stdin. It is resolved from the session transcript by scanning for
/modeland/effortcommands, with asettings.jsonfallback. After session resume, effort is shown with a?suffix until/effortor/modelis used. - No session fork support — forked sessions share a transcript file. The prompt cache countdown and effort detection may be inaccurate because messages from all forks are interleaved.
- No subagent tracking — subagents run in separate sessions with their own prompt cache, but the statusline only tracks the main session's cache.
Development
Requires uv.
Clone and setup:
git clone https://github.com/hstojanovic/claude-vibeline.git
cd claude-vibeline
uv sync
Run checks:
uv run ruff format --check
uv run ruff check
uv run ty check
uv run pytest --cov
Build:
uv build
Pass --debug to log each statusline invocation as JSONL, including the stdin input, parsed arguments, resolved effort, usage data, and rendered output.
License
This project is licensed under the MIT license.
Claude Vibeline is an independent project and is not affiliated with or endorsed by Anthropic.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_vibeline-3.1.1.tar.gz.
File metadata
- Download URL: claude_vibeline-3.1.1.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89923f8d8ba81b57f2173052efa6baf7966f5ce65df17552d7793a9052a1f504
|
|
| MD5 |
f179bed3787bae289589041b6d68841c
|
|
| BLAKE2b-256 |
951fe70774fc0ba39e1c0d574222f47b6634399398c3e1b417b40b2aceba915f
|
Provenance
The following attestation bundles were made for claude_vibeline-3.1.1.tar.gz:
Publisher:
publish.yml on hstojanovic/claude-vibeline
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_vibeline-3.1.1.tar.gz -
Subject digest:
89923f8d8ba81b57f2173052efa6baf7966f5ce65df17552d7793a9052a1f504 - Sigstore transparency entry: 1543507557
- Sigstore integration time:
-
Permalink:
hstojanovic/claude-vibeline@a50a3db993fa838130dc6626330d69317d952c20 -
Branch / Tag:
refs/tags/3.1.1 - Owner: https://github.com/hstojanovic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a50a3db993fa838130dc6626330d69317d952c20 -
Trigger Event:
push
-
Statement type:
File details
Details for the file claude_vibeline-3.1.1-py3-none-any.whl.
File metadata
- Download URL: claude_vibeline-3.1.1-py3-none-any.whl
- Upload date:
- Size: 22.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b57c4045535bb76984547a5fb3ded488b045f55e0ed492c24fa1c4ec8ffcbbed
|
|
| MD5 |
775e0c217fd294d261c28bcd297efffa
|
|
| BLAKE2b-256 |
1aad6728a49098ac0aa2bc81730a80c6116bfb989e5f97f17061e28c0aee0c82
|
Provenance
The following attestation bundles were made for claude_vibeline-3.1.1-py3-none-any.whl:
Publisher:
publish.yml on hstojanovic/claude-vibeline
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_vibeline-3.1.1-py3-none-any.whl -
Subject digest:
b57c4045535bb76984547a5fb3ded488b045f55e0ed492c24fa1c4ec8ffcbbed - Sigstore transparency entry: 1543507629
- Sigstore integration time:
-
Permalink:
hstojanovic/claude-vibeline@a50a3db993fa838130dc6626330d69317d952c20 -
Branch / Tag:
refs/tags/3.1.1 - Owner: https://github.com/hstojanovic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a50a3db993fa838130dc6626330d69317d952c20 -
Trigger Event:
push
-
Statement type: