Alexander Herrmann132 downloadsShows your Claude subscription usage (5-hour and weekly windows) in the status bar.
Disclaimer: This plugin is an independent community project and is not affiliated with, endorsed by or supported by Anthropic. It uses an undocumented endpoint of the Claude OAuth API that may change or stop working at any time without notice.
Obsidian plugin that shows your Claude subscription usage in the status bar: the 5-hour window, the weekly window and, if present, the weekly window for top-tier models.
The plugin reads the OAuth token from the Claude Code credentials file (or the login keychain on macOS) and uses it to query the usage endpoint. It never writes the token and never refreshes it itself.
One 14px ring per window, followed by the percentage and the time left until reset (47m, 4h52m, 4d7h).
--text-warning--text-error plus a ⚠ glyph, so the state does not depend on colour aloneHovering the status bar item shows all windows with their reset time and the timestamp of the last fetch. Clicking it shows the same values as a notice.
/login. The token needs the user:profile scope. A token from claude setup-token is not sufficient.~/.claude/.credentials.json (path configurable in settings)Claude Code-credentials). The plugin reads them via /usr/bin/security; the file is only a fallback. If macOS asks for keychain access, choose "Always Allow".Manual:
main.js, manifest.json and styles.css to <Vault>/.obsidian/plugins/claude-usage/Via BRAT: add eightk1ll/obsidian-claude-usage as a beta plugin.
| Option | Default | Meaning |
|---|---|---|
| Credentials path | ~/.claude/.credentials.json |
File the token is read from (Linux, Windows; fallback on macOS) |
| Poll interval | 15 minutes | Time between two API requests |
| Warning threshold | 75 % | Ring switches to warning colour |
| Critical threshold | 90 % | Ring switches to error colour plus glyph |
| Show time until reset | on | Countdown next to the percentage |
The command Refresh usage now in the command palette triggers a manual fetch.
Errors that do not resolve on their own (expired token, 401, 403, 429, network errors) put the plugin on hold. The hold grows with each consecutive failure: 15, 30, 60, 120, 240 minutes. A Retry-After header from the server extends the hold but never shortens it. The hold also applies to manual refreshes.
The backoff state is persisted in data.json, so restarting Obsidian does not reset it. Without this, a permanent error would produce hundreds of requests overnight and trigger a 429 on its own.
An expired token is detected before the request is sent and shown as a hint. The fix in all cases: run claude and execute /login.
Obsidian's automated review flags three behaviours. All of them are needed for the plugin to work:
fs): reads ~/.claude/.credentials.json on Linux and Windows. Nothing is written.child_process): on macOS only, runs /usr/bin/security find-generic-password -s "Claude Code-credentials" -w to read the token from the login keychain. No other command is executed, and only on darwin.api.anthropic.com/api/oauth/usage per poll interval.api.anthropic.com as a bearer header.data.json in the plugin folder.Claude ?, backs off) instead of retrying aggressively.https://api.anthropic.com/api/oauth/usage with header anthropic-beta: oauth-2025-04-20requestUrl from the Obsidian APImain.js runs as is, no dependencies beyond the Obsidian APIMIT