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 ◷ 14:35 │ 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 an expiration clock time or a live countdown with
--cache-updater - 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
Setup
Add to ~/.claude/settings.json:
{
// ...
"statusLine": {
"type": "command",
"command": "claude-vibeline"
}
}
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 |
--cache-updater |
Spawn background process to refresh cache countdown (off by default) |
--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) |
--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 ◷ 14:35 │ 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, these sections are omitted.
- 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)
By default, the time is an absolute clock time — upcoming expiry for warm caches (◷ 14:35), past expiry for expired ones (✗ 14:30). With --cache-updater, it becomes a live countdown (◷ 4m, ✗ 0s).
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 on every write.
Cache updater
This feature is off by default because it modifies your ~/.claude/settings.json.
When enabled with --cache-updater, Claude Vibeline spawns a background process that toggles a trailing space in the statusLine.command value every 30 seconds. This causes Claude Code to re-invoke the statusline and redraw the cache countdown. The background process runs until the cache expires and then cleans up after itself.
Since Claude Code does not provide a push mechanism for statusline updates, this settings toggle is used to force a re-render.
Because this edits your settings file, be aware that:
- Concurrent manual edits to
settings.jsonwhile the cache updater is running could conflict (writes are atomic, but a read-modify-write race is possible). - Tools that watch
settings.jsonfor changes will see repeated modifications.
To enable:
{
// ...
"statusLine": {
"type": "command",
"command": "claude-vibeline --cache-updater"
}
}
Without --cache-updater, the cache section shows the expiration clock time — an absolute value that remains accurate without re-invocation. The live countdown (◷ 4m) requires the updater to stay current.
Local data
All locally cached data (usage responses, session state, updater lock) is version-stamped and automatically invalidated on upgrade.
Limitations
- Undocumented APIs — the OAuth usage endpoint is undocumented and may break without notice. The cache updater mechanism (see above) relies on undocumented Claude Code behavior and may also break.
- 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 shown with?suffix. After session resume, effort resets to the?fallback 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-2.0.0.tar.gz.
File metadata
- Download URL: claude_vibeline-2.0.0.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b9bf04b03aff60b23ae56304bcd4af7d76dbc93443a108a79cc57f5fe77bd49
|
|
| MD5 |
1281875dcae07997571b50fca190be92
|
|
| BLAKE2b-256 |
25a4aee4056e864e952ec279290b6af9b6f25f28659d4bfc0fc25e09fa364bff
|
Provenance
The following attestation bundles were made for claude_vibeline-2.0.0.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-2.0.0.tar.gz -
Subject digest:
7b9bf04b03aff60b23ae56304bcd4af7d76dbc93443a108a79cc57f5fe77bd49 - Sigstore transparency entry: 1324782299
- Sigstore integration time:
-
Permalink:
hstojanovic/claude-vibeline@d69451dc8649334b4ee9610488d406ebeb8def04 -
Branch / Tag:
refs/tags/2.0.0 - Owner: https://github.com/hstojanovic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d69451dc8649334b4ee9610488d406ebeb8def04 -
Trigger Event:
push
-
Statement type:
File details
Details for the file claude_vibeline-2.0.0-py3-none-any.whl.
File metadata
- Download URL: claude_vibeline-2.0.0-py3-none-any.whl
- Upload date:
- Size: 21.0 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 |
6802cc2523aa9014513b55e222eb77c92c389728eb95072a246e733cd9743db1
|
|
| MD5 |
218c07fe8fddcea352ccb956924e0946
|
|
| BLAKE2b-256 |
d5ac98fb74a1fb8e6d48e232d9c32af21435b3bb6c99a996a36190ba0823817b
|
Provenance
The following attestation bundles were made for claude_vibeline-2.0.0-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-2.0.0-py3-none-any.whl -
Subject digest:
6802cc2523aa9014513b55e222eb77c92c389728eb95072a246e733cd9743db1 - Sigstore transparency entry: 1324782363
- Sigstore integration time:
-
Permalink:
hstojanovic/claude-vibeline@d69451dc8649334b4ee9610488d406ebeb8def04 -
Branch / Tag:
refs/tags/2.0.0 - Owner: https://github.com/hstojanovic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d69451dc8649334b4ee9610488d406ebeb8def04 -
Trigger Event:
push
-
Statement type: