Codex Multi-Account

Two Codex accounts.
One AgentsRoom. Zero shell tricks.

Run a personal Codex CLI login on one project and a work login on another, in the same window, at the same time. Pin one Codex account per project. Override per agent when you need to. Sign in directly from the Settings panel, no CODEX_HOME exports, no extra tool to install.

AgentsRoom Multiple Accounts panel in Settings showing Claude and Codex tabs, with a Codex Work account and a Codex Personal account, including sign-in status badges

The Multiple Accounts panel in Settings, unified for Claude and Codex. Pick a Codex account per project and per agent.

Why use several Codex accounts

Real reasons developers run more than one Codex account, in plain words.

Keep work and personal cleanly separated

Your employer's Codex account stays on the work projects. Your personal OpenAI account stays on your weekend projects. No accidental cross-pollination of prompts, no work credentials hitting a side project, no personal sessions logged on the work account.

Bill consumption per client

When a client gives you Codex access, sessions for that client run on their account. Their tokens get burned, not yours. Each account has its own usage history so refacturation stays straightforward.

Avoid quota collisions

If your work account has a tight OpenAI quota, a long agent run on a personal weekend project does not eat into it. Each account has its own limits, its own rate-limiting state, its own usage history.

Run a test account next to a prod account

Spin up a separate Codex account for noisy experiments, throwaway agents and prompt drafts. Keep the prod account clean. Switch between them per agent, per project, in two clicks.

Different orgs, different policies

Some OpenAI accounts are tied to enterprise SSO with mandatory logging or telemetry. Keeping a personal account separate means your personal coding stays on your personal terms, isolated at the directory level on disk.

Pair coding for two humans on one machine

If two developers share a workstation occasionally, each can sign in with their own Codex account. AgentsRoom remembers both, the right one fires up depending on the project or the agent.

Built directly into AgentsRoom

No external switcher, no shell scripts, no logout-login dance.

One Codex account per project

Pin a Codex account on a project. Every agent in that project inherits it by default. Open a Work project and a Personal project in the same window, each running its own Codex account underneath.

Override per agent

Need a single agent on a different account? Edit the agent, pick another Codex account, save. The override only applies to that agent. The rest of the project keeps the project-level account.

Sign in inside the app

Click "Add an account" and AgentsRoom opens an embedded mini terminal running codex login with the right CODEX_HOME. Complete the OAuth flow in the browser, paste the code back. The status badge flips to Signed in the moment credentials land on disk.

Global default account

Set one Codex account as the global default. Every new project starts on that account unless you override. Change the default later and every non-pinned project follows automatically.

Strict on-disk isolation

Each account lives in its own directory driven by CODEX_HOME: tokens, sessions, configuration. Two accounts never share a file. Deleting an account in AgentsRoom never touches another account's data.

How it works under the hood

Built on Codex CLI's official multi-account mechanism.

01

CODEX_HOME drives everything

Codex CLI reads its tokens and configuration from the directory pointed at by CODEX_HOME. Default is ~/.codex. Setting this variable to another directory swaps the active account. AgentsRoom uses this official mechanism to power multi-account support.

02

Each account is a managed directory

When you click "Add an account", AgentsRoom creates ~/.agentsroom/codex-profiles/<id>/ and signs in there. You can also point an account at any existing Codex config folder by entering a custom path.

03

Sign-in flow is embedded in Settings

AgentsRoom spawns a mini PTY running codex login with CODEX_HOME set to the new profile directory. Complete OAuth in the browser, paste the code back. AgentsRoom polls auth.json once a second so the Signed-in badge appears the moment the file lands on disk.

04

Cascade resolution at spawn time

When an agent starts, AgentsRoom resolves the effective Codex account in this order: agent override, project pin, settings default, system default ~/.codex. The right CODEX_HOME is set on the PTY environment before codex launches.

Alternatives to AgentsRoom

Other ways to handle multiple Codex accounts, and what AgentsRoom does differently.

