
shunt
A Claude Mod for the gateway itself: a band above the prompt shows the shared account pool's usage and reset times (the session's own rate limits off shunt), and /shunt:usage shows the pool's full breakdown, read from GET /usage. Requires function hooks (early access).
- GitHub stars
- 267
Install
/plugin install shunt@shuntRun it inside Claude Code after adding the marketplace with /plugin marketplace add pleaseai/shunt.
Contents
Discovered from sourceCommands 1
Report the shunt gateway's shared account pool usage.
This session is running without function hooks, so the shunt mod could not
answer this command itself. Fall back to reading the endpoint directly:
- Resolve the gateway base URL from
SHUNT_BASE_URL, elseANTHROPIC_BASE_URL. If neither is set, tell the user this session is not pointed at a shunt gateway and stop — do not call Anthropic's own API. - Resolve the client token from
SHUNT_TOKEN, elseANTHROPIC_AUTH_TOKEN(send it asAuthorization: Bearer <token>), elseANTHROPIC_API_KEY(send it asx-api-key: <token>). GET <base>/usagewith that header, then report the result.
Do not print the token itself, and do not write it into a file.
Read the response as follows. pool is the aggregate across every pooled
provider and providers is the same aggregate per configured provider. For
each of the three windows — 5h (rolling session), 7d (shared weekly) and
fable (the Fable-scoped weekly window) — remaining is the fraction of the
pool's combined capacity still usable before any account's max_utilization
hard cap excludes it, so 0.62 means 62% of the headroom is left, not that 62%
is spent; null means no account reported that window.
resets_at is unix epoch seconds, the earliest reset among the accounts
counted, including when a cap holding an account at zero clears. The figures are a shared pool-wide mean, not a prediction that the
next request will be admitted.
A 404 means the gateway is running but GET /usage is not enabled: it needs
an [server.usage] table in the gateway config, which in turn requires
[server.auth] (client tokens) or [server.gateway] (gateway login). A 401
or 403 means the gateway rejected the credential this session sent: a client
token [server.auth] does not accept, or an expired or revoked gateway login
(run shunt gateway login again).
Enable the mod to get this answer instantly and without a tool call:
CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 claude
Hooks 1
Sponsors
Details
- Marketplace
- pleaseai/shunt
- Source
- plugins/shunt
- Category
- Community
- Keywords
- usage, quota, pool, usage-band, mod, function-hooks