Skip to main content

claude-dongle

Your Claude Code usage limits, live — without breaking your flow.

A floating pill that shows how much of your usage windows you've burned (5-hour session and weekly, per model) and predicts when you'll hit the wall. It reads everything from Claude Code's own local token: no proxy, no extra login, nothing sent anywhere.


the dongle   the dongle with Claude and Codex side by side



License: MIT Python 3.9+ Platforms PyQt6


Unofficial. This project is not affiliated with Anthropic. It reads the same undocumented usage endpoint that powers Claude Code's own limit warnings (api.anthropic.com/api/oauth/usage) — if Anthropic changes it, the monitor may stop showing data until updated.

✨ Features

  • Always-on dongle — a discreet pill in the corner with your session (5h), week, and week-per-model usage. It appears only when it makes sense (e.g. with your editor or terminal open) and hides when you're not working.
  • Overflow forecast — computes your burn rate by regression over recent usage and estimates the ETA to 100%. The border breathes amber when, at the current pace, you'll run out before the reset, and red when a limit that stops every model is spent. A single model running out (say your weekly Fable) leaves the border alone: the others keep working.
  • Pace marker — every ring has a tick for where you'd be at a linear pace. Fill ahead of the tick = burning fast; behind it = comfortable. You read your pace at a glance, no math.
  • Per-model usage — from Claude Code's local logs, it shows which models ate your week (with a 14-day heatmap). Not per project: attributing by the session's working directory is wrong often enough to mislead, and doing it right is a different tool's job.
  • What's still usable — a model running out of its weekly quota doesn't stop the others, so the panel says exactly that, and when it comes back.
  • Budget, not just a threat — the forecast answers "can I take one more task?": ~2h30 of work left · the reset only comes in 1d 23h.
  • Your burn by hour of the day — built from the history it already keeps, it shows the hours you actually spend the window on.
  • Easy on the battery — every timer runs at half rate while unplugged.
  • Limit notifications — alerts when you cross a threshold, when a limit is reached and on the overflow forecast, each limit tracked as its own series. Everything crossing in the same reading arrives as one notification, a minimum gap paces the routine ones, and you can snooze them all for a while. Works even with the dongle closed, via a background timer.
  • English or Portuguese — a switch in the settings changes the whole panel and the notifications on the spot; by default it follows your system locale.
  • Cross-platform — Linux, macOS and Windows, with native autostart on each.

🖼️ Preview

usage rings animating
The usage gauges, live
dashboard dashboard, expanded
Dashboard Forecast, per-model usage and settings, expanded
notifications
Limit and overflow-forecast alerts — they fire even with the dongle closed

See CHANGELOG.md for what changed in each release.

📦 Installation

Requirements: Python 3.9+ and Claude Code installed and logged in on the machine.

With pipx (recommended — installs into an isolated env):

pipx install claude-dongle

Or with pip:

pip install --user claude-dongle
Install the latest unreleased version from source
pipx install git+https://github.com/PedroHenrique0713/claude-dongle

Then:

claude-dongle tray      # open the dongle
claude-dongle setup     # (optional) launch it automatically on login

setup wires up autostart the native way on each OS — systemd user on Linux, LaunchAgent on macOS, Startup folder on Windows. Undo it with claude-dongle uninstall.

⚙️ Usage

Command What it does
claude-dongle tray open the floating dongle (normal use)
claude-dongle status print the current state as JSON
claude-dongle notify check the limits once and notify
claude-dongle config open just the settings panel
claude-dongle setup set up autostart on login
claude-dongle uninstall remove autostart
claude-dongle accounts list the Claude Code accounts found on this machine
claude-dongle use NAME watch another account (use work, use default)
claude-dongle source S show claude, codex or both (split in half)

Several accounts, and Codex. Claude Code keeps each login in its own config dir (~/.claude, or the CLAUDE_CONFIG_DIR of a wrapper such as claude-work() { CLAUDE_CONFIG_DIR=~/.claude-work claude; }). The dongle watches one of them at a time; pick it in the panel or with use. Usage cache, notifications and the per-model history are kept per account, so switching never passes one account's numbers off as another's. An account whose Claude Code has been closed for a while has an expired login and shows -- until it is opened again. The Codex CLI's 5h and weekly limits come from its own session logs (~/.codex/sessions), with no network and no token; they move while Codex runs. In both, Claude takes the left side (orange: session, week, per-model week) and Codex the right (purple: session, week), each number deepening in tone as its limit fills.