CODEX_HOME by hand

The direct way: export CODEX_HOME=/path before launching codex. Manual, error-prone, and the moment you open a second terminal tab you forget which account you are on. AgentsRoom drives this variable for you, per-project and per-agent, and shows you the active account in the picker every time.

Two separate machines or two user sessions

Some teams use a separate machine or a separate OS user session per Codex account. Heavy, slow, and you cannot run a work agent and a personal agent in parallel. AgentsRoom runs both at the same time on the same machine, in the same window.

Logout and login each time

Run codex logout, then codex login on the new account, then again to switch back. Costs minutes per switch and breaks any running session. AgentsRoom keeps every account signed in permanently, switches with one click.

Shell scripts wrapping codex login

Some developers wrap codex in a shell function that exports CODEX_HOME based on the current directory. Brittle, hand-rolled, and invisible from the IDE. AgentsRoom encodes the same idea declaratively at the project level, with a UI badge that always tells you which account is active.

What AgentsRoom does that the others do not

AgentsRoom is the only IDE that surfaces multiple Codex accounts as a first-class concept, with a per-project pin, a per-agent override, an in-app sign-in flow via codex login, and a status badge per account. You sign in once per account, you pin accounts per project, you override per agent, and you stop worrying about which account is loaded. Multiple Codex accounts AND Claude accounts in the same window: a Codex Work agent, a Codex Personal agent and a Claude agent can all run side by side.

FAQ

How many Codex accounts can I add to AgentsRoom?

There is no hard limit. Each account is a directory on disk. Add a Work account, a Personal account, one account per client, a test account: AgentsRoom lists them all in the Settings panel and lets you pick any of them per project or per agent.

Do I need to install any extra tool to use multiple Codex accounts in AgentsRoom?

No. AgentsRoom drives Codex CLI's CODEX_HOME mechanism directly. No external switcher, no shell wrapper, no extra dependency. The sign-in flow is fully embedded in the Settings panel and runs the official codex login command.

Can two different agents in the same project run on two different Codex accounts at the same time?

Yes. The project pins a default account, but each agent can override it. Open a project pinned on the Work account, edit one specific agent to use the Personal account, and the two agents run in parallel on different Codex accounts in the same window.

What happens if I delete an account that some agents still reference?

Nothing breaks. The agents fall back to the default Codex account silently. The deleted directory is left on disk in case you want to point another profile at it later. You can rebind the orphaned agents to another account at any time from the Edit Agent dialog.

Are credentials shared with other AgentsRoom users or sent to a server?

No. Each account directory stays on your local machine. AgentsRoom never reads, copies or transmits credentials. The sign-in flow runs the official codex login CLI in a local PTY, OAuth happens between OpenAI and your browser as usual.

Can I mix Claude accounts and Codex accounts in the same project?

Yes. The Multiple Accounts panel in Settings handles both Claude and Codex accounts independently. A single project can have one Claude account pinned and one Codex account pinned. Each agent uses whichever provider and account it is configured for.

Same idea, different provider

You may also like: Claude Multi-Account

Multiple Codex accounts give you several Codex logins in one app. Claude Multi-Account does the same for Claude Code: run a Work Claude account, a Personal Claude account and a client Claude account side by side. Both features live in the same Multiple Accounts panel in AgentsRoom Settings.

See the Claude Multi-Account feature

Stop juggling shell variables. Pick the account from a picker.

Run a Work Codex account, a Personal Codex account and a client account in AgentsRoom, side by side, today.

FreeDownload AgentsRoom

Companion app: monitor your agents on the go

Bring your own: Claude, Codex, Antigravity CLI, or other AI provider.

Get the extension
Chrome Web Store

Push bugs and requests straight to your public backlog.

A glimpse of AgentsRoom in action.

Multiple projects
Multi-provider
Multiple agents
Live status
File diff & commit
Mobile companion
Live preview
Agent teams
Browser automation
Backlog-driven dev
Prompt Library
Skills Library
View all features