-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
What specific problem does this solve?
RooCode users currently pay expensive per-token API pricing when Claude Pro/Max subscriptions offer better value with fixed monthly costs and usage limits that reset every 5 hours. Users with existing Claude subscriptions face double billing, while those without pay more through API than necessary. The new fork of the opencode terminal coding agent allows use of Claude subscriptions directly through OAuth.
Who is affected: All RooCode users - those with Claude Pro/Max subscriptions facing double billing, and API-only users paying more than necessary
When: Every time users want cost-effective or fixed price Claude access in RooCode
Current behavior: API users pay per-token (expensive for heavy use), subscription users must buy API access separately
Expected behavior: Authenticate with Claude account and use fixed-price subscription with generous limits.
Impact: Users either pay twice or overpay for usage, while other coding assistants offer better pricing through subscription access
How should this be solved?
Implement OAuth 2.0 authentication like opencode has, allowing users to authenticate with their Claude Pro/Max accounts instead of via API.
Changes:
Add Use Claude Pro/Max Account option in settings alongside existing API key option
Implement PKCE OAuth flow using Anthropic's endpoints (same as opencode: client ID 9d1c250a-e61b-44d9-88ed-5944d1962f5e)
Store OAuth tokens securely in VS Code's SecretStorage
Modify API requests to use OAuth bearer tokens when OAuth is configured
Auto-refresh expired tokens, fallback to re-auth if refresh fails
User interaction:
User selects OAuth option in settings
Browser opens to Claude authorization page
After approval, returns to VS Code automatically configured
All requests use Claude subscription limits instead of separate API quota
How will we know it works? (Acceptance Criteria)
Given a user has Claude Pro/Max subscription
When they select "Use Claude Pro/Max Account" in RooCode settings
Then they authenticate via browser OAuth flow
And RooCode shows "Connected to Claude Pro/Max" status
And code generation requests work using their subscription limits
But no API keys are required or exposed
Given OAuth access token expires
When user makes a request
Then token refreshes automatically without user intervention
But if refresh fails, user gets clear re-authentication prompt
Given user wants to switch authentication methods
When they change settings between OAuth and API key
Then both methods work reliably without losing configuration
But only one method is active at a time
Estimated effort and complexity
Size: Medium (1-2 weeks)
Reasoning: OAuth implementation is well-defined (following opencode's approach), VS Code SecretStorage is straightforward, main work is integrating with existing request handling
Main challenges: Secure token management, graceful error handling for auth failures, ensuring compatibility between OAuth and API key modes
Dependencies: OAuth PKCE library, VS Code SecretStorage API, no external services (uses existing Anthropic OAuth infrastructure like opencode)
Technical considerations (optional but helpful)
No response
Trade-offs and risks (optional)
No response
Additional context (optional)
https://github.com/sst/opencode
https://github.com/sst/opencode/blob/dev/packages/opencode/src/auth/anthropic.ts
Good explainer on Claude limits per plan and the 5 hour reset here:
https://youtu.be/2fbqo9Bdd_w?si=00M-i3Ba2QZy4Sp7
Proposal checklist
- I've searched existing Issues and Discussions for duplicates
- This is a specific, actionable proposal with clear problem and solution
- I've included concrete acceptance criteria
- I understand this needs approval before implementation begins
Interested in implementing this?
- Yes, I'd like to help implement this feature
Metadata
Metadata
Assignees
Labels
Type
Projects
Status