
AgentPool — AI Account Switcher
One account switcher for your Claude Code and Codex subscriptions, inside VS Code.
If AgentPool saves you from a usage limit, please ⭐ rate it on the Marketplace and star it on GitHub — it helps other developers find it.
Manage several Claude Code and Codex accounts in VS Code:
- Hover the status bar to see every account's quota (5-hour, weekly, per model) and reset times.
- Switch with one click from the tooltip, the editor title icon, the AgentPool view, or
AgentPool: Switch account.
- Priority order: drag accounts in the AgentPool view (or use ↑/↓). Auto switch walks this order, e.g. B → A → C.
- Auto switch before the account in use runs out (default 95%), and back to a higher-priority account once it has room again.
- Account groups: company projects on company accounts, personal projects on personal ones — in parallel windows, with your personal setup kept out of company sessions. How →
How it looks
Quota of every account, on hover
Your priority order, by drag and drop
Auto switch before you hit the limit
Quick start
- Install AgentPool. It saves the Claude Code / Codex accounts you are already signed in to, and the status bar shows their quota right away.
- Add account (+ in the AgentPool view, or the welcome message) for each other account. It signs in through an isolated login in a terminal + your browser; the account in use is untouched. No CLI to install: AgentPool uses the
claude / codex that ships with the official extensions.
- Drag accounts into the order you want — the order is saved immediately. Done — hover the status bar to watch quotas; auto switch handles the rest.
Signed in to another account later (/login, codex login)? AgentPool saves it on its own.
Long sessions across organizations
Switching to an account in another organization means Claude cannot reuse its earlier thinking
("Claude can't use thinking from another organization") and rereads the whole conversation — slow and
costly on a long session. AgentPool keeps you in the same conversation (compact mode, default):
- Near the limit (default 90% when switching at 95%), AgentPool asks you to run
/compact:
a Compact now button copies it and focuses Claude, and a reminder appears in the Claude panel
after each reply.
- Right after the compaction AgentPool switches accounts. The summary also gets your latest
requests verbatim, the files changed and the current
git status.
- Keep typing in the same conversation: its first reply reads the short summary, not the whole history.
No compaction by the threshold? AgentPool switches anyway — the conversation still continues, its first
reply just rereads the history. Switching within one organization needs none of this.
Prefer a fresh conversation instead? Set agentPool.claude.handoff.mode to newConversation: Claude
writes a handoff and the next conversation starts from it.
It uses two official Claude Code hooks (Stop, SessionStart),
added to ~/.claude/settings.json only after you agree once; your other hooks are left as they are.
Turn it off with agentPool.claude.handoff.enabled (the hooks are removed). The hooks read only local
files (the session transcript, git status); nothing is sent anywhere.
Settings
| Setting |
Default |
What it does |
agentPool.autoSwitch.thresholdPercent |
95 |
Switch away when the 5-hour limit reaches this share (50–100). Also: AgentPool: Set auto-switch threshold, or click the % in the tooltip. |
agentPool.autoSwitch.weeklyThresholdPercent |
98 |
Same for weekly / per-model limits (never below the 5-hour one): 60% of a week still leaves plenty of room. |
agentPool.autoSwitch.enabled |
on |
Auto switch on/off. |
agentPool.autoSaveLogins |
on |
Save the account you sign in to automatically. |
agentPool.claude.pollIntervalSeconds / agentPool.codex.pollIntervalSeconds |
300 |
How often the account in use reads its quota (halved near the threshold). |
agentPool.idlePollMinutes |
30 |
How often accounts not in use read their quota. |
agentPool.claude.handoff.enabled / .marginPercent |
on / 5 |
Long-session help when switching to another organization, starting this many points before the threshold. |
agentPool.claude.handoff.mode |
compact |
compact (same conversation, /compact before the switch) or newConversation. |
agentPool.claude.handoff.newConversation |
off |
newConversation mode only: ask (button) or auto. |
agentPool.claude.switchTerminalToo |
off |
Switch the terminal's claude too (see below). |
agentPool.claude.groupSharedItems |
agents, commands, skills |
What an account group's slot shares from ~/.claude (see Account groups). |
agentPool.claude.groupMcpServers |
["*"] |
Which global MCP servers an account group gets: * all, a name, !name to leave one out. |
To remove an account: 🗑 on its row in the AgentPool view or in the quick view, or AgentPool: Remove account.
Claude Code: switch scope
Setting agentPool.claude.switchTerminalToo |
What a switch changes |
| off (default) |
Only Claude Code inside VS Code. It gets its own CLAUDE_CONFIG_DIR (~/.agent-pool/claude-vscode, Keychain item Claude Code-credentials-<hash>). claude in iTerm/Terminal keeps its account. |
| on |
The system login (Keychain Claude Code-credentials): every claude in every terminal and VS Code. |
The VS Code slot links your ~/.claude items (CLAUDE.md, agents, skills, commands, hooks, settings, plugins, projects…) so your config stays the same; only the login and .claude.json are separate. The first switch into the slot, and switching back to the terminal's account, need one window reload. Later switches are picked up by running sessions within ~35 s.
When VS Code and the terminal use the same account, AgentPool keeps their two copies of the login on
one generation (it renews early and copies any newer token across), since a refresh token can only be
used once.
Choose the terminal's account: right-click it → Use for terminal (pin). VS Code switches never
move the terminal, and VS Code can still use that same account — AgentPool keeps both copies of the
login in sync.
Windows and Linux: Claude Code keeps its login in .credentials.json instead of the Keychain; AgentPool switches that file the same way. On Windows, shared folders are linked as junctions (no admin rights or Developer Mode needed) and shared files as hard links or refreshed copies.
Account groups: company and personal projects side by side
Working on company and personal projects at the same time? Put each workspace in an account group
— say Company for projects A, B, C, while D and X stay in the default group — and every VS Code
window runs Claude Code on its own group's account, side by side. Company work never runs on a
personal account, and your personal setup never reaches a company session.
Set it up (once per company project)
- Open the company project. In the AgentPool view, click the first row, Account group: Default
(or run
AgentPool: Account group for this workspace…) → New group… → type Company.
- A list of your Claude Code accounts opens: tick the company ones → OK.
- Click Reload Window in the dialog — or, if you skipped it, the first row now reads
⟳ Reload window to use Company: one click. The status bar then shows
[Company] ….
For projects B and C: click the first row → pick Company → reload. Projects you never assign stay
in Default. The first time groups are turned on, reload your other open VS Code windows once.
Everyday use
| You want to |
Do this |
| See which group a window uses |
First row of the AgentPool view, or the status bar ([Company] dev@acme 42%). In a Claude session, /status shows the account. |
| Move a project to another group |
Click the first row → pick the group → reload (row, ⟳ in the view's title bar, or a click on the status bar). |
| Change a group's accounts |
☑ at the end of the first row (or right-click Claude Code → Choose accounts of a group…): ticked accounts join, unticked ones go back to Default. |
| Move several accounts at once |
Cmd/Ctrl-click them → right-click → Move to account group…. |
| Add a new company account |
In a company window, + Add account: a login signed in from a group's window joins that group. |
| Switch account inside a group |
As usual — a window lists, switches and auto-switches only its own group's accounts. |
Each group has its own login (~/.agent-pool/claude-group-<id>), its own priority order and its own
auto switch, which never crosses into another group. claude in the integrated terminal of a group's
window uses the group's account too; terminals outside VS Code keep the terminal's account. An account
a group is using cannot be moved until that group switches to another one (one login live in two
places would sign one of them out).
Privacy
A group other than Default is isolated: its folder links only agentPool.claude.groupSharedItems
from ~/.claude (default: agents, commands, skills). Your global CLAUDE.md, settings.json
and its hooks, memory and the history of your other projects are not there, so a company session
never receives your personal instructions or history. Your global MCP servers do come along (synced
each time the window starts; setting agentPool.claude.groupMcpServers, default ["*"]) — leave one
out with !name, e.g. ["*", "!memory-server"] for a server that can read your personal history. The workspace's own conversations are
linked in, so you can continue a conversation started before the project joined the group. Want instructions for company work? Put a CLAUDE.md
in ~/.agent-pool/claude-group-<id>/. Agent, command and skill descriptions are sent to Claude in every
session — set the setting to [] to share nothing.
Good to know
- Claude Code's
claudeCode.environmentVariables setting applies to every window, so with groups
AgentPool removes its CLAUDE_CONFIG_DIR there and sets it in each window's own extension host,
which Claude Code passes on to the sessions it starts. If Claude Code ever starts before AgentPool in
a group's window, AgentPool asks you to reload. After a Claude Code update, /status is a quick check.
- A window keeps its group until it reloads: a running session never changes account mid-way.
- With groups,
agentPool.claude.switchTerminalToo is ignored (each window keeps its own login).
- Long-session help (
/compact reminder, handoff) stays with Default: its hooks live in
~/.claude/settings.json.
- Codex is not grouped: its quota is read and auto-switched by a Default window.
- No VS Code profile is needed.
Codex
The login is ~/.codex/auth.json (CODEX_HOME respected; only the file credential store is supported). A running Codex keeps its login until restarted, so a switch offers Reload Window; restart codex in terminals yourself.
Adding accounts
- Save current login: saves the account the tool is signed in to now.
- Add account (isolated login): runs
claude auth login / codex login in a throwaway config folder, so the login in use is untouched.
Never use Claude's /login or Log out, or codex login/codex logout on the live config to add accounts: they replace or revoke the login in use.
How it stays signed in
- Writes to Claude Code's slots take Claude Code's own
proper-lockfile locks (.oauth_refresh.lock, .storage-write.lock) and re-read inside them.
- The outgoing login is always parked (saved) before anything overwrites it; a login nobody saved is enrolled automatically.
- Live logins are never renewed behind the owning tool's back; parked logins are renewed by AgentPool only.
- Only
claudeAiOauth of Claude Code's credential document is swapped; MCP server tokens stay.
Support the project
AgentPool is free and open source. The best ways to help:
Privacy
No telemetry, no server. Requests go only to Anthropic (api.anthropic.com, platform.claude.com) and OpenAI (auth.openai.com, chatgpt.com) for token renewal, identity and usage. Parked logins are kept in VS Code's encrypted SecretStorage; non-secret state in ~/.agent-pool/pool.json.
The usage and OAuth endpoints are unofficial and may change. Manage only your own accounts and respect each provider's terms.
Development
npm install
npm run typecheck && npm test
npm run build # F5 "Run AgentPool" for an Extension Development Host
npm run package # agent-pool-<version>.vsix
docs/screenshots-src/render.sh # re-render README images (mockups with fictional data)
Ideas and measured facts from
claude-account-switcher (MIT) and
pitboard (Apache-2.0).