@deharo/hydra
v0.1.49
Published
Fast account switcher for Claude Code and Codex
Readme
Hydra
Fast account switcher for Claude Code and Codex.
How Claude Accounts Work
Hydra supports multiple Claude Code accounts by keeping one local profile per account under ~/.hydra/profiles/....
- Hydra owns the profile list and account switching.
- Claude Code still owns the real session lifecycle for each profile.
- Usage percentages in the selector are fetched from Anthropic's OAuth usage endpoint with the token stored in that profile.
Claude Usage Auto Refresh
When Hydra renders the selector or runs hydra ls, it tries to read usage directly from the saved Claude profile.
- If the saved token still works, usage is shown immediately.
- If Anthropic returns
401, Hydra silently starts Claude Code with that specific profile, lets Claude refresh the session, rereads the profile credentials, and retries the usage request once. - Hydra stops that silent Claude process as soon as it detects the profile credentials changed, so it does not keep a full Claude session alive longer than needed.
This is why usage can now recover without manually entering and exiting every Claude account.
If usage still stays unavailable after the retry, Hydra leaves the account without percentages until the profile is reauthenticated normally.
