How mcpysup-netizen/claude-ai-accounts works
claude-ai-accounts lets engineers select separate Claude Code and Codex subscription accounts per session, inspect shared usage limits, and switch accounts without repeatedly logging in. The main workflow is account selection at launch, followed by limit collection and status display; the plugin adds in-session switching, including resuming Claude in the same tmux pane. The README documents account setup, shared settings with isolated authentication, Codex companion routing, and usage reporting. Source excerpts establish the usage and switching paths; other CLI account-management details are documented but unsampled.
Main entry points: ai_usage_lib.py Usage service · register.tsx Plugin controls · ai Account CLI · ai_usage_line.py Usage recorder
Components 14
Account launch
- Account CLI
bin/ai - Claude sessions
- Codex sessions
- Pane swap
bin/ai_swap.py
Usage reporting
- Claude status input
- Usage recorder
bin/ai_usage_line.py - Usage service
bin/ai_usage_lib.py - Codex app-server
- Codex run history
- Statusline display
statusline/ai-statusline.sh
Session plugin
- Plugin controls
mod/hooks/register.tsx
Account state
- Account registry
- Usage cache
Other components
- Engineer
Connections 16
- Engineer → Account CLI: select account
README.md - Account CLI → Claude sessions: launches
README.md - Account CLI → Codex sessions: launches
README.md - Plugin controls → Account CLI: reads accounts
mod/hooks/register.tsx - Plugin controls → Pane swap: requests switch
mod/hooks/register.tsx - Pane swap → Claude sessions: resumes session
bin/ai_swap.py - Plugin controls → Codex sessions: sets session account
README.md - Claude status input → Usage recorder: records limits
README.md - Usage recorder → Usage service: records usage
bin/ai_usage_line.py - Usage service → Codex app-server: queries limits
bin/ai_usage_lib.py - Usage service → Codex run history: reads fallback
bin/ai_usage_lib.py - Usage service → Account registry: reads accounts
bin/ai_usage_lib.py - Usage service → Usage cache: reads and writes
bin/ai_usage_lib.py - Plugin controls → Usage service: requests snapshot
mod/hooks/register.tsx - Statusline display → Usage recorder: records limits
- Engineer → Statusline display: views usage