maxpool 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +101 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,6 +6,19 @@ Sits transparently between Claude Code and the Anthropic API, managing multiple
|
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
9
|
+
## ⚠️ Read this first: account risk and Anthropic's terms
|
|
10
|
+
|
|
11
|
+
This tool sits in a **contested gray area** of Anthropic's terms. Using it could put your Claude accounts at risk. Please read before installing.
|
|
12
|
+
|
|
13
|
+
- **Not blessed by Anthropic.** This is an independent project. Anthropic has not approved multi-account proxying, and nothing here is covered by an official "this is allowed" statement.
|
|
14
|
+
- **The terms can be read to prohibit it.** Anthropic's Consumer Terms (Section 3, automated access) and its February 2026 rule that subscription OAuth tokens are "only authorized for use with Claude Code" can reasonably be read to cover a proxy that selects and injects tokens across accounts. It is genuinely ambiguous, and the ambiguity is not in your favor.
|
|
15
|
+
- **Multiplexing is a detectable pattern.** Many accounts fronted by one machine, with parallel sessions and fast token rotation, looks like the anomaly Anthropic's automated systems flag, regardless of intent. People have lost accounts to pattern detection, and a clawback can hit all your pooled accounts at once.
|
|
16
|
+
- **Owned accounts only. No spoofing.** Only use accounts you personally own and pay for. Never share accounts across people (that is the clear violation), and never add IP/residential proxies, fingerprint spoofing, or MITM. Those are the documented ban triggers, and this fork deliberately leaves them out. PRs adding them will be rejected.
|
|
17
|
+
- **You are accepting the risk.** If you use this, you may lose accounts you pay for. This notice protects honesty, not your account.
|
|
18
|
+
- **Do your own research. This is not legal advice.** The terms have moved several times in 2026. Check the current terms yourself before relying on it.
|
|
19
|
+
|
|
20
|
+
If you want certainty, ask Anthropic support directly, or use **API-key accounts** (the sanctioned path for tooling) instead of subscription OAuth.
|
|
21
|
+
|
|
9
22
|
## Features
|
|
10
23
|
|
|
11
24
|
- **Rate-aware load balancing** — ranks accounts by remaining quota ÷ time-to-reset, not raw usage %, so a near-reset account with quota left is drained (use-it-or-lose-it) and one burning fast early in its window is spared; sequential traffic rotates across accounts instead of funnelling onto one
|
|
@@ -52,6 +65,48 @@ claude /login # Log into an account in Claude Code
|
|
|
52
65
|
maxpool import # Import its credentials
|
|
53
66
|
```
|
|
54
67
|
|
|
68
|
+
## Recommended setup
|
|
69
|
+
|
|
70
|
+
The cleanest way to use maxpool day-to-day: **keep your normal `claude` login untouched, and add a separate alias that routes through the pool.** Then plain `claude` still uses your default single account, and `ccmax` (call it whatever you like) spreads work across all your accounts.
|
|
71
|
+
|
|
72
|
+
1. **Install and add your accounts** (see [Adding Accounts](#adding-accounts)):
|
|
73
|
+
```bash
|
|
74
|
+
npm install -g maxpool
|
|
75
|
+
maxpool login # repeat for each account (browser) — or `maxpool import`
|
|
76
|
+
```
|
|
77
|
+
2. **Start the proxy** and leave it running (it shows a live dashboard):
|
|
78
|
+
```bash
|
|
79
|
+
maxpool
|
|
80
|
+
```
|
|
81
|
+
3. **Add an alias** to your `~/.zshrc` (or `~/.bashrc`):
|
|
82
|
+
```bash
|
|
83
|
+
# Run Claude Code through the maxpool proxy.
|
|
84
|
+
# Your plain `claude` stays on its own separate login.
|
|
85
|
+
ccmax() {
|
|
86
|
+
local url
|
|
87
|
+
url="$(maxpool env | sed -n 's/^export ANTHROPIC_BASE_URL=//p')"
|
|
88
|
+
( unset ANTHROPIC_API_KEY ANTHROPIC_AUTH_TOKEN
|
|
89
|
+
ANTHROPIC_BASE_URL="$url" \
|
|
90
|
+
ANTHROPIC_CUSTOM_HEADERS="x-maxpool-session: $(uuidgen)" \
|
|
91
|
+
claude "$@" )
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
Reload with `source ~/.zshrc` (or just open a new terminal).
|
|
95
|
+
4. **Use it:**
|
|
96
|
+
```bash
|
|
97
|
+
ccmax # Claude Code, load-balanced across all your accounts
|
|
98
|
+
claude # unchanged — still your normal single-account login
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Why this approach:
|
|
102
|
+
|
|
103
|
+
- **Your normal `claude` stays separate.** maxpool keeps its own account tokens in its config; your everyday Claude Code login (in the OS keychain) is never touched. Use `ccmax` when you want the pool, `claude` when you don't.
|
|
104
|
+
- **Session affinity.** The `x-maxpool-session` header pins each terminal to one account (with automatic failover), so a single task doesn't bounce between accounts mid-stream.
|
|
105
|
+
- **No key needed locally.** The proxy listens on `127.0.0.1` and accepts local clients without an API key, so the alias stays short.
|
|
106
|
+
- **Composes with your other aliases.** If you already use aliases for other providers (GLM, Kimi, …), `ccmax` slots right in alongside them.
|
|
107
|
+
|
|
108
|
+
> Prefer zero config? `maxpool run` launches Claude Code through the proxy for you — the alias above is the same idea, just composable with your own setup. Most people end up making an alias.
|
|
109
|
+
|
|
55
110
|
## Adding Accounts
|
|
56
111
|
|
|
57
112
|
### OAuth Login (recommended)
|
|
@@ -116,7 +171,18 @@ Falls back to plain log output when not a TTY (e.g. running as a service).
|
|
|
116
171
|
|
|
117
172
|
State-changing actions show what will happen and require `y` or `n`. In selection mode, use `j`/`k` or arrow keys to navigate, `Enter` to choose, and `Esc` to go back.
|
|
118
173
|
|
|
119
|
-
The Accounts menu
|
|
174
|
+
The Accounts menu (`a`) lets you add and manage accounts without leaving the TUI:
|
|
175
|
+
|
|
176
|
+
| Key | Action |
|
|
177
|
+
|-----|--------|
|
|
178
|
+
| `i` | Import the account you're currently logged into Claude Code as |
|
|
179
|
+
| `l` | Log in via browser — add *any* account, then name it |
|
|
180
|
+
| `k` | Add an Anthropic API key account |
|
|
181
|
+
| `n` | Rename the selected account |
|
|
182
|
+
| `t` | Enable or disable the selected account |
|
|
183
|
+
| `d` | Permanently delete an idle account |
|
|
184
|
+
|
|
185
|
+
Disabling keeps credentials in config but prevents new requests from using the account. Deletion is blocked while that account has active requests. The currently-active account is marked with a green `►`.
|
|
120
186
|
|
|
121
187
|
Routing modes:
|
|
122
188
|
|
|
@@ -174,6 +240,7 @@ maxpool accounts # List accounts with subscription tier and token statu
|
|
|
174
240
|
maxpool accounts -v # Also show token expiry times
|
|
175
241
|
maxpool status # Show live proxy status (requires running server)
|
|
176
242
|
maxpool remove <name> # Remove an account
|
|
243
|
+
maxpool rename <name|#> <new> # Rename an account (by name or list number)
|
|
177
244
|
maxpool api <path> # Call an API endpoint with account credentials
|
|
178
245
|
maxpool help # Show all commands
|
|
179
246
|
```
|
|
@@ -208,6 +275,8 @@ TEAMCLAUDE_CONFIG=./my-config.json maxpool server
|
|
|
208
275
|
"apiKey": "tc-auto-generated-key"
|
|
209
276
|
},
|
|
210
277
|
"upstream": "https://api.anthropic.com",
|
|
278
|
+
"updateCheck": true,
|
|
279
|
+
"autoUpdate": false,
|
|
211
280
|
"switchThreshold": 0.90,
|
|
212
281
|
"scheduler": {
|
|
213
282
|
"mode": "adaptive-least-loaded",
|
|
@@ -235,7 +304,7 @@ TEAMCLAUDE_CONFIG=./my-config.json maxpool server
|
|
|
235
304
|
"pollMs": 1000
|
|
236
305
|
},
|
|
237
306
|
"shutdown": {
|
|
238
|
-
"drainTimeoutMs":
|
|
307
|
+
"drainTimeoutMs": 15000
|
|
239
308
|
},
|
|
240
309
|
"accounts": [
|
|
241
310
|
{
|
|
@@ -256,7 +325,10 @@ TEAMCLAUDE_CONFIG=./my-config.json maxpool server
|
|
|
256
325
|
| `proxy.port` | Local port the proxy listens on |
|
|
257
326
|
| `proxy.apiKey` | API key clients use for status/admin requests |
|
|
258
327
|
| `upstream` | Upstream API base URL |
|
|
259
|
-
| `
|
|
328
|
+
| `updateCheck` | Check npm for a newer maxpool on startup and notify; defaults to `true` |
|
|
329
|
+
| `autoUpdate` | Install new versions automatically (applied on next restart, never interrupting sessions); defaults to `false` |
|
|
330
|
+
| `switchThreshold` | Quota utilization (0–1) at which an account is avoided (5h *and* weekly); default `0.90`. Raise toward `0.97` to use more before rotating |
|
|
331
|
+
| `scheduler.weeklySoftThreshold` / `weeklyReserveThreshold` / `weeklyCriticalThreshold` / `weeklyExhaustedThreshold` | Weekly (7d) quota tiers (0–1) controlling how aggressively an account is de-prioritised as its weekly usage climbs |
|
|
260
332
|
| `scheduler.safetyMaxActivePerAccount` | Emergency circuit breaker, not a normal capacity cap |
|
|
261
333
|
| `scheduler.safetyMaxGlobalActive` | Emergency global circuit breaker |
|
|
262
334
|
| `retry.maxAttemptsPerRequest` | Retry attempts before returning an error; `0` means one pass over accounts |
|
|
@@ -302,6 +374,32 @@ The weekly usage bar shows raw upstream utilization and reset timing. Reset-awar
|
|
|
302
374
|
17. When Restart is confirmed, new upstream admission pauses immediately. Existing upstream requests finish, queued requests cannot deadlock restart, and their sockets close during relaunch so Claude Code reconnects automatically
|
|
303
375
|
18. Client token refresh requests (`/v1/oauth/token`) are relayed to upstream untouched — the proxy and client manage their own token lifecycles independently
|
|
304
376
|
|
|
377
|
+
## FAQ
|
|
378
|
+
|
|
379
|
+
**Does this touch my normal Claude Code login?**
|
|
380
|
+
No. maxpool stores its own account tokens in its config file. Your everyday `claude` login lives in the OS keychain and is never modified. Run `ccmax` for the pool, `claude` for your normal login.
|
|
381
|
+
|
|
382
|
+
**How do I add another account?**
|
|
383
|
+
`maxpool login` (browser — adds any account), or in the TUI press `a` then `l`. To add the account you're currently logged into Claude Code with, use `maxpool import` (or `a` then `i`).
|
|
384
|
+
|
|
385
|
+
**Can I rename an account?**
|
|
386
|
+
Yes — `maxpool rename <name|number> <new-name>`, or in the TUI press `a` then `n`.
|
|
387
|
+
|
|
388
|
+
**An account stopped being used before it hit 100% — why?**
|
|
389
|
+
maxpool stops routing to an account at `switchThreshold` (default 90%) of its 5-hour or weekly window, leaving a safety margin so it's never hard rate-limited. Raise it in your config (toward 0.97) to use more before rotating.
|
|
390
|
+
|
|
391
|
+
**One account shows empty quota bars but it's serving requests — is it broken?**
|
|
392
|
+
No. The bars show how *full* an account is toward its limit, so an empty bar means lots of headroom (good). Actual activity is in the `15m`/`1h` request-count columns.
|
|
393
|
+
|
|
394
|
+
**Will updates apply automatically?**
|
|
395
|
+
Set `"autoUpdate": true` in your config and maxpool installs new versions itself (applied on the next restart; running sessions are never interrupted). Otherwise `npm i -g maxpool` updates it.
|
|
396
|
+
|
|
397
|
+
**Where do my tokens go?**
|
|
398
|
+
They're stored locally in your config (file mode `0600`) and sent only to Anthropic — or, in the optional `all` profile, to GLM/Kimi if you supply those. Nothing else leaves your machine. Zero third-party dependencies.
|
|
399
|
+
|
|
400
|
+
**How do I stop it?**
|
|
401
|
+
Press `q` in the TUI (or Ctrl-C). It drains briefly, then exits.
|
|
402
|
+
|
|
305
403
|
## Credits
|
|
306
404
|
|
|
307
405
|
maxpool is a fork of [KarpelesLab/teamclaude](https://github.com/KarpelesLab/teamclaude)
|