← all repositories
realiti4/claude-swap

Swap Claude Code identities without the logout slog

It stashes and swaps OAuth tokens so you can rotate between Claude Code accounts without logging out every time.

1.3k stars Python Coding Assistants
claude-swap
Velocity · 7d
+25
★ / day
Trend
cooling
star history

What it does claude-swap is a credential manager for Claude Code that lets you maintain multiple accounts and hop between them without logging out. It backs up each account’s OAuth tokens and local configuration, then swaps them into place when you switch. It works with both the CLI and the VS Code extension, though you’ll need to restart the extension or close the CLI session for the change to stick.

The interesting bit The tool backs up and swaps the local OAuth tokens and config files that Claude Code reads on startup. On macOS it stores those credentials in the system Keychain; on Windows and Linux they live in files under the backup directory.

Key highlights

  • Rotate to the next account, jump to a specific one by index or email, or browse via an interactive TUI
  • Lists accounts alongside 5-hour and 7-day usage stats and rate-limit reset timers
  • Supports export and import of account bundles as JSON for migration or backup
  • Accepts raw OAuth setup tokens directly, which is handy for headless servers where browser login is impractical

Caveats

  • On Windows and Linux, credentials live in files under the backup directory; only macOS gets Keychain isolation
  • You must restart Claude Code or reopen the VS Code extension tab after every switch
  • Exported backups are plaintext JSON, so you’ll need to pipe them through GPG yourself if you want encryption

Verdict Worth a look if you’re splitting Claude Code usage across work and personal Anthropic accounts. If you only have one login, it’s just another Python tool taking up space.

Frequently asked

What is realiti4/claude-swap?
It stashes and swaps OAuth tokens so you can rotate between Claude Code accounts without logging out every time.
Is claude-swap open source?
Yes — realiti4/claude-swap is open source, released under the MIT license.
What language is claude-swap written in?
realiti4/claude-swap is primarily written in Python.
How popular is claude-swap?
realiti4/claude-swap has 1.3k stars on GitHub and is currently cooling off.
Where can I find claude-swap?
realiti4/claude-swap is on GitHub at https://github.com/realiti4/claude-swap.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.