Dongle interactions: drag to reposition (it snaps to edges); click to open the dashboard; middle-click to refresh now. The border breathes amber when the current pace overflows before the reset, and red when a limit that stops every model is spent — one model running out leaves it alone.

🔧 Configuration

Tune it from the panel or by editing ~/.config/claude-dongle/config.json:

Key Default Description
language "auto" auto follows your system locale; pin it with en or pt-BR
thresholds [50, 70, 85, 95] percentages that trigger a notification
show_mode "dev" when to show the dongle: always, claude (the tools it shows are running), dev or custom
claude_dir "~/.claude" the Claude Code account to watch (its config dir)
sources "claude" what the dongle shows: claude, codex or both
codex_dir "~/.codex" the Codex CLI home ($CODEX_HOME when set)
poll_interval 5 seconds between dongle refreshes
api_poll_interval 300 minimum interval between API calls (the endpoint rate-limits aggressive polling)
dongle_opacity 0.85 dongle opacity (0 to 1)
battery_saver true run every timer at half rate while on battery
notify_on_threshold true notify when a threshold is crossed
notify_on_limit true notify when 100% is reached
notify_on_reset true notify when a spent limit comes back
notify_on_telemetry true notify when the monitor loses its data source
forecast_notify true notify on a predicted overflow before the reset
notify_cooldown_minutes 15 minimum gap between routine alerts (a limit reached always goes through)
hours_days 14 history window behind the "by hour" profile
reset_day / reset_time / reset_timezone null manual weekly-reset fallback, used only if the API never answered (null timezone = system local)

🔍 How it works

Claude Code keeps an OAuth token in ~/.claude/.credentials.json (on macOS, in the Keychain). claude-dongle uses that token to query Anthropic's usage endpoint (api.anthropic.com/api/oauth/usage) — the same one that powers Claude Code's own limit warnings. From there:

  • monitor assembles the state; with no real source (API down and no cache) it shows -- instead of inventing a number.
  • history keeps a local time series (SQLite) for the burn rate and forecast.
  • projects aggregates tokens per model by reading the JSONL files in ~/.claude/projects — deliberately not per project: attributing by the session's working directory is wrong often enough to mislead.
  • dongle and dashboard (PyQt6, hand-drawn) render everything; notifier raises the alerts.

🔒 Privacy

Everything is local. The monitor reads Claude Code's token and talks directly to Anthropic's official API — no data is sent to any third party, and the token never leaves the machine nor gets rewritten (the monitor keeps what it needs in its own cache, with owner-only file permissions, without touching Claude Code's file).

🛠️ Development

Run from the repo without installing:

./run.sh tray                 # Linux/macOS
python -m claude_dongle tray  # any OS

Run the tests:

pip install pytest
pytest tests/

Regenerate the README assets (rendered by the app itself, offscreen, with fictional data):

python scripts/gen_screenshots.py   # dongle, dashboard, notifications
python scripts/gen_gif.py           # the animated usage rings

📄 License

MIT © Pedro Henrique — see LICENSE.

Release files for claude-dongle 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for claude-dongle 1.2.0
File Size Uploaded
claude_dongle-1.2.0.tar.gz 90.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for claude-dongle 1.2.0
File Interpreter ABI Platform
claude_dongle-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 171.6 kB

Release files / claude_dongle-1.2.0.tar.gz

Download URL claude_dongle-1.2.0.tar.gz
Size 90.6 kB
Tags Source
SHA-256 checksum
How to use checksums
111a9ae68640ff5e989ed0e0a82ed9c1f8f976a05610db25eec024d5516bbcba
BLAKE2b-256 checksum
How to use checksums
dbb0955f667bc249ff5b1358f2c85a3897f19918931962bfe9c1e2e3ad35d44c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / claude_dongle-1.2.0-py3-none-any.whl

Download URL claude_dongle-1.2.0-py3-none-any.whl
Size 80.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c7793438c14764d7fccad9b3e169c6a41ea047698458c80f436570aed0bb930
BLAKE2b-256 checksum
How to use checksums
32fc0685f316b9aba3a6fb5d6cbb9fef89f9ce2b508032c006f10b09b51e8704
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page