codex-isolate is an isolated-home launcher for Codex with multi-account support.
It keeps the original codex command and ~/.codex home untouched, while managing additional isolates under ~/.codex-isolate/isolates/<name>.
codex-isolate is for people who want to:
- keep the original
codexworkflow unchanged - sign in to more than one Codex account on the same machine
- launch separate Codex isolate homes in parallel
- install optional shell wrappers such as
codex2without overridingcodex
This project is a launcher and isolate manager. It is not a Codex plugin, and it does not patch the original Codex executable.
- Node.js
>=22 - An existing
codexinstallation available inPATH - A default Codex home at
~/.codex
npm install -g @captain-pam/codex-isolateInstall from the local source tree:
cd /path/to/codex-isolate
npm install
npm run build
npm install -g .codexstays the original command~/.codexstays the original Codex homecodex-isolateonly manages extra isolates such ascodex2,codex3, or custom names likework- managed isolates live under
~/.codex-isolate/isolates/<name> - stable configuration is linked from
~/.codex - login state, sessions, history, and runtime files stay isolated per managed isolate
flowchart LR
User[User] --> CLI["codex-isolate run work"]
CLI -->|spawns| Codex["original codex"]
Codex -->|CODEX_HOME| Isolate["~/.codex-isolate/isolates/work"]
Source["~/.codex"] -->|shared symlinks| Shared["skills
superpowers
config.toml
AGENTS.md"]
Shared -. mounted into .-> Isolate
Isolate --> State["auth.json
accounts/
sessions/
history.jsonl
log/
state_*.sqlite"]
Source --> Unchanged["default codex setup stays unchanged"]
The launcher only redirects CODEX_HOME for the selected isolate. Shared configuration is linked from ~/.codex, while login state and runtime data remain isolated per managed home.
Create the next managed isolate:
codex-isolate isolate addCreate a named isolate:
codex-isolate isolate add workLog into that isolate:
codex-isolate login codex2 --device-authRun Codex with that isolate:
codex-isolate run codex2
codex-isolate run work -- --full-autoList and inspect local isolate status:
codex-isolate isolate list
codex-isolate isolate show work
codex-isolate doctorRemove a managed isolate:
codex-isolate isolate remove workcodex-isolate isolate add [name]Create a managed isolate. Auto-generated names start atcodex2.codex-isolate isolate listShow all managed isolates and whether they are logged in or shell-enabled.codex-isolate isolate show <name>Show one isolate in detail.codex-isolate isolate remove <name>Remove one managed isolate.codex-isolate login <name> [--device-auth]Runcodex logininside the selected managed isolate home.codex-isolate run <name> [-- <codex args...>]Launch the originalcodexwithCODEX_HOMEredirected to the selected isolate.codex-isolate install-shellInstall wrapper functions for the currentbashorzshshell.codex-isolate uninstall-shellRemove only the wrapper block added bycodex-isolate.codex-isolate doctorCheck whethercodexis available, shared source files exist, and isolate links are intact.
Install shell wrappers for the current bash or zsh shell:
codex-isolate install-shell
source ~/.bashrcFor zsh:
codex-isolate install-shell
source ~/.zshrcAfter installation, managed isolate names can be called directly:
codex2
work-team --full-autoAfter installing shell wrappers, managed isolate names such as codex2 or work-team can be called directly. The original codex command is never overridden.
Shared from ~/.codex into each managed isolate:
skillssuperpowersconfig.tomlAGENTS.md
Isolated per managed isolate:
auth.jsonaccounts/sessions/history.jsonllog/- runtime SQLite state
codex
codex-isolate isolate add
codex-isolate login codex2 --device-auth
codex-isolate run codex2
codex-isolate install-shell
source ~/.bashrc
codex2codex-isolatenever replaces the originalcodexexecutablecodex-isolatenever takes ownership of~/.codex- shell integration only adds managed isolate wrappers
- removing one managed isolate does not modify the default Codex home
npm install
npm test
npm run build