Repository navigation
Closed
Labels
Description
Parent
What to build
Make thirdshift record, refresh and display machine-local subscription Plan usage across the five subscription Harnesses (claude, codex, muse, agy and grok), configure ordered User config routes and utilization reserves, and expose local thirdshift plan-usage [--json] [--clear [<harness>]].
Specifically:
- Add
[harness] routes(empty array by default; entries may be"claude"strings inheriting[harness.<name>]Model/Effort or inline tables{ harness, model, effort, max_utilization, allow_credits }),[harness] max_utilization = 100(1–100), and[security] routes = []to User config and Setup defaults sothirdshift configand Console/configinventory, display and validate them automatically. - Exclude API-key Harnesses (
opencodeandkimi) from subscription Plan usage monitoring. - Passively update the machine's saved Plan usage snapshot during every running session from structured Harness wire-frame events:
clauderate_limit_eventframes across all statuses and utilization percentages (not only>= 85%) plus terminalClaudeApiErrorlimit/overage facts,codexsessiontoken_countrate_limits, and terminalUsageLimitprotocol errors acrossclaude,codex,muse,agyandgrok. - On demand (with a ~60-second view freshness cache, never on an idle background timer), enrich local Plan usage with official zero-token CLI/RPC reads where supported:
codex app-serveraccount/rateLimits/read(accountId,planType,ordinaryUsageAllowed,rateLimits/rateLimitsByLimitId,credits,spendControlReached),muse serveusage/read(tier,observedAtMs,window,weekly) andaccount/read(state,label,credentialRequired), andclaude auth status --json(loggedIn,subscriptionType,planTier,orgId,email). Never scrape undocumented web/OAuth endpoints or read Harnesses' private auth tokens. - Pass
--settings '{"useG1Credits":false}'on headlessagylaunches unless the active route setsallow_credits = true. - Add
thirdshift plan-usage [--json] [--clear [<harness>]]showing every Harness named inharness.default,harness.routes,security.harnessorsecurity.routes(in route order, marking the currently active primary route and anymax_utilizationceiling) plus any other subscription Harness (claude,codex,muse,agy,grok) with a saved observation or signed-in CLI—omitting unconfigured, uninstalled, unobserved Harnesses, and surfacing configured routes whose CLI is missing or signed out.--clearresets recorded cooldown/revalidation state for one or all Harnesses.
Acceptance criteria
-
User configparses and validates[harness] routes,[harness] max_utilization(1–100, default100), per-routeallow_credits(defaultfalse), and[security] routes, with defaults exposed automatically inthirdshift configand Console/config. - Running sessions passively record
clauderate_limit_eventwindows at all utilization levels (preserving Evals' existing 85% Paused Command stop),codextoken_countwindows, and terminalUsageLimit/ spend-cap facts onclaude,codex,muse,agyandgrokinto the machine's local Plan usage snapshot. -
thirdshift plan-usageandthirdshift plan-usage --jsonenrich local state on demand via non-billedcodexapp-server,muse serveandclaude auth status --jsonreads with a ~60-second TTL cache, omittingopencodeandkimiand omitting unconfigured/uninstalled/unobserved subscription Harnesses while flagging missing/signed-out configured routes. - Headless
agysessions pass--settings '{"useG1Credits":false}'by default unlessallow_credits = trueis configured for that route. -
thirdshift plan-usage --clear [<harness>]clears recorded cooldown and revalidation backoff state for the named Harness (or all subscription Harnesses when omitted). - Integration tests with scripted fake Harness CLIs verify passive stream capture across utilization levels, active RPC/CLI enrichment and TTL caching,
User configroute validation,agycredit-guard settings, row filtering, JSON output, and--clear.
Blocked by
None (can start immediately).
Activity
JacobStephens2 commentedon Nov 14, 2026
Closed by #2198, merged into issue-583 by a thirdshift Ticket run with Self-merge.