@suncreation/crush-auth-proxy
v1.1.7
Published
Claude Code Auth Proxy for Crush CLI — Use your Claude Max subscription (OAuth) instead of API keys
Downloads
37
Maintainers
Readme
@suncreation/crush-auth-proxy
Use your Claude Max subscription (OAuth) with Crush CLI — no separate Anthropic API key needed.
This proxy sits between Crush and Anthropic's API, injecting Claude Code OAuth credentials so you can use your existing Claude Max plan.
Quick Start
# One command does everything: login + crush config + auto-start
npx @suncreation/crush-auth-proxy setupThat's it! Now use Crush:
crush run --model anthropic/claude-opus-4-6 "Hello!"The proxy auto-starts on boot. No manual configuration needed.
Commands
| Command | Description |
|---------|-------------|
| setup | All-in-one: OAuth login + crush.json config + auto-start service |
| setup-token | OAuth login only — opens browser, saves token locally |
| setup-crush | Configure crush.json only (adds anthropic provider) |
| install-service | Install platform auto-start service (macOS: launchd, Linux: systemd, Windows: Task Scheduler) |
| uninstall-service | Remove auto-start service |
| start | Start proxy as background daemon (port 18080) |
| stop | Stop the daemon |
| restart | Restart the daemon |
| status | Check if proxy is running + token validity |
| logs | Tail daemon logs |
Options
| Option | Description |
|--------|-------------|
| --port <n> | Custom port (default: 18080) |
| --debug | Enable detailed request/response logging |
| --foreground | Run in foreground instead of daemon |
How It Works
The proxy replicates Claude Code's authentication mechanism:
- OAuth PKCE Flow — Authenticates via
claude.aiusing the same client credentials as Claude Code - Request Transformation — Rewrites headers (User-Agent, auth), adds required beta flags, prefixes tool names with
mcp_ - System Prompt Injection — Prepends the Claude Code system prompt identifier
- Response Streaming — Strips
mcp_prefixes from streamed responses - Token Auto-Refresh — Automatically refreshes expired OAuth tokens
Per-User Storage
All config is stored in ~/.config/crush-auth-proxy/:
~/.config/crush-auth-proxy/
├── claude-oauth-token.json # Your OAuth tokens (chmod 0600)
├── crush-auth-proxy.mjs # Stable copy for auto-start service
├── proxy.pid # Daemon PID
└── proxy.log # Daemon logsUninstall
npx @suncreation/crush-auth-proxy uninstall-service
npx @suncreation/crush-auth-proxy stop
rm -rf ~/.config/crush-auth-proxyRequirements
- Node.js >= 18
- macOS / Linux / Windows
- A Claude Max subscription (claude.ai account)
- Crush CLI installed
Platform-specific auto-start:
- macOS: launchd (built-in)
- Linux: systemd (user service)
- Windows: Task Scheduler
Supported Models
All Anthropic models available through your Claude Max subscription, including:
anthropic/claude-opus-4-6anthropic/claude-sonnet-4-5-20250514anthropic/claude-haiku-3-5-20241022- And more
License
MIT
