vesha वेष
account switcher

vesha

वेष · “guise”

Every Claude Code account, one key away: switch from anywhere, and switch by itself at the limit.

वासांसि जीर्णानि यथा विहाय नवानि गृह्णाति नरोऽपराणि ।
तथा शरीराणि विहाय जीर्णान्यन्यानि संयाति नवानि देही ॥

As one puts off worn clothes and takes others that are new, so the one within moves on to new bodies. Bhagavad Gītā 2.22
v0.6.0 latest16 releases12 decisions recordedMIT license

Vesha (वेष) is Sanskrit for "guise, attire": the same Claude, wearing whichever account you choose.

You have more than one Claude subscription: a personal one, a work one, maybe a client's. Claude Code signs in to one at a time, and when its 5-hour limit runs out mid-task you sign out, sign in to the other, and lose your flow. vesha keeps every account signed in at once, each in its own Claude Code profile, and decides which one a new claude starts with. Switch with one key in the switcher or vesha switch; when the active account reaches its limit, vesha switches to the one with the most room left and tells you.

The switcher: tabs for accounts and folder rules on top; four accounts on the left with email, plan, 5-hour and weekly usage; the selected account's overview on the right with usage and reset times, login, profile, folders and what you can do

#Features

#Install

With kosha:

kosha install vesha

Or with the installer, which clones vesha into ~/.local/share/vesha and links ~/.local/bin/vesha (no root):

curl -fsSL https://raw.githubusercontent.com/Theyashsawarkar/vesha/main/install.sh | bash

Or by hand:

git clone https://github.com/Theyashsawarkar/vesha ~/.local/share/vesha
ln -s ~/.local/share/vesha/bin/vesha ~/.local/bin/vesha

Requirements: Linux, Python 3.11+, Claude Code signed in with a Claude subscription (Pro, Max, Team or Enterprise). Optional: notify-send for notifications, wl-copy to copy an email from the switcher, systemd for the background watcher.

#Getting started

vesha add personal --current   # the account Claude Code is already signed in to
vesha add work                 # signs in another account (opens Claude Code's sign-in)
vesha install-shim             # plain `claude` now follows the active account
vesha service install          # the watcher: warns near limits, switches at them
eval "$(vesha init zsh)"       # in ~/.zshrc: `vesha use` and tab completion (or bash)
vesha doctor                   # checks all of it

Then vesha opens the switcher, and vesha switch work or vesha switch (the next account that isn't paused) switches from the command line.

vesha usage lists every account's 5-hour and weekly usage with bars and reset times; vesha which says the account a new claude would use here, and why; vesha switch work makes work the active account

#The switcher

vesha on its own opens it, laid out like sangam: tabs for accounts and folder rules on top, with the account a new claude would use here; the accounts on the left with both limits; the selected account's overview on the right (usage with reset times, login, profile, folders, and what you can do with it). Marks in the list: ● active, ‖ paused, ! login changed.

It opens in normal mode: keys are commands and typing changes nothing. The search, rename and add prompts are insert mode (Esc goes back). Space is the leader: press it and a strip shows what can follow. The keys follow the grammar every Vayu tool shares (Space t tabs, Space y copy, Space a add, Space d delete, Space o open, Space g go to, Space m mark, Space Space every action).

KeyDoes
j / kMove down / up (counts work: 3j)
gg / GFirst / last account (5G: the fifth)
Ctrl+d / Ctrl+uHalf a page down / up
H / LThe accounts / folder rules tab (Space t a / Space t f)
EnterSwitch to the account
oRun claude as the account, in this folder, just this once (Space o t)
rRefresh usage now (Space r)
pPause / resume, out of automatic switching (Space m p)
mThis folder always uses the account (Space m f)
Space a aSign in a new account, right here (see below)
cwRename the account (Space e n)
ddRemove the account, or the folder rule (asks: y says yes; Space d d)
yyCopy the account's email (Space y e)
/, n / NSearch; next / previous match (Space f f)
Space g aJump to the active account
Space SpaceThe palette: every action, filtered as you type
?Every key (Space ?)
q / EscQuit (Space q)

Moved in v0.4.0: running claude is o (was r), refreshing usage is r (was u, which now says where it went), tabs are H / L (h, l and Tab still work), copying is yy (was y), adding is Space a a (a still works), and a number alone no longer jumps to an account: it's a count (3G, 3gg).

#Signing in a new account

Press Space a a, give the account a name and (optionally) its email. A tab opens in your browser on Anthropic's sign-in page with the email filled in; enter the code Anthropic emails you there. If the page then shows a code, paste it into vesha and press Enter. The account is added and selected; Enter makes it active. vesha runs Claude Code's own sign-in for the new profile, so it never handles a password.

The code field opens in insert mode, ready for a paste.

KeyDoes
EnterSend the code the sign-in page shows
Ctrl+o / Space o bOpen the sign-in page again
Ctrl+y / Space y lCopy the sign-in link (to open it in another browser)
EscNormal mode; there i types again and q or Esc cancels (the half-made profile is removed)

From a shell: vesha add work2 you@company.com.

Signing in from the switcher: the steps with the current one spinning, a field for the code the page shows, and the keys

The key sheet over the switcher: movement, account actions and other keys in columns

#Commands

Every command has --help with examples; vesha help lists them all.

CommandDoes
veshaThe switcher (without a terminal: the account list)
vesha switch [name]Make an account the active one; no name: the next one that isn't paused (sw, s)
vesha listEvery account: plan, usage, which is active (ls, status)
vesha usageBoth limits of every account, with reset times (u)
vesha whichThe account a new claude would use here, and why (w)
vesha run <name> [-- cmd …]Run claude (or any command) as an account, once (r)
vesha use <name>This terminal only (needs the shell hook)
vesha auto on|offAutomatic switching at the limit
vesha pause <name> / resumeKeep an account out of automatic switching
vesha add <name> [email] [--current]Sign in a new account (browser, email filled in), or adopt the current one (login signs in again)
vesha repairFix profiles whose login another tool replaced (fix)
vesha remove <name>Forget an account and delete its profile (rm)
vesha rename <old> <new>Rename an account (mv)
vesha import cswapBring your claude-swap accounts across
vesha map <name> [folder] / unmapOptional folder rules
vesha install-shim / uninstall-shimThe claude wrapper
vesha service install|remove|statusThe background watcher (systemd user unit)
vesha init zsh|bashThe shell hook for vesha use and completion
vesha doctorCheck every account, the wrapper and the watcher (check)
vesha waybarJSON for a waybar module

Options: -y don't ask, --json (list, usage, which), --no-color (also NO_COLOR=1), -h, -V.

#Automatic switching

vesha service install starts vesha.service, a systemd user unit that watches the active account's 5-hour and weekly usage, and points Claude Code's status line at vesha feed (whatever status line you had still shows: vesha prints it after taking what it needs):

Where the numbers come from. After every reply Claude Code hands its status line the limits it got back from the API; vesha feed keeps them as that account's usage and wakes the watcher the moment they near a limit. So the watcher sees each message's usage as it happens, with no request of its own. Claude Code's usage endpoint is asked only for numbers the status line can't give (an account no session is using) or that are older than a few minutes, and when it answers 429 vesha backs off (1, 2, 4 ... up to 15 minutes) instead of asking again. Old numbers still count: usage only grows inside a window, so a last known 100% that hasn't reset yet still switches.

"Most room" means the lowest of each account's worse window (a 5-hour limit at 20% doesn't help if the week is at 95%); a window whose reset time has passed counts as empty. Paused accounts and accounts near their own limit are never picked. vesha auto off keeps the warnings and stops the switching; the log is ~/.local/state/vesha/watch.log.

