Claude Provider
Access Anthropic Claude models via OAuth authentication with automatic token management and seamless multi-account support.Quick Start
Authentication
Initial Setup
1
First Run
Run
ccs claude "your prompt" - browser opens automatically2
Claude OAuth
Sign in with your Claude account (requires Claude Pro/Max subscription)
3
Token Cached
OAuth token saved to
~/.ccs/cliproxy/auth/claude-{email}.json4
Auto Refresh
Token refreshes automatically 5 minutes before expiry
OAuth Flow Specifics
Authorization Code Flow:- Callback server spawns on port 54545
- Browser opens for Claude OAuth consent
- Token received via HTTP callback
- Auto-refresh prevents mid-request failures
- Checks
expiry_datebefore each execution - Refreshes 5 minutes before expiry (matches CLIProxyAPI)
- Prevents
UND_ERR_SOCKETerrors during long sessions - Graceful re-auth prompt if refresh fails
Headless Authentication
For servers without browser access:Multi-Account Support
Manage multiple Claude accounts seamlessly:- Add Account
- List Accounts
- Switch Account
Organizations Sharing an Email
Anthropic OAuth allows a single email address to belong to multiple organizations (for example, a Personal organization and one or more Team/Enterprise organizations). When multiple organizations share the same email, CCS preserves each organization as a distinct account entry keyed byemail#<org-hash> (e.g. john@example.com#a1b2c3d4):
- Disambiguation: Because bare email selection is ambiguous, switch or manage accounts using either the assigned nickname or the full
email#<hash>identifier: - Auto-pause & Quota Isolation: Auto-pause and cooldowns operate independently per organization without affecting sibling accounts that share the email.
Account Registry:
~/.ccs/cliproxy/accounts.json
Commands Reference
Basic Usage
Authentication Commands
Account Management
Configuration
Config Keys
Configure via~/.ccs/config.yaml:
Environment Variables
These are set automatically by CCS. Manual override rarely needed.
Storage Locations
Requirements
- Claude Pro or Claude Max subscription
- Browser for OAuth (or
--headlessfor servers) - Network access to Claude authentication servers
Token Management
Storage Format:Troubleshooting
Token Refresh Failures
Symptom:UND_ERR_SOCKET errors during execution
Cause: Token expired mid-request
Solution: Proactive refresh handles this automatically. If issue persists:
Browser Doesn’t Open
Symptom: OAuth flow stuck waiting for browser Solution: Use headless mode:Multiple Accounts Confusion
Symptom: Wrong account being used Solution: Check default account:Quota Windows & Scoped Limits
Anthropic reports quota limits across multiple independent windows:
Run
ccs cliproxy quota --provider claude to inspect the windows Anthropic reports for each linked account.
Scoped Quota Semantics
- Model Limit Isolation: Model-specific limits (such as Fable) do not lower general account health or automatically pause or rotate the entire account. An account with exhausted Fable quota remains available for Sonnet or Opus requests.
- Partial Window Reports: Accounts can report a subset of windows (e.g. weekly only, or model limits only). Missing general windows remain treated as unknown rather than assumed healthy or exhausted.
- Monetary Grants Excluded: Dollar-denominated credit grants (e.g. promotional credit buckets) are not treated as time-based quota rows.
To turn several Claude accounts into a pool that auto-continues a single
conversation across the limit (fill-first plus session affinity), see
Account Pools. That page covers the three-command setup,
the slower turn right after a failover hop, leaving a pool, and migrating from
native profiles.
Cost Information
Advanced Features
Isolated Instances
Each named account (ccs auth create <name>) gets its own directory:
Shared Context Groups
Opt in to sharing context across accounts:Deeper Continuity
Next Steps
Claude Accounts
Full guide to multiple Claude account management
Provider Overview
Compare all available providers
Remote Proxy
Connect to external CLIProxy server
Configuration
Config file reference
