Pre-flight checks
OpenCode version tested
1.4.11
opencode-quota version tested
3.0.0
Bug summary
The Anthropic quota rows never appear in /quota, toasts, or the sidebar. The plugin probes claude auth status --json for 5-hour and 7-day usage windows, but the Claude CLI does not include any quota or utilization fields in that response. As a result, parseUsageResponse() always returns null and the provider is silently skipped.
Root cause: Anthropic quota data is not exposed through claude auth status. It is available through a separate undocumented
OAuth usage endpoint:
GET https://api.anthropic.com/api/oauth/usage
Authorization: Bearer <claudeAiOauth.accessToken>
anthropic-beta: oauth-2025-04-20
Response shape:
{
"five_hour": { "utilization": 0.42, "resets_at": "2026-04-19T17:00:00Z" },
"seven_day": { "utilization": 0.61, "resets_at": "2026-04-24T08:00:00Z" }
}
The OAuth token is stored at ~/.claude/.credentials.json under claudeAiOauth.accessToken. This is the same approach used by claude-usage-monitor (https://github.com/aiedwardyi/claude-usage-monitor) and documented independently at https://ianlpaterson.com/blog/tracking-claude-codex-gemini-quotas-from-one-script/.
Suggested fix: in lib/anthropic.ts, when claude auth status confirms authentication but parseUsageResponse() returns null, fall back to calling the OAuth usage endpoint directly and parse the response with the existing parseUsageResponse() logic — it already handles the five_hour/seven_day/utilization/resets_at field names.
Steps to reproduce
- Install Claude Code CLI and authenticate:
claude auth login
- Confirm auth:
claude auth status --json — returns loggedIn: true, subscriptionType: "max", but no quota fields
- Configure opencode-quota with the
anthropic provider enabled (auto-detect)
- Start OpenCode and run /quota
- Observe: no Anthropic rows appear in the output
Expected behavior
Anthropic quota rows (5-hour and 7-day usage windows with percentage remaining and reset time) should appear in /quota output, toasts, and the sidebar panel — the same way OpenAI and Z.ai quota rows appear.
Actual behavior
No Anthropic quota rows are shown anywhere. The claude auth status --json response contains no utilization data, so the plugin has nothing to display.
Relevant logs/output
claude --version output:
2.1.114 (Claude Code)
claude auth status --json output:
{
"loggedIn": true,
"authMethod": "claude.ai",
"apiProvider": "firstParty",
"subscriptionType": "max"
}
No "quota", "usage", "rate_limits", or "oauth_usage" keys present.
If not tested on current production OpenCode, explain why
No response
Pre-flight checks
OpenCode version tested
1.4.11
opencode-quota version tested
3.0.0
Bug summary
The Anthropic quota rows never appear in /quota, toasts, or the sidebar. The plugin probes
claude auth status --jsonfor 5-hour and 7-day usage windows, but the Claude CLI does not include any quota or utilization fields in that response. As a result, parseUsageResponse() always returns null and the provider is silently skipped.Root cause: Anthropic quota data is not exposed through
claude auth status. It is available through a separate undocumentedOAuth usage endpoint:
The OAuth token is stored at ~/.claude/.credentials.json under claudeAiOauth.accessToken. This is the same approach used by claude-usage-monitor (https://github.com/aiedwardyi/claude-usage-monitor) and documented independently at https://ianlpaterson.com/blog/tracking-claude-codex-gemini-quotas-from-one-script/.
Suggested fix: in lib/anthropic.ts, when claude auth status confirms authentication but parseUsageResponse() returns null, fall back to calling the OAuth usage endpoint directly and parse the response with the existing parseUsageResponse() logic — it already handles the five_hour/seven_day/utilization/resets_at field names.
Steps to reproduce
claude auth loginclaude auth status --json— returns loggedIn: true, subscriptionType: "max", but no quota fieldsanthropicprovider enabled (auto-detect)Expected behavior
Anthropic quota rows (5-hour and 7-day usage windows with percentage remaining and reset time) should appear in /quota output, toasts, and the sidebar panel — the same way OpenAI and Z.ai quota rows appear.
Actual behavior
No Anthropic quota rows are shown anywhere. The claude auth status --json response contains no utilization data, so the plugin has nothing to display.
Relevant logs/output
If not tested on current production OpenCode, explain why
No response