$npx -y skills add Dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations --skill caamCoding Agent Account Manager - Sub-100ms account switching for AI coding CLIs with fixed-cost subscriptions. Vault profiles, isolated profiles for parallel sessions, smart rotation with health scoring, cooldown tracking, automatic failover, TUI dashboard. Go CLI.
| 1 | # CAAM — Coding Agent Account Manager |
| 2 | |
| 3 | A Go CLI for instant account switching between fixed-cost AI coding subscriptions (Claude Max, GPT Pro, Gemini Ultra). When you hit rate limits, swap accounts in ~50ms instead of 30-60 seconds of browser OAuth friction. |
| 4 | |
| 5 | ## Why This Exists |
| 6 | |
| 7 | You're paying $200-275/month for fixed-cost AI coding subscriptions. These plans have rolling usage limits—not billing caps, but rate limits that reset over time. When you hit them mid-flow: |
| 8 | |
| 9 | **The Problem:** |
| 10 | ``` |
| 11 | /login → browser opens → sign out of Google → sign into different Google → |
| 12 | authorize app → wait for redirect → back to terminal |
| 13 | ``` |
| 14 | That's 30-60 seconds of friction, 5+ times per day across multiple tools. |
| 15 | |
| 16 | **The Solution:** |
| 17 | ```bash |
| 18 | caam activate claude bob@gmail.com # ~50ms, done |
| 19 | ``` |
| 20 | |
| 21 | No browser. No OAuth dance. No interruption to your flow state. |
| 22 | |
| 23 | ## How It Works |
| 24 | |
| 25 | Each AI CLI stores OAuth tokens in plain files. CAAM backs them up and restores them: |
| 26 | |
| 27 | ``` |
| 28 | ~/.claude.json ←→ ~/.local/share/caam/vault/claude/alice@gmail.com/ |
| 29 | ~/.codex/auth.json ←→ ~/.local/share/caam/vault/codex/work@company.com/ |
| 30 | ``` |
| 31 | |
| 32 | **That's it.** No daemons, no databases, no network calls. Just `cp` with extra steps. |
| 33 | |
| 34 | ### Why This Works |
| 35 | |
| 36 | OAuth tokens are bearer tokens—possession equals access. The CLI tools don't fingerprint your machine beyond what's already in the token file. Swapping files is equivalent to "being" that authenticated session. |
| 37 | |
| 38 | ### Profile Detection |
| 39 | |
| 40 | `caam status` uses **content hashing**: |
| 41 | 1. SHA-256 hash current auth files |
| 42 | 2. Compare against all vault profiles |
| 43 | 3. Match = that's what's active |
| 44 | |
| 45 | This means: |
| 46 | - Profiles are detected even if you switched manually |
| 47 | - No hidden state files that can desync |
| 48 | - Works correctly after reboots |
| 49 | |
| 50 | ## Quick Start |
| 51 | |
| 52 | ```bash |
| 53 | # Install |
| 54 | curl -fsSL "https://raw.githubusercontent.com/Dicklesworthstone/coding_agent_account_manager/main/install.sh?$(date +%s)" | bash |
| 55 | |
| 56 | # Backup current account |
| 57 | caam backup claude alice@gmail.com |
| 58 | |
| 59 | # Clear and login to another account |
| 60 | caam clear claude |
| 61 | claude # /login with bob@gmail.com |
| 62 | caam backup claude bob@gmail.com |
| 63 | |
| 64 | # Switch instantly forever |
| 65 | caam activate claude alice@gmail.com # < 100ms |
| 66 | caam activate claude bob@gmail.com # < 100ms |
| 67 | |
| 68 | # Check status |
| 69 | caam status |
| 70 | ``` |
| 71 | |
| 72 | ## Two Operating Modes |
| 73 | |
| 74 | ### 1. Vault Profiles (Simple Switching) |
| 75 | |
| 76 | Swap auth files in place. One account active at a time per tool. Instant switching. |
| 77 | |
| 78 | ```bash |
| 79 | caam backup claude work@company.com |
| 80 | caam activate claude personal@gmail.com |
| 81 | ``` |
| 82 | |
| 83 | **Use when:** You want to switch between accounts sequentially (most common). |
| 84 | |
| 85 | ### 2. Isolated Profiles (Parallel Sessions) |
| 86 | |
| 87 | Run multiple accounts **simultaneously** with full directory isolation. |
| 88 | |
| 89 | ```bash |
| 90 | caam profile add codex work@company.com |
| 91 | caam profile add codex personal@gmail.com |
| 92 | caam exec codex work@company.com -- "implement feature X" |
| 93 | caam exec codex personal@gmail.com -- "review code" |
| 94 | ``` |
| 95 | |
| 96 | Each profile gets its own `$HOME` and `$CODEX_HOME` with symlinks to your real `.ssh`, `.gitconfig`, etc. |
| 97 | |
| 98 | **Use when:** You need two accounts running at the same time in different terminals. |
| 99 | |
| 100 | ## Supported Tools |
| 101 | |
| 102 | | Tool | Subscription | Auth Files | |
| 103 | |------|--------------|------------| |
| 104 | | **Claude Code** | Claude Max ($200/mo) | `~/.claude.json`, `~/.config/claude-code/auth.json`, `~/.claude/settings.json` | |
| 105 | | **Codex CLI** | GPT Pro ($200/mo) | `~/.codex/auth.json` (or `$CODEX_HOME/auth.json`) | |
| 106 | | **Gemini CLI** | Gemini Ultra (~$275/mo) | `~/.gemini/settings.json`, `~/.gemini/oauth_credentials.json`, `~/.gemini/.env` | |
| 107 | |
| 108 | ### Tool-Specific Details |
| 109 | |
| 110 | #### Claude Code (Claude Max) |
| 111 | - **Login:** `/login` inside CLI |
| 112 | - **Rate Limits:** 5-hour rolling usage window |
| 113 | - **Notes:** When you hit limits, you'll see rate limit messages. Switch accounts to continue. |
| 114 | |
| 115 | #### Codex CLI (GPT Pro) |
| 116 | - **Login:** `codex login` or `codex login --device-auth` (headless) |
| 117 | - **Notes:** Respects `CODEX_HOME`. CAAM enforces file-based auth by writing `cli_auth_credentials_store = "file"` to `~/.codex/config.toml`. |
| 118 | |
| 119 | #### Gemini CLI (Google One AI Premium) |
| 120 | - **Login:** Start `gemini`, select "Login with Google" or use `/auth` to switch modes |
| 121 | - **Notes:** OAuth cache stored in `oauth_credentials.json`, API key mode uses `.env`. |
| 122 | |
| 123 | ## Command Reference |
| 124 | |
| 125 | ### Auth File Swapping (Primary) |
| 126 | |
| 127 | | Command | Description | |
| 128 | |---------|-------------| |
| 129 | | `caam backup <tool> <email>` | Save current auth files to vault | |
| 130 | | `caam activate <tool> <email>` | Restore auth files from vault (instant switch) | |
| 131 | | `caam status [tool]` | Show which profile is currently active | |
| 132 | | `caam ls [tool]` | List all saved profiles in vault | |
| 133 | | `caam delete <tool> <email>` | Remove a saved profile | |
| 134 | | `caam paths [tool]` | Show auth file locations for each tool | |
| 135 | | ` |