maxpool 1.0.5 → 1.0.6

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.
Files changed (2) hide show
  1. package/README.md +88 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -52,6 +52,48 @@ claude /login # Log into an account in Claude Code
52
52
  maxpool import # Import its credentials
53
53
  ```
54
54
 
55
+ ## Recommended setup
56
+
57
+ 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.
58
+
59
+ 1. **Install and add your accounts** (see [Adding Accounts](#adding-accounts)):
60
+ ```bash
61
+ npm install -g maxpool
62
+ maxpool login # repeat for each account (browser) — or `maxpool import`
63
+ ```
64
+ 2. **Start the proxy** and leave it running (it shows a live dashboard):
65
+ ```bash
66
+ maxpool
67
+ ```
68
+ 3. **Add an alias** to your `~/.zshrc` (or `~/.bashrc`):
69
+ ```bash
70
+ # Run Claude Code through the maxpool proxy.
71
+ # Your plain `claude` stays on its own separate login.
72
+ ccmax() {
73
+ local url
74
+ url="$(maxpool env | sed -n 's/^export ANTHROPIC_BASE_URL=//p')"
75
+ ( unset ANTHROPIC_API_KEY ANTHROPIC_AUTH_TOKEN
76
+ ANTHROPIC_BASE_URL="$url" \
77
+ ANTHROPIC_CUSTOM_HEADERS="x-maxpool-session: $(uuidgen)" \
78
+ claude "$@" )
79
+ }
80
+ ```
81
+ Reload with `source ~/.zshrc` (or just open a new terminal).
82
+ 4. **Use it:**
83
+ ```bash
84
+ ccmax # Claude Code, load-balanced across all your accounts
85
+ claude # unchanged — still your normal single-account login
86
+ ```
87
+
88
+ Why this approach:
89
+
90
+ - **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.
91
+ - **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.
92
+ - **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.
93
+ - **Composes with your other aliases.** If you already use aliases for other providers (GLM, Kimi, …), `ccmax` slots right in alongside them.
94
+
95
+ > 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.
96
+
55
97
  ## Adding Accounts
56
98
 
57
99
  ### OAuth Login (recommended)
@@ -116,7 +158,18 @@ Falls back to plain log output when not a TTY (e.g. running as a service).
116
158
 
117
159
  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
160
 
119
- The Accounts menu can import the current Claude Code login, add an Anthropic API key, enable or disable an account, or permanently delete an idle account. Disabling keeps credentials in config but prevents new requests from using the account. Deletion is blocked while that account has active requests.
161
+ The Accounts menu (`a`) lets you add and manage accounts without leaving the TUI:
162
+
163
+ | Key | Action |
164
+ |-----|--------|
165
+ | `i` | Import the account you're currently logged into Claude Code as |
166
+ | `l` | Log in via browser — add *any* account, then name it |
167
+ | `k` | Add an Anthropic API key account |
168
+ | `n` | Rename the selected account |
169
+ | `t` | Enable or disable the selected account |
170
+ | `d` | Permanently delete an idle account |
171
+
172
+ 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
173
 
121
174
  Routing modes:
122
175
 
@@ -174,6 +227,7 @@ maxpool accounts # List accounts with subscription tier and token statu
174
227
  maxpool accounts -v # Also show token expiry times
175
228
  maxpool status # Show live proxy status (requires running server)
176
229
  maxpool remove <name> # Remove an account
230
+ maxpool rename <name|#> <new> # Rename an account (by name or list number)
177
231
  maxpool api <path> # Call an API endpoint with account credentials
178
232
  maxpool help # Show all commands
179
233
  ```
@@ -208,6 +262,8 @@ TEAMCLAUDE_CONFIG=./my-config.json maxpool server
208
262
  "apiKey": "tc-auto-generated-key"
209
263
  },
210
264
  "upstream": "https://api.anthropic.com",
265
+ "updateCheck": true,
266
+ "autoUpdate": false,
211
267
  "switchThreshold": 0.90,
212
268
  "scheduler": {
213
269
  "mode": "adaptive-least-loaded",
@@ -235,7 +291,7 @@ TEAMCLAUDE_CONFIG=./my-config.json maxpool server
235
291
  "pollMs": 1000
236
292
  },
237
293
  "shutdown": {
238
- "drainTimeoutMs": 600000
294
+ "drainTimeoutMs": 15000
239
295
  },
240
296
  "accounts": [
241
297
  {
@@ -256,7 +312,10 @@ TEAMCLAUDE_CONFIG=./my-config.json maxpool server
256
312
  | `proxy.port` | Local port the proxy listens on |
257
313
  | `proxy.apiKey` | API key clients use for status/admin requests |
258
314
  | `upstream` | Upstream API base URL |
259
- | `switchThreshold` | Quota utilization (0–1) at which an account is avoided |
315
+ | `updateCheck` | Check npm for a newer maxpool on startup and notify; defaults to `true` |
316
+ | `autoUpdate` | Install new versions automatically (applied on next restart, never interrupting sessions); defaults to `false` |
317
+ | `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 |
318
+ | `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
319
  | `scheduler.safetyMaxActivePerAccount` | Emergency circuit breaker, not a normal capacity cap |
261
320
  | `scheduler.safetyMaxGlobalActive` | Emergency global circuit breaker |
262
321
  | `retry.maxAttemptsPerRequest` | Retry attempts before returning an error; `0` means one pass over accounts |
@@ -302,6 +361,32 @@ The weekly usage bar shows raw upstream utilization and reset timing. Reset-awar
302
361
  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
362
  18. Client token refresh requests (`/v1/oauth/token`) are relayed to upstream untouched — the proxy and client manage their own token lifecycles independently
304
363
 
364
+ ## FAQ
365
+
366
+ **Does this touch my normal Claude Code login?**
367
+ 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.
368
+
369
+ **How do I add another account?**
370
+ `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`).
371
+
372
+ **Can I rename an account?**
373
+ Yes — `maxpool rename <name|number> <new-name>`, or in the TUI press `a` then `n`.
374
+
375
+ **An account stopped being used before it hit 100% — why?**
376
+ 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.
377
+
378
+ **One account shows empty quota bars but it's serving requests — is it broken?**
379
+ 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.
380
+
381
+ **Will updates apply automatically?**
382
+ 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.
383
+
384
+ **Where do my tokens go?**
385
+ 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.
386
+
387
+ **How do I stop it?**
388
+ Press `q` in the TUI (or Ctrl-C). It drains briefly, then exits.
389
+
305
390
  ## Credits
306
391
 
307
392
  maxpool is a fork of [KarpelesLab/teamclaude](https://github.com/KarpelesLab/teamclaude)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maxpool",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Multi-account Claude Code proxy with adaptive, rate-aware load balancing across Claude accounts",
5
5
  "type": "module",
6
6
  "main": "src/index.js",