Download

How to run several Codex accounts side by side

Codex keeps its settings and history in one folder, normally ~/.codex. The setting CODEX_HOME moves it. One folder per account keeps them apart. OpenAI lists it in its documentation.

Windows

The folder must exist first. Open PowerShell and run:

New-Item -ItemType Directory -Force "$HOME\.codex-work"
$env:CODEX_HOME = "$HOME\.codex-work"
codex login
codex

The setting only counts for that window.

Mac and Linux

mkdir -p ~/.codex-work
CODEX_HOME=~/.codex-work codex login
CODEX_HOME=~/.codex-work codex

To save typing, add this line to ~/.zshrc or ~/.bashrc:

alias codex-work='CODEX_HOME=~/.codex-work codex'

Check which sign-in is used

codex login status

Run it in the window, or with the same CODEX_HOME, that you want to check. Codex may save your sign-in as a plain file called auth.json in that folder. Treat it like a password.

The same without typing commands

AI Account Hub opens each Codex account in its own terminal with its own folder. Claude Code and Gemini CLI accounts sit next to it.

Claude Code and Codex working on the same question
AI Account Hub with sample content.

Is this allowed?

A work and a personal account are common. Check OpenAI's terms for your accounts, and don't use extra accounts to get around limits.

Try AI Account Hub. Free while in beta, for Windows, Mac and Linux.

Download

More guides