#Which account a new claude uses

In this order, first match wins:

  1. VESHA_ACCOUNT in the environment: vesha use and vesha run set it for one terminal or one command.
  2. A folder rule (vesha map): the closest rule above the current folder.
  3. The active account: the one vesha switch (and the watcher) set.

vesha which prints the answer and the reason for the current folder. Folder rules are optional; without any, every folder follows the active account.

#Configuration

~/.config/vesha/config.toml (every key optional):

warn_at = 85         # notify at this % of either limit
switch_at = 95       # switch the active account at this %
auto = true          # switch automatically (else only notify)
share_history = true # every account shares conversations, todos, plans
usage_ttl = 180      # seconds to reuse fetched usage
check_every = 120    # seconds between the watcher's checks

#Integrations

tmux: a popup on a key:

bind -N "Switch Claude Code account (vesha)" C display-popup -E -w 80% -h 70% vesha

waybar: the active account and its 5-hour usage, every account in the tooltip; click for the switcher, scroll to switch. vesha waybar keeps running and redraws the moment the account changes (vesha waybar --once prints one line and exits, for a bar that starts later):

"custom/vesha": {
  "exec": "vesha waybar",
  "return-type": "json",
  "on-click": "kitty --class vesha -e vesha",
  "on-scroll-up": "vesha switch",
  "on-scroll-down": "vesha switch"
}

The JSON's class is ok, warn, full or unknown for styling. It hides itself with fewer than two accounts.

Scripts: vesha list --json, vesha usage --json and vesha which --json; exit codes are 0 (fine), 1 (failed) and 2 (bad usage).

#How it works

#Coming from claude-swap

vesha import cswap      # every claude-swap account, with its login
vesha list              # check them; rename with: vesha rename <old> <new>

The account signed in to ~/.claude becomes vesha's main account; the others get their own profiles. Once vesha works for you, remove claude-swap (uv tool uninstall claude-swap or however you installed it): switching with both would fight over ~/.claude.

#Troubleshooting

Start with vesha doctor: it checks Claude Code, the wrapper, the watcher and every login, and prints the command that fixes each problem.

#Contributing

Issues and pull requests are welcome: see CONTRIBUTING.md. Design decisions are recorded in docs/adr. Security issues: SECURITY.md.

#License

MIT. Not affiliated with Anthropic; Claude and Claude Code are Anthropic's.