You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(shell): show claude-bridge subscription usage (5h/7d windows) in the bar and /gentle:usage panel #1399
I searched open and closed issues and did not find a request for this feature.
I reviewed this request and removed credentials, tokens, private paths, hostnames, and other sensitive data.
Problem or opportunity
With Pi on the claude-bridge provider (Claude Code through the Agent SDK, the way a Claude Max/Pro subscription is used from Gentle Shell), the bar shows $0.000 and /gentle:usage (alt+u) reports:
✿ claude-bridge · no subscription usage for this provider
The 5-hour and 7-day plan windows that Claude Code shows with /usage are invisible in Pi, so the user only learns about the window when the bridge returns a five_hour rejection.
The numbers are already delivered to the bridge on every turn. From one morning of bridge log (156 events):
The @schuettc/pi-claude-bridge fork (the build that carries the unreleased upstream fixes, including Opus 5.5 at 1M) already normalizes the SDK events into a process-wide bus: globalThis[Symbol.for("pi.provider-usage.bus.v1")] exposing register / adapters / subscribe / publish, with windows five_hour, seven_day, seven_day_opus, seven_day_sonnet, seven_day_oauth_apps, each carrying usedPercent and resetsAt (src/usage-bus.ts). Gentle Shell does not read it.
Proposed outcome
Show claude-bridge subscription usage in the bar and in /gentle:usage, following the NaN precedent (#1180):
When the active model's provider is claude-bridge, resolve globalThis[Symbol.for("pi.provider-usage.bus.v1")]; if present, subscribe and map the latest claude snapshot to ProviderUsage: five_hour and seven_day as the main limits, seven_day_opus / seven_day_sonnet / seven_day_oauth_apps as additional limits, each with used percent and reset time.
Render it where Codex shows its percentage in the bar, and as a provider block in the panel.
When the bus is absent (upstream pi-claude-bridge without the fork), replace the generic unsupported note with a pending note that says the bridge build does not publish usage, so the user knows why.
I can contribute the implementation once this is approved.
Alternatives considered
Asking upstream pi-claude-bridge to emit gentle-pi:usage-source/v1: upstream is provider-agnostic and should not learn Gentle Shell's event name; consuming the neutral bus symbol keeps that boundary.
Reading Claude Code's on-disk usage cache: brittle and undocumented; the SDK already streams the values per turn.
Leaving $0.000: correct for a subscription but hides that the real budget is the plan window.
Additional context
Windows 11, pi 0.87.1, gentle-pi 3.7.0, gentle-ai 3.7.0, @schuettc/pi-claude-bridge 0.8.0-schuettc.5, Claude Max, model claude-opus-5-5. Originally filed in the wrong repository as Gentleman-Programming/gentle-ai#4945; that one will be closed in favour of this issue. Sibling requests for other providers: #1047, #872, #800, #687, #1261.
Before submitting
Problem or opportunity
With Pi on the
claude-bridgeprovider (Claude Code through the Agent SDK, the way a Claude Max/Pro subscription is used from Gentle Shell), the bar shows$0.000and/gentle:usage(alt+u) reports:The 5-hour and 7-day plan windows that Claude Code shows with
/usageare invisible in Pi, so the user only learns about the window when the bridge returns afive_hourrejection.The numbers are already delivered to the bridge on every turn. From one morning of bridge log (156 events):
What is missing is the connection:
openai-codex,anthropic(anthropic-ratelimit-unified-*headers) andnan(feat(shell): show NaN Cloud (nan) per-model usage in the bar and /gentle:usage panel #1177 / feat(shell): show NaN Cloud per-model usage in the bar and /gentle:usage panel #1180), plus the genericgentle-pi:usage-source/v1hook inlib/shell-usage.ts. Neitherpi-claude-bridgenor the@schuettc/pi-claude-bridgefork emits that hook.@schuettc/pi-claude-bridgefork (the build that carries the unreleased upstream fixes, including Opus 5.5 at 1M) already normalizes the SDK events into a process-wide bus:globalThis[Symbol.for("pi.provider-usage.bus.v1")]exposingregister / adapters / subscribe / publish, with windowsfive_hour,seven_day,seven_day_opus,seven_day_sonnet,seven_day_oauth_apps, each carryingusedPercentandresetsAt(src/usage-bus.ts). Gentle Shell does not read it.Proposed outcome
Show claude-bridge subscription usage in the bar and in
/gentle:usage, following the NaN precedent (#1180):claude-bridge, resolveglobalThis[Symbol.for("pi.provider-usage.bus.v1")]; if present, subscribe and map the latestclaudesnapshot toProviderUsage:five_hourandseven_dayas the main limits,seven_day_opus/seven_day_sonnet/seven_day_oauth_appsas additional limits, each with used percent and reset time.pi-claude-bridgewithout the fork), replace the generic unsupported note with a pending note that says the bridge build does not publish usage, so the user knows why.I can contribute the implementation once this is approved.
Alternatives considered
pi-claude-bridgeto emitgentle-pi:usage-source/v1: upstream is provider-agnostic and should not learn Gentle Shell's event name; consuming the neutral bus symbol keeps that boundary.$0.000: correct for a subscription but hides that the real budget is the plan window.Additional context
Windows 11, pi 0.87.1, gentle-pi 3.7.0, gentle-ai 3.7.0,
@schuettc/pi-claude-bridge0.8.0-schuettc.5, Claude Max, modelclaude-opus-5-5. Originally filed in the wrong repository as Gentleman-Programming/gentle-ai#4945; that one will be closed in favour of this issue. Sibling requests for other providers: #1047, #872, #800, #687, #1261.