{"slug": "teamclaude-rewrite-in-rust-run-multiple-claude-accounts-in-parllel", "title": "Teamclaude rewrite in rust, run multiple Claude accounts in parllel", "summary": "A developer released Teamclaude, a Rust rewrite of the Node-based rotating Anthropic proxy, enabling users to run multiple Claude accounts in parallel with load balancing and a live TUI. The tool supports OAuth token refresh, quota monitoring, and session affinity, and is designed for local use only to enhance security.", "body_md": "A lean, single-user **rotating Anthropic proxy** in Rust. Point your Claude Code (or\nany Anthropic API client) at it and it spreads requests across several Claude\naccounts, refreshes their OAuth tokens automatically, and shows a live TUI with\nper-account quota and request counts.\n\nIt's a from-scratch Rust rewrite of the Node proxy [teamclaude](https://github.com/KarpelesLab/teamclaude) — same on-disk config, same certs,\nso it's a drop-in on the same port.\n\nThe dashboard above is\n\n`tcr demo`\n\n— the real TUI rendered with fake accounts. Run it yourself with`tcr demo`\n\n.\n\n**Load-balances** across your accounts: least-recently-selected rotation, so no single account gets hammered. Priority tiers are respected (keep \"pillow\" accounts as last resort).**Two entry modes on one port:****Base-URL:** set`ANTHROPIC_BASE_URL=http://127.0.0.1:3456`\n\n.**Forward-proxy (MITM):** set`HTTPS_PROXY=http://127.0.0.1:3456`\n\n+`NODE_EXTRA_CA_CERTS=<ca.pem>`\n\n. Only`api.anthropic.com`\n\nis intercepted and token-injected; every other host is blind-tunneled, so Claude Code's other endpoints keep working.\n\n**Zero-spend quota probe:** reads each account's usage from the OAuth usage endpoint (no message quota spent) so the bars stay fresh even when idle.**Honest live TUI:** per-account status, 5h / 7d quota bars, probe health, request counts, and a recent-request log. Near-limit accounts read as \"near\"/\"full\" — never a false \"error\".**Localhost only:** binds`127.0.0.1`\n\n, so local clients need no API key.\n\n```\ncargo build --release\nln -sfn \"$PWD/target/release/tcr\" ~/.local/bin/tcr   # put `tcr` on PATH\n```\n\nConfig lives at `~/.config/teamclaude.json`\n\n:\n\n```\n{\n  \"proxy\": { \"port\": 3456 },\n  \"switchThreshold\": 0.90,\n  \"quotaProbeSeconds\": 75,\n  \"accounts\": [\n    {\n      \"name\": \"you@example.com\",\n      \"type\": \"oauth\",\n      \"accessToken\": \"sk-ant-oat01-...\",\n      \"refreshToken\": \"sk-ant-ort01-...\",\n      \"expiresAt\": 1893456000000,\n      \"priority\": 0\n    }\n  ]\n}\n```\n\n`priority`\n\nis lowest-wins (default 0); give backup accounts a higher number so\nthey're used only when the primaries are near their cap.\n\nAdding accounts:run`tcr login`\n\n— it walks you through Anthropic's OAuth browser flow (PKCE) and writes the resulting tokens straight into the config. You can also paste existing OAuth tokens in by hand. Either way the file is written`0600`\n\n; never commit it.\n\n```\ntcr                 # start the proxy with the live TUI (q to quit)\ntcr server --headless   # run in the background, log to stdout\ntcr run -- <args>   # launch `claude` already pointed at the proxy\n```\n\nThen either export `ANTHROPIC_BASE_URL`\n\n/ `HTTPS_PROXY`\n\nas above, or use `tcr run`\n\n.\n\nEverything the Node original did (and a couple it didn't) is implemented: OAuth\n`login`\n\n, per-model (Fable-aware) routing, the account CLI (`accounts`\n\n/ `remove`\n\n/\n`priority`\n\n/ `enable`\n\n/ `disable`\n\n/ `status`\n\n), `update`\n\n, keep-warm, and session\naffinity. Two are opt-in via `~/.config/teamclaude.json`\n\n, off by default:\n\n`\"sessionAffinity\": true`\n\n— pin a client session to one account for its lifetime.**Anthropic's prompt cache is per-account**, so per-request rotation gives every turn a cold cache; affinity keeps a session's cache warm on its account while different sessions still spread across accounts.`\"warmupSeconds\": <n>`\n\n— periodically warm idle accounts so their 5-hour window stays active. This one*spends real quota*, so enable it deliberately.\n\n- Binds\n`127.0.0.1`\n\nonly; the forward-proxy tunnel is reachable solely by the local user (no wider than the shell itself). - Only\n`api.anthropic.com`\n\nis TLS-terminated; all other hosts are pass-through byte tunnels (never decrypted). - Config and leaf key are\n`0600`\n\n. No secrets belong in this repo. **Secret scanning:** a`.githooks/pre-commit`\n\nhook runs`gitleaks git --staged`\n\n(config:`.gitleaks.toml`\n\n) so no secret reaches a commit. Enable it after cloning with`git config core.hooksPath .githooks`\n\n(needs`gitleaks`\n\non PATH).\n\nMIT — see [ LICENSE](/dhkts1/teamclaude-rs/blob/main/LICENSE). This is a Rust rewrite of\n\n[KarpelesLab/teamclaude](https://github.com/KarpelesLab/teamclaude)(MIT); the original's copyright and license are preserved in\n\n[.](/dhkts1/teamclaude-rs/blob/main/NOTICE)\n\n`NOTICE`", "url": "https://wpnews.pro/news/teamclaude-rewrite-in-rust-run-multiple-claude-accounts-in-parllel", "canonical_source": "https://github.com/dhkts1/teamclaude-rs", "published_at": "2026-07-18 06:36:13+00:00", "updated_at": "2026-07-18 06:51:18.254042+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "ai-infrastructure"], "entities": ["Teamclaude", "Anthropic", "Claude", "Rust", "Node"], "alternates": {"html": "https://wpnews.pro/news/teamclaude-rewrite-in-rust-run-multiple-claude-accounts-in-parllel", "markdown": "https://wpnews.pro/news/teamclaude-rewrite-in-rust-run-multiple-claude-accounts-in-parllel.md", "text": "https://wpnews.pro/news/teamclaude-rewrite-in-rust-run-multiple-claude-accounts-in-parllel.txt", "jsonld": "https://wpnews.pro/news/teamclaude-rewrite-in-rust-run-multiple-claude-accounts-in-parllel.jsonld"}}