caam
Coding 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.
What this skill does
# CAAM — Coding Agent Account Manager 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. ## Why This Exists 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: **The Problem:** ``` /login → browser opens → sign out of Google → sign into different Google → authorize app → wait for redirect → back to terminal ``` That's 30-60 seconds of friction, 5+ times per day across multiple tools. **The Solution:** ```bash caam activate claude [email protected] # ~50ms, done ``` No browser. No OAuth dance. No interruption to your flow state. ## How It Works Each AI CLI stores OAuth tokens in plain files. CAAM backs them up and restores them: ``` ~/.claude.json ←→ ~/.local/share/caam/vault/claude/[email protected]/ ~/.codex/auth.json ←→ ~/.local/share/caam/vault/codex/[email protected]/ ``` **That's it.** No daemons, no databases, no network calls. Just `cp` with extra steps. ### Why This Works 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. ### Profile Detection `caam status` uses **content hashing**: 1. SHA-256 hash current auth files 2. Compare against all vault profiles 3. Match = that's what's active This means: - Profiles are detected even if you switched manually - No hidden state files that can desync - Works correctly after reboots ## Quick Start ```bash # Install curl -fsSL "https://raw.githubusercontent.com/Dicklesworthstone/coding_agent_account_manager/main/install.sh?$(date +%s)" | bash # Backup current account caam backup claude [email protected] # Clear and login to another account caam clear claude claude # /login with [email protected] caam backup claude [email protected] # Switch instantly forever caam activate claude [email protected] # < 100ms caam activate claude [email protected] # < 100ms # Check status caam status ``` ## Two Operating Modes ### 1. Vault Profiles (Simple Switching) Swap auth files in place. One account active at a time per tool. Instant switching. ```bash caam backup claude [email protected] caam activate claude [email protected] ``` **Use when:** You want to switch between accounts sequentially (most common). ### 2. Isolated Profiles (Parallel Sessions) Run multiple accounts **simultaneously** with full directory isolation. ```bash caam profile add codex [email protected] caam profile add codex [email protected] caam exec codex [email protected] -- "implement feature X" caam exec codex [email protected] -- "review code" ``` Each profile gets its own `$HOME` and `$CODEX_HOME` with symlinks to your real `.ssh`, `.gitconfig`, etc. **Use when:** You need two accounts running at the same time in different terminals. ## Supported Tools | Tool | Subscription | Auth Files | |------|--------------|------------| | **Claude Code** | Claude Max ($200/mo) | `~/.claude.json`, `~/.config/claude-code/auth.json`, `~/.claude/settings.json` | | **Codex CLI** | GPT Pro ($200/mo) | `~/.codex/auth.json` (or `$CODEX_HOME/auth.json`) | | **Gemini CLI** | Gemini Ultra (~$275/mo) | `~/.gemini/settings.json`, `~/.gemini/oauth_credentials.json`, `~/.gemini/.env` | ### Tool-Specific Details #### Claude Code (Claude Max) - **Login:** `/login` inside CLI - **Rate Limits:** 5-hour rolling usage window - **Notes:** When you hit limits, you'll see rate limit messages. Switch accounts to continue. #### Codex CLI (GPT Pro) - **Login:** `codex login` or `codex login --device-auth` (headless) - **Notes:** Respects `CODEX_HOME`. CAAM enforces file-based auth by writing `cli_auth_credentials_store = "file"` to `~/.codex/config.toml`. #### Gemini CLI (Google One AI Premium) - **Login:** Start `gemini`, select "Login with Google" or use `/auth` to switch modes - **Notes:** OAuth cache stored in `oauth_credentials.json`, API key mode uses `.env`. ## Command Reference ### Auth File Swapping (Primary) | Command | Description | |---------|-------------| | `caam backup <tool> <email>` | Save current auth files to vault | | `caam activate <tool> <email>` | Restore auth files from vault (instant switch) | | `caam status [tool]` | Show which profile is currently active | | `caam ls [tool]` | List all saved profiles in vault | | `caam delete <tool> <email>` | Remove a saved profile | | `caam paths [tool]` | Show auth file locations for each tool | | `caam clear <tool>` | Remove auth files (logout state) | | `caam uninstall` | Restore originals and remove caam data/config | **Aliases:** `caam switch` and `caam use` work like `caam activate` ### Activate Options | Flag | Description | |------|-------------| | `--auto` | Use rotation algorithm to pick best profile | | `--backup-current` | Backup current auth before switching | | `--force` | Activate even if profile is in cooldown | ### Uninstall Options | Flag | Description | |------|-------------| | `--dry-run` | Show what would be restored/removed | | `--keep-backups` | Keep vault after restoring originals | | `--force` | Skip confirmation prompt | ### Smart Profile Management | Command | Description | |---------|-------------| | `caam activate <tool> --auto` | Auto-select best profile using rotation algorithm | | `caam next <tool>` | Preview which profile rotation would select | | `caam run <tool> [-- args]` | Wrap CLI with automatic failover on rate limits | | `caam cooldown set <provider/profile>` | Mark profile as rate-limited (default: 60min) | | `caam cooldown list` | List active cooldowns with remaining time | | `caam cooldown clear <provider/profile>` | Clear cooldown for a profile | | `caam cooldown clear --all` | Clear all active cooldowns | | `caam project set <tool> <profile>` | Associate current directory with a profile | | `caam project get [tool]` | Show project associations for current directory | | `caam tui` | Interactive TUI dashboard | ### Profile Isolation (Advanced) | Command | Description | |---------|-------------| | `caam profile add <tool> <email>` | Create isolated profile directory | | `caam profile ls [tool]` | List isolated profiles | | `caam profile delete <tool> <email>` | Delete isolated profile | | `caam profile status <tool> <email>` | Show isolated profile status | | `caam login <tool> <email>` | Run login flow for isolated profile | | `caam exec <tool> <email> [-- args]` | Run CLI with isolated profile | ## Smart Profile Management When you have multiple accounts across multiple providers, manually tracking which account has headroom becomes tedious. Smart Profile Management automates this decision-making. ### Profile Health Scoring Each profile displays a health indicator: | Icon | Status | Meaning | |------|--------|---------| | 🟢 | Healthy | Token valid for >1 hour, no recent errors | | 🟡 | Warning | Token expiring within 1 hour, or minor issues | | 🔴 | Critical | Token expired, or repeated errors in last hour | | ⚪ | Unknown | No health data available yet | Health scoring combines: - **Token expiry**: Time until OAuth token expires - **Error history**: Recent authentication or rate limit errors - **Penalty score**: Accumulated issues with **exponential decay** (20% reduction every 5 minutes) - **Plan type**: Enterprise/Pro plans get slight scoring boosts After ~30 minutes of no errors, penalty score returns to near zero. ### Proactive Token Refresh CAAM automatically refreshes OAuth tokens before they expire, preventing mid-session auth failures. ### Smart Rotation Algorithms When you run `caam activate claude --auto`: | Algorithm | Description | |-----------|-------------| | **smart** (default) | Multi-factor: cooldown state, health, recency (avoids last 30min), plan typ
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.