Automatically uses the correct Claude and Codex account for every project.
You never have to remember to switch AI accounts again.
AgentWho is an independent open-source project and is not affiliated with Anthropic or OpenAI.
Install with Homebrew:
brew install irangarcia/tap/agentwho
agentwho init$ cd ~/code/side-project
$ agentwho current
personal
$ claude
$ cd ~/work/acme/backend
$ agentwho current
work
$ codexagentwho current is shown only to make the automatic selection visible. In daily use, you change directories and run the original claude or codex command—there is no account-switching step to remember.
Credentials remain fully managed by the official Claude and Codex CLIs. AgentWho never reads, copies, migrates, or displays them.
Claude Code and Codex CLI each keep a signed-in account on your computer. If you work across personal and company projects, it is easy to open the right repository with the wrong account.
That mistake works both ways:
- company source code can be sent through a personal AI account;
- personal source code can be exposed to a company-managed AI account.
Remembering to switch manually is unreliable. AgentWho binds an account identity to a repository, organization, or directory tree and applies it automatically whenever you run Claude or Codex there.
AgentWho calls each isolated account setup a profile. A profile groups the Claude and Codex accounts—and their user-level state—for one identity such as personal or work. In the CLI and documentation, profile means this complete setup; account means the actual Claude or Codex sign-in.
AgentWho:
- identifies the current repository or directory;
- resolves which personal or work profile the project expects;
- protects against conflicting explicit selections;
- launches the official Claude or Codex CLI with that profile's isolated account state.
The real Claude and Codex executables are never replaced. See Architecture for shim installation, executable discovery, recursion prevention, environment isolation, and process behavior.
Because an AgentWho profile is a complete account setup, it separates each CLI's full user-level state, not only its sign-in.
- Separate for each profile: credentials, user settings, user-level MCP configuration, plugins or skills, session history, logs, and caches.
- Still shared: the current repository and agent configuration stored inside that repository.
- Left untouched: existing Claude and Codex data outside AgentWho's profile directories.
A new profile therefore starts without the user-level customizations from another profile. Sign in and configure the plugins, skills, MCP servers, and settings that identity needs. AgentWho never copies or deletes existing agent data; it only tells the official CLI which profile directory to use. See Configuration for details.
brew install irangarcia/tap/agentwho
agentwho initgo install github.com/irangarcia/agentwho/cmd/agentwho@latest
agentwho initIf agentwho is not found after installation, add $(go env GOPATH)/bin to your PATH.
git clone https://github.com/irangarcia/agentwho.git
cd agentwho
make test
make install
exec "$SHELL" -l
agentwho initmake install uses ~/.local/bin by default. It asks before changing a shell file and creates a backup first. Set PREFIX to install elsewhere:
make install PREFIX=/usr/local- macOS or Linux;
- zsh, bash, or fish;
- Go 1.22 or newer when installing from source;
- the official Claude Code and/or Codex CLI installed separately.
AgentWho does not install Claude Code or Codex CLI.
Run the interactive onboarding:
agentwho initUsing arrow-key menus, AgentWho will:
- create
personalandworkprofiles; - ask which profile should be the default;
- explain profile mismatches and let you choose
blockorconfirm; - protect the normal
claudeandcodexcommands automatically; - offer backed-up shell setup when needed.
Terminal command protection is installed automatically because transparent routing is AgentWho’s core feature. If your shell still needs setup, AgentWho asks before updating the shell file and creates a backup first. If you decline the file change, it prints the exact manual setup line instead.
You can repair or reinstall terminal routing later with:
agentwho install --modify-shellThen verify everything:
agentwho doctor
agentwho statusOnboarding creates both personal and work. Sign in to the Claude and Codex accounts for each profile you use:
agentwho profile login personal claude
agentwho profile login personal codex
agentwho profile login work claude
agentwho profile login work codex
agentwho profile listSign in independently for every profile and agent you use. profile list obtains sign-in status only by asking the official CLIs; one missing or signed-out agent does not break the list.
You can create additional named profiles later with agentwho profile add <name> --kind personal|work.
The easiest approach is the interactive picker:
cd ~/work/acme/backend
agentwho bind workAgentWho asks whether the profile should apply to this repository, its organization, or the current directory tree. It also asks for a safety mode, with your configured default preselected.
For a direct, non-interactive binding, choose the scope with a flag.
agentwho bind work --repo--repo binds the normalized origin remote of the current Git repository, such as github.com/acme/backend. It follows that repository across local clones and paths. If there is no usable origin, use a directory binding instead.
agentwho bind work --organizationFor git@github.com:acme/backend.git, this applies to every repository in github.com/acme.
agentwho bind personal --path ~/projects/personalBindings use your default safety mode unless you override it:
agentwho bind work --repo --safety-mode blockA binding changes the profile AgentWho automatically expects in that context. It does not manually switch every other terminal or project.
Resolution is deterministic: exact repository, organization, longest directory match, then default. See Configuration for normalization, precedence, and the complete schema.
Bindings can use either safety mode:
- block — never launch Claude or Codex when the current profile conflicts with the expected profile;
- confirm — explain the account risk and offer to use the expected profile, continue once, or cancel.
Confirmation defaults to the expected profile. Non-interactive confirmation refuses execution.
Most of the time, bindings should choose automatically. When you intentionally want another profile in the current shell:
agentwho use personalThe terminal prompt and agentwho status update immediately. Return to repository-based selection with:
agentwho use --autoShell selections still go through mismatch protection. AGENTWHO_FORCE=1 exists only as a visible emergency bypass and requires additional confirmation; see Configuration.
agentwho status
agentwho currentstatus explains the current directory, matched binding, expected profile, current profile, safety mode, and command integration. current is the stable minimal interface for scripts and prints only the profile name.
JSON is available where useful:
agentwho status --json
agentwho current --json
agentwho rules --json
agentwho profile list --json
agentwho prompt --jsonAgentWho can add [agent:work] to your existing prompt without replacing it:
agentwho prompt
# [agent:work]A conflicting explicit profile prints [agent:personal!].
# zsh
setopt PROMPT_SUBST
PROMPT='$(agentwho prompt --plain) '"$PROMPT"
# bash
PS1='$(agentwho prompt --plain) '"$PS1"The prompt command is local and fast: no network, agent, or authentication calls.
agentwho help
agentwho <command> --helpSee the documentation index for architecture, configuration, editor behavior, limitations, and troubleshooting.
No. AgentWho never reads or parses credential files. The official Claude and Codex CLIs perform login and status checks inside isolated directories owned by each AgentWho profile.
Yes in the integrated terminal when AgentWho shell integration is active. Graphical Claude or Codex extension panels are not protected in this version because they may bypass terminal commands. See VS Code integration.
No. AgentWho places its own reversible commands in its own data directory. It never renames, moves, overwrites, or deletes the official executables. See Architecture.
Run:
agentwho doctorDoctor checks configuration, permissions, account directories, command integration, PATH order, official CLI discovery, recursion risks, shell setup, and sign-in status. Every failure includes a suggested fix.
If integration is installed but not active in the current zsh session:
eval "$(agentwho shell init zsh)"See VS Code integration for editor-terminal checks and Known limitations for current scope.
Disable automatic account selection while retaining all profiles and sign-ins:
agentwho uninstallAlso remove the backed-up, clearly delimited shell block:
agentwho uninstall --remove-shellPermanently remove AgentWho configuration, profile directories, and the official CLI sign-ins stored inside them:
agentwho uninstall --purge--purge requires typing purge. It never removes the official Claude or Codex applications.
See CONTRIBUTING.md for development setup, tests, package layout, and pull-request guidance.
Security vulnerabilities should be reported privately by following SECURITY.md. Never include credentials, tokens, or private source code in a report.
AgentWho is available under the MIT License.



