vesha वेष

Architecture decisions

Why vesha is built the way it is: each significant decision as a short record (context, the decision, its consequences), in the ADR format. A decision is never edited away: a later one supersedes it. Sources: docs/adr.

ADR 0001 · Accepted

Record architecture decisions

Decisions about how vesha is built (its dependencies, its boundaries, the trade-offs it accepts) were made in conversations and commit messages, where nobody finds them later. A co…

ADR 0002 · Accepted (where profiles live: amended by [ADR 8](0008-data-in-the-state-folder.md))

One Claude Code profile per account

Claude Code keeps one login in its config folder (~/.claude). Tools like claude-swap switch accounts by saving that login away and writing another one in its place. That makes swit…

ADR 0003 · Accepted

Never copy a login

Claude Code's OAuth refresh tokens rotate: each refresh returns a new refresh token and invalidates the old one. If the same login existed in two places (a backup, a snapshot, a se…

ADR 0004 · Accepted

One setup and one history for every account

With a profile per account (ADR 2), each profile would have its own CLAUDE.md, settings, hooks, skills, plugins and agents, and its own conversation history. Keeping several copies…

ADR 0005 · Accepted; for the active account, superseded by [ADR 9](0009-switch-by-moving-logins.md)

A `claude` wrapper decides the account

Switching has to work "from anywhere, for any project": in every terminal, editor and script that runs claude, including ones already open. Exporting CLAUDE_CONFIG_DIR from a shell…

ADR 0006 · Accepted

A watcher switches at the limit

The point of several accounts is to keep working when one runs out. Checking usage by hand and switching just before the limit is exactly the interruption vesha should remove; but …

ADR 0007 · Accepted

Standard library only, curses for the switcher

vesha's wrapper runs before every claude, and its watcher runs all the time; both must start fast and never break because a dependency changed. The switcher needs vim-style navigat…

ADR 0008 · Accepted

Accounts and profiles live in the state folder

v0.1.0 kept accounts and profiles in ~/.local/share/vesha. That is also where installers put vesha itself: kosha installs every app into ~/.local/share/<name>, and vesha's own inst…

ADR 0009 · Accepted

Switching moves logins into ~/.claude

Until v0.2, switching only changed which profile the next claude started with: the wrapper set CLAUDE_CONFIG_DIR. Sessions already running kept their account. But the moment you sw…

ADR 0010 · Accepted

The switcher speaks the Space grammar

The switcher had vim-flavoured keys of its own: r ran claude (in every other Vayu tool r refreshes), u refreshed (vim's undo), h/l switched tabs, and a number alone jumped to an ac…

ADR 0011 · Accepted (refines 6)

Live usage from the status line

The watcher (ADR 6) read usage only from Claude Code's usage endpoint and ignored numbers it couldn't refresh. That endpoint rate-limits hard: with the watcher asking for every acc…

ADR 0012 · Accepted (refines 6)

When every account is full, be on the one that frees up first

ADR 6 left the case where every account is at its limit alone: the watcher said when the first one resets and stayed on the active account. But the accounts don't reset together. S…