Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Claude RotateNew to Visual Studio Code? Get it now.
Claude Rotate

Claude Rotate

Darshan Moradiya

|
1 install
| (0) | Free
Run Claude Code on several of your accounts and switch to the next one when a usage limit is hit.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Claude Rotate

Runs Claude Code on one of your accounts and moves you to the next account when Claude Code hits a usage limit. Works with Claude Code in a VS Code terminal, with the official Claude Code extension's chat panel, or both.

First-time setup

  1. Click the Claude Rotate icon in the Activity Bar (two circling arrows), then Add account (or Ctrl+Shift+P -> Claude Rotate: Add Account (generate token)).
  2. Give it a label (the account's email). A terminal runs claude setup-token.
  3. Log in as THAT account in the browser. If the browser is already logged in to another Claude account, log out on claude.ai first, or paste the link from the terminal into a private window.
  4. Copy the sk-ant-oat01-... token from the terminal and click Paste token.
  5. Repeat for each account. Tokens are stored in VS Code SecretStorage (Windows Credential Manager).
  6. Pick a target in the sidebar's Settings: terminal (default), panel, or both.

The sidebar

  • Session card (top): the active account, whether the terminal / panel is on, and Start, Switch, Stop.
  • Accounts in rotation order: ready / cooling with a live countdown, days until the token expires (highlighted under 30), and an "active" marker. ▶ starts on that account; ⋯ opens Mark limited (session / weekly), Clear cooldown, Rename, Move up / down (changes the rotation order), Remove. + in the header adds an account.
  • Settings (at the bottom): grouped by question (where Claude runs, what happens at a limit, which account comes next, usage check, fallback cooldown), each with a line explaining the current choice. ▸ Advanced has the Claude command, panel token method and limit pattern. Open in VS Code Settings at the end of the panel opens the Settings UI. The clock icon in the Settings header opens the Activity log.
  • Activity (clock icon in the view's title bar or the Settings header) opens the log in an editor tab: the last 200 events grouped by day, each with its time and type (limit, switch, error, start, info), filter chips per type, a search box and Clear log. It updates live and never contains tokens. A number on the Claude Rotate icon counts new limits, switches and errors until you open it.
  • The view's ··· menu has Simulate Limit, Test Panel Token (panel targets) and Clear Activity Log.

Clicking the status bar item opens the sidebar. All commands are also in the Command Palette under "Claude Rotate".

How switching works

Terminal (target: terminal)

The token is set only in that terminal's environment. Claude Rotate reads the terminal output (shell integration), and on a limit message starts the next account with claude --continue, so the same chat continues. Nothing outside that terminal is touched.

Claude Code panel (target: panel)

  • Start gives the account's token to the Claude Code extension and opens a new Claude Code chat tab.
  • Limits are detected from Claude Code's transcripts (~/.claude/projects/**/*.jsonl, or $CLAUDE_CONFIG_DIR/projects). Only lines written after VS Code started are read. The transcript contains the exact reset time, which is used for the cooldown instead of the fixed hours.
  • A running panel chat keeps the token it started with. So on a switch, Claude Rotate puts the next token in place, closes the chat that hit the limit, and reopens the same chat (by session ID) in a new tab, which starts on the new account. You then send your next message.
    • It finds the tab by the chat's title. If that is not clear, it asks where the chat is.
    • Sidebar chats. Claude Code keeps a sidebar chat's process running until the window reloads, and gives other extensions no way to restart it. So for a chat in the Claude Code sidebar, Claude Rotate puts the next token in place, reloads the VS Code window and then reopens that chat in the sidebar. Every open Claude Code chat restarts on the new account (they all ran on the account that hit the limit). A reply that is still being written is cut off. This sets claudeCode.preferredLocation to sidebar (the same thing Claude Code's "Open in Side Bar" does), so new chats open there too.
    • With autoSwitch auto, or after you click Switch on the limit prompt, this happens without another question when no chat tab is open (the chat must be in the sidebar) or exactly one tab has the chat's title.
    • If reopening fails, it tells you to start a new chat and resume the previous one from Claude Code's history.
  • Start and New chat open the chat where claudeCode.preferredLocation says: a tab or the sidebar.

Both (target: both)

Terminal and panel use the same account and switch together.

Panel token methods (claudeRotate.panelTokenMethod)

Method How Tradeoff
processEnv Sets CLAUDE_CODE_OAUTH_TOKEN in the VS Code extension host's environment. Claude Code builds each new chat's environment from it. Nothing is written to disk. Every extension in the same extension host can read that environment variable, and processes they start inherit it. Gone when VS Code closes (re-applied on start).
settings Writes { "name": "CLAUDE_CODE_OAUTH_TOKEN", "value": "<token>" } into claudeCode.environmentVariables in your user settings.json. Your other entries there are kept. The token is in plain text on disk in settings.json. It is added to settingsSync.ignoredSettings so it does not sync, and removed when you press Stop, remove the account, or set target back to terminal.
auto (default) processEnv, unless Test panel token showed that it does not reach the panel; then settings.

Test panel token (command "Claude Rotate: Test Panel Token Method (processEnv)") puts an obviously invalid token into the extension host environment, opens a new Claude Code chat, and asks you to send "hi". If that chat fails to authenticate, processEnv works.

When target is terminal, Claude Rotate does not change process.env or Claude Code's settings.

Priority order (claudeRotate.priorityMode, off by default)

Turn on Priority order in the sidebar settings. The account list is then a priority list: the top account is priority 1. Reorder with ··· → Move up / Move down.

  • Start uses the highest-priority account that is ready.
  • On a limit it moves to the highest-priority ready account (not just the next one in the list).
  • Switching back: once a minute it looks for a higher-priority account whose limit has reset. With the usage check on, it first asks Anthropic to confirm the account really is usable. Then, depending on On usage limit: "Switch automatically" switches back, "Ask me" asks (Not now holds for 30 minutes), "Do nothing" never switches back.
  • It only switches back while Claude is quiet: no terminal output and no panel transcript writes for 90 seconds. So a reply in progress is never cut off. Switching back restarts Claude like any switch (for a sidebar chat that means a window reload).
  • If you pick an account yourself (Start on a specific account, or Switch away from an account that is not limited), switching back pauses until the next limit, or until you Stop and Start.
  • Off: accounts rotate to the next one in the list, and nothing switches back.

Usage check (claudeRotate.usageCheckMinutes, default 10)

Every few minutes Claude Rotate asks Anthropic how much of each account's limits is used and shows it under the account in the sidebar (session = 5-hour window, weekly = 7-day window, with the time until each resets).

  • How: a token from claude setup-token may not read the usage page that Claude Code's /usage uses (403, missing user:profile scope). But every API response carries the account's limits in anthropic-ratelimit-unified-* headers. So the check sends a 1-token request per account to the cheapest model. That costs a tiny amount of usage, and on an idle account it starts its 5-hour window.
  • An account that is at a limit is marked cooling with the exact reset time, without you doing anything. If it is the account in use, this works like a detected limit (it asks or switches, per On usage limit).
  • A cooling account whose check says it is usable again is marked ready.
  • Switch no longer asks why you are switching when the check works: it marks the account only if it really is at a limit.
  • The refresh button in the Accounts header (or Claude Rotate: Check Usage Now) checks all accounts now. Set the setting to 0 to turn the check off; then the manual "Mark limited" actions are what you have.

Testing without using real usage

Simulate Limit (··· menu in the sidebar's title bar, or "Claude Rotate: Simulate Limit (testing)") runs the same handling as a real limit for the current session: it marks the account as cooling, switches (depending on autoSwitch), and logs it. Use Clear cooldown afterwards.

Settings

  • claudeRotate.target: terminal (default) | panel | both
  • claudeRotate.autoSwitch: ask (default) | auto | off
  • claudeRotate.cooldownHours: hours to skip an account after a session limit with no reset time (default 5)
  • claudeRotate.weeklyCooldownHours: hours to skip after a weekly limit with no reset time (default 24)
  • claudeRotate.claudeCommand: command to run in the terminal (default claude)
  • claudeRotate.panelTokenMethod: auto (default) | processEnv | settings
  • claudeRotate.limitPattern: regex matched against new transcript lines (default "apiError"\s*:\s*"usage_limit_reached")

Known limitations

  • Reopening a panel chat by session ID uses an undocumented argument of Claude Code's claude-vscode.editor.open command (found in Claude Code 2.1.312). A Claude Code update can change it; then you get the "start a new chat and resume from history" notification instead.
  • Claude Rotate cannot type into the Claude Code panel. After a switch you send the next message yourself.
  • The window reload for a sidebar chat (see above) also ends Claude Rotate's tracking of its terminal with target both: the terminal keeps running, but limits in it are no longer detected. Press Start again.
  • Finding a chat's tab by title needs the title line in the transcript to be written after VS Code started (Claude Code rewrites it often). Otherwise Claude Rotate asks.
  • Panel chats that were already open before Start, or that Claude Code restores when VS Code starts, use whatever login they started with.
  • If ANTHROPIC_API_KEY is set in VS Code's environment, or claudeCode.environmentVariables already has your own CLAUDE_CODE_OAUTH_TOKEN, that overrides the account Claude Rotate gives the panel (you get a warning).
  • Transcript lines from the Claude desktop app (same folder) are ignored.
  • Terminal detection reads the terminal text. If Anthropic changes the wording of the limit message, detection can miss it; use Switch to next and update LIMIT_RE in extension.js.
  • Terminal detection needs VS Code terminal shell integration (on by default for PowerShell).
  • Tokens from claude setup-token last about 1 year. You get a warning 30 days before.
  • If apiKeyHelper is set in your Claude settings, it conflicts with the token. Remove it.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft