Skip to content

Use multiple accounts per agent, work and personal.

Most agents keep one sign-in in one folder. Point each account at its own folder and you can use your work and personal accounts side by side, on the projects each belongs to.

Applies to Claude Code, Codex, Gemini CLI and OpenCode; Cursor Agent in a container5 min read

One folder per account

Each of these agents reads its sign-in from a folder that an environment variable can move:

Where each agent keeps its sign-in
AgentVariable
Claude CodeCLAUDE_CONFIG_DIR
CodexCODEX_HOME
Gemini CLIGEMINI_CLI_HOME
OpenCodeXDG_DATA_HOME

Give each account an alias that starts the agent with its folder:

~/.zshrc
alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'
alias codex-work='CODEX_HOME=~/.codex-work codex'
alias gemini-work='GEMINI_CLI_HOME=~/.gemini-work gemini'
alias opencode-work='XDG_DATA_HOME=~/.opencode-work opencode'

In a new terminal, sign in once per alias: in Claude Code type /login, in Gemini CLI pick the Google sign-in, then quit. The plain command keeps your current account.

Terminal
mkdir -p ~/.claude-work ~/.codex-work ~/.gemini-work ~/.opencode-work
claude-work
codex-work login
gemini-work
opencode-work auth login
OpenCode

XDG_DATA_HOME moves every program’s data that follows it, so set it only for the OpenCode process.

Cursor Agent names no sign-in folder in its documentation, so on the Mac it keeps one sign-in.

Watching the limits

Plans have session and weekly limits. In Claude Code, /usage shows how much of each is used; in Codex, /status. Check before a long task, and switch accounts before a limit stops an agent halfway.

With Dockazor

Settings › Accounts keeps a named sign-in folder per account, under each agent. A new chat starts on the account its project chose in Project Settings, else on the agent’s default. With “Use the last account for new chats” ticked, a chat with no project choice takes the last one used.

  • For plans with limits, the toolbar shows a chat’s account and how much of its closest limit is used; the popover lists each limit and when it resets. OpenCode chats show tokens and cost instead.
  • The account’s menu in the toolbar moves the chat to another account. The chat restarts on it with its conversation carried over; an agent too old to carry it starts fresh, and the dialog says so first.
  • When Dockazor sees an account cross 90% of a limit, you get one notification.
  • Cursor Agent keeps one sign-in on the Mac; in a project’s container it takes accounts like the others.
  • Gemini CLI’s and Cursor Agent’s limits are read with that agent’s own sign-in, sent to Google or cursor.com only and kept nowhere, once the account is signed in.