Codex CLI with two ChatGPT accounts

OpenAI's Codex keeps its login, config and sessions in ~/.codex. CODEX_HOME points it at another folder, so a second ChatGPT account is a second home: ~/.codex-work, signed in once there. Hatcheck adds cx to run Codex with a home, and lists every home's sessions and limits beside Claude Code's profiles.

The variable itself

mkdir -p ~/.codex-work
CODEX_HOME=~/.codex-work codex login         # sign that home in, once
CODEX_HOME=~/.codex-work codex               # Codex with that account

Codex won't start with a CODEX_HOME that doesn't exist, hence the mkdir. A new home starts without your ~/.codex/config.toml, which holds the model, trusted folders and MCP servers; copy it over if you want the same settings.

With hatcheck

Install the CLI, and cx does the above, making the folder on first use:

cx work login               # sign in once, with that account
cx work                     # Codex with ~/.codex-work
cx work resume <id>         # one of that home's sessions
cx home exec "run the tests" # any codex command works
cd ~/code/api
hatcheck bind work          # here, plain cx means cx work, and cl means cl work
hatcheck                    # the sessions here from every home and profile, with the command that resumes each

hatcheck usage shows each home's ChatGPT plan limits beside the Claude accounts': the 5-hour and weekly windows, and limits for single models. The access token Codex saved in the home is sent as it is to the endpoint Codex's own /status asks, and never refreshed; once it has expired, the newest limits Codex recorded in that home's session files are shown instead, with their age. hatcheck move carries a session between Codex homes, or converts it for Claude Code and the other agents, and back.

What hatcheck never does

It never asks for, copies, refreshes or moves a login: cx work login is Codex's own sign-in, in your terminal. It is never between Codex and OpenAI, runs nothing in the background, and switches no account on its own. Each rule, with the code that keeps it: rules it keeps. The Codex app, like Claude Desktop, keeps one login; hatcheck makes instances for Claude Desktop only, so far.