Skip to content

Accounts and profiles

If you have two accounts of one agent, say a work and a personal Claude Code subscription, cornercase can keep both logged in and start each new agent with the one you pick, in one click.

  • An account is a folder of its own in which the agent keeps its login. cornercase hands the folder to the agent through the variable it already reads: CLAUDE_CONFIG_DIR for Claude Code, CODEX_HOME for Codex, GEMINI_CLI_HOME for Gemini CLI.
  • Each agent also has its own login, the usual one in ~/.claude, ~/.codex or ~/.gemini, called System until you give it a name.
  • Each pane has its own accounts, shown in a row under it. A new tab or a split takes the accounts of the pane it comes from, and you change a pane’s account from its row: an agent restarts on it, in the same conversation (Gemini CLI in a new one).
  • Each agent also has a default account, the one a new workspace, a new project and a script run outside cornercase start with.

cornercase never reads, copies or refreshes a token: you log in with the agent itself, in its account’s folder.

Everything here can be done in the window (Settings › Accounts and the row under each pane) or from the command line (cornercase account).

In Settings › Accounts, click + add account under the agent and type a name. cornercase makes the folder, closes Settings and opens a tab named personal login that runs claude auth login with it (codex login for Codex, gemini for Gemini CLI, where you log in from its first screen). Log in there once.

SettingsWorktreesAgentsAccountsFlowsIssuesUIRemotePluginsMachinessearch settingsClaude Codeworksigned in as ana@acme.dev (max)claude's own login·~/.clauderename…a name for the window; its folder stayspersonal signed in as ana@example.com (pro)~/.config/cornercase/server.accounts/crename…a name for the window; its folder stays+ add accountmakes its folder and opens a tab to log inCodexSystemcodex's own login·~/.codexrename…a name for the window; its folder stays+ add accountmakes its folder and opens a tab to log inGemini CLISystemgemini's own login·~rename…a name for the window; its folder stays+ add accountmakes its folder and opens a tab to log in
Claude Code's own login, called work, and a personal account, each logged in.

Each agent’s section starts with its own login, then its accounts. Each one says whether it is logged in, and as whom (signed in as ana@acme.dev (max), signed out). cornercase asks the agent itself (claude auth status, codex login status) when you open the tab and every 30 seconds while it shows; it never opens the files the login is kept in. Gemini CLI has no such command, so its accounts show no state. When a token variable such as ANTHROPIC_API_KEY is set where the server runs, a line at the top names it: it wins over every account (see below).

From the command line:

Terminal window
cornercase account add claude personal --login

This makes the folder and opens a tab named personal login that runs claude auth login with it. Without --login, switch a shell to the account and log in there as you would anywhere, or later log in again.

An account’s folder name is letters, digits, ., _ and -, at most 32, and a new one never ends in .lock, in any case, nor is the name of one whose <name>.lock folder is already there: while Claude Code renews an account’s login it keeps a folder such as personal.lock beside it, and cornercase never lists that as an account. cornercase account list shows each agent’s own login and accounts, with their folders and names, marks the default, and --check asks each one whether it is logged in first.

Logins expire. When Settings › Accounts or cornercase account list --check says signed out:

Terminal window
cornercase account login claude personal
cornercase account login codex --system # the agent's own login

It opens the same tab as --login when you add an account, personal login running claude auth login with that account (for the agent’s own login the tab is named after the agent, claude login or codex login, and has no account). --focus shows it, and --workspace ID puts it in another workspace. An account that does not exist is refused. Gemini CLI has no login command, so it is refused too: start gemini in a tab of that account (cornercase new-tab --account gemini=personal -- gemini) and sign in from its first screen.

rename… under an account, or under the agent’s own login, gives it the name the window shows: in the buttons, the tabs, Usage and the start dialogs. Call Claude Code’s own login work and you can tell it from personal at a glance. The folder never moves, since Claude Code finds its login by the folder’s path and a new path would log it out; an empty name goes back to the folder’s name (or System). Two accounts of one agent cannot have the same name.

Terminal window
cornercase account rename claude --system work # the agent's own login
cornercase account rename claude personal Personal
cornercase account rename claude personal --clear # back to its folder's name

Commands always name an account by its folder (and --system for the agent’s own login), never by the name the window shows.

A new account links the settings of the agent’s usual folder (~/.claude, ~/.codex, ~/.gemini), so your instructions, skills and commands are the same in every account:

Agent Shared Kept per account
Claude Code settings.json, settings.local.json, CLAUDE.md, agents/, commands/, skills/, plugins/, output-styles/, hooks/, keybindings.json, statusline* the login, .claude.json, history, sessions and transcripts, caches
Codex config.toml, AGENTS.md, prompts/, skills/, rules/ auth.json, sessions, history, logs
Gemini CLI settings.json, GEMINI.md, commands/, extensions/, skills/, policies/, trustedFolders.json the login, .env, history

They are symbolic links, made again before each agent starts if one is missing. When an agent saves a setting by replacing a file (a /model choice in Claude Code, a trusted project in Codex’s config.toml), the link becomes a file of that account only: account list names it as not shared, and cornercase never overwrites it. Delete the file and the next start links it again.

Once you have an account, every pane gives its last row to its accounts, under its terminal (which is one row shorter while it shows). A pane running Claude Code, Codex or Gemini CLI shows that agent’s button, such as claude: work ▾; a shell shows one button per agent with accounts, such as claude: work ▾ codex: System ▾, the accounts the agents you start there will use. The row is there in every layout, the compact one too, and dims with its pane when that pane is not the active one. When there is no room for every button, they shorten to the account’s name (work ▾), and then the last ones are left out.

Click a button to see that agent’s own login and accounts, the pane’s with a check mark, and click another:

  • An agent restarts on it in the same pane and conversation (Gemini CLI in a new one), at once if it is idle, else once its turn is over (restarts on personal after this turn, with cancel). Clicking the account it still runs on cancels a waiting restart, and a third account changes where it goes.
  • A shell at its prompt starts again in the same place and folder with that account, so the claude you type next uses it. Nothing is typed into it; what you ran in it before is gone from its history.
  • A pane running another program (vim, or an agent without accounts) shows its buttons dimmed, and their menu says why nothing can change: stop vim first. An agent of a flow, one whose folder variable you set yourself (custom), and a pane still being set up or resuming keep their buttons as they are, but their menu also says why nothing can change, and its accounts cannot be picked; a flow’s agent says to change its account in the Flow panel, for every agent of that kind in the team at once.

manage accounts… opens Settings › Accounts. Only the pane you clicked changes, even when it is not the active one, and clicking does not make it active. The right-click menu of a pane, and the ⋯ menu of a tab (for its active pane), have account › with the same accounts, also when the row is turned off.

+ NewIssuesChanges 1workFilesTODOpersonalWorktreesRecapmanage accounts…More▴Helpclaude: work▾
The button under a Claude Code pane opens its accounts.

+ Tab opens the new tab with the accounts of the workspace’s active pane, and a split with those of the pane it splits, so a tab next to a personal agent is personal too. So does cornercase start or cornercase new-tab run inside a pane (by you or by an agent there) without --profile: an agent on personal starts its helpers on personal too. --account still changes the agent it names.

Each agent’s default account is for everything that has no pane to take accounts from: a workspace without tabs, a new workspace or project, an issue or scheduled agent, a flow, and cornercase start run from outside cornercase. In Settings › Accounts, Enter on a row (or a click) makes it the default; ● marks it. Changing the default leaves every open pane as it is. From the command line:

Terminal window
cornercase account use claude personal # claude's default is personal
cornercase account use claude --system # back to its own login

To start one agent with another account without changing the default, pick it in the account list that opens when you start an issue (or ahead with account… on its page), in the agent’s account list when you start a flow (one list per agent of the team that has accounts), or in the Account list beside the agent when you schedule one. Each starts on the default account, except a flow’s lists when you start the flow from an issue, which start on the account you picked for the issue. From the command line, --account AGENT=ACCOUNT (once per agent; AGENT= is its own login):

Terminal window
cornercase start claude --account claude=personal --prompt 'fix the tests'
cornercase new-tab --account claude= --account codex=team
cornercase flow run 'Full issue' --account claude=personal --prompt 'add gift cards'
cornercase queue add --at 18:00 --prompt 'update the docs' --account claude=personal

If the account you picked is removed before the agent starts, nothing starts: the issue’s and the flow’s dialogs say so, and a scheduled agent fails when its time comes and says why. The schedule form keeps the account its list shows, the default when you saved it unless you picked another, even if the default changes later; only an entry added with cornercase queue add without --account starts with the default at that moment. A flow’s team keeps the accounts it started with if you change the default while it runs; move it in the Flow panel to change them.

A profile picks one account per agent under a name, so a script can switch several agents at once. The window never shows or changes profiles: while one is active it is the default, and choosing a default in Settings › Accounts leaves the profile.

Terminal window
cornercase profile new Work claude=work codex=work
cornercase profile use Work # Work's accounts are the default
cornercase profile use --system # every agent back to its own login
cornercase profile list # the active one is marked with *

profile set Work --provider codex --account personal changes one agent of a profile, and without --account that agent goes back to its own login; profile set Work --rename Job renames it; profile delete Work deletes it and keeps its accounts. A profile cannot be named system, in any case: that name stands for every agent’s own login, which profile use --system chooses (it also forgets the defaults chosen in the window). --profile NAME on start, new-tab and flow run uses a profile once; --account wins over it for its agent.

An agent reads its account when it starts, so changing it means restarting it. Choosing another account under its pane does that; to move several at once, or from a script, use the command line:

Terminal window
cornercase account restart claude # restart the open claude agents on the default
cornercase account restart claude personal # on personal
cornercase account restart claude --system # on the agent's own login
cornercase account restart claude personal --pane 4 --pane 7

Without --pane, every Claude Code agent that runs on another account restarts. With --pane, only those panes do, and a pane that is a shell at its prompt, with no agent in it, starts a new shell in the same place and folder with that account, so the claude you type next uses it. Nothing is typed into it. A shell running another program is skipped with stop <program> first, and one where you are typing a command, or where a script’s send waits for you, until the line is sent or cleared.

Each agent comes back in the same pane, in the same conversation: cornercase stops the pane’s shell, starts a new one in the same folder with the other account, and resumes the agent there (claude --resume, codex resume), with the mode it ran in. The pane keeps its place, its id and its tab. While it comes back the pane shows restarting claude on personal… with a cancel button and takes no keys, as after a restart of cornercase.

  • The conversation goes along. Claude Code and Codex keep a conversation in their account’s folder, where the other account cannot see it, so cornercase first adds that conversation’s files to the other account’s folder (for Claude Code, its transcript and its subagents’; for Codex, its rollout) as hard links, or as checked copies when the two folders are on different disks. It never overwrites or deletes a file: if the other account already has a different file at that place, that agent is not restarted, keeps running as it was, and a message says why. Since a hard link is one file in two folders, what the agent writes after the restart shows in the old account’s copy too.
  • Gemini CLI starts a new conversation: cornercase cannot hand it the old one, so it starts Gemini without --resume.
  • Busy agents wait for their turn. An agent that is working, waiting for your answer, or that was just sent a prompt (by you or by a script) it has not taken yet, restarts once its turn is over; meanwhile its pane shows restarts on personal after this turn with cancel. Changing the default, or a profile, leaves those waiting restarts as they are; removing the account they wait for drops them, and asking to restart one on the account it already uses cancels its waiting restart. They are not saved: cornercase kill-server forgets them.
  • Left as they are: agents and shells of a flow (a team keeps the accounts it started with; account restart skips them with it is the coder of a flow run: change its account in the Flow panel, and the Flow panel moves every agent of that kind in the team), agents and shells whose folder variable you set yourself (custom), and a shell still being set up or resuming an agent. account restart lists them as skipped, with the reason.
  • What does not come along: Claude Code’s rewind of past file edits (its file-history), and its trust in the folder, which the other account asks again. A shell in which you exported the old account’s variable by hand keeps it.

cornercase status marks an agent waiting to restart (restarts after this turn), and cornercase status --json gives each pane with accounts its accounts, one per agent. Changing the default in Settings › Accounts restarts nothing.

Once you have an account, an agent’s tab names it on its second line, after the model: Opus 5.5 · work · 12%. So do the tab bar and the agents section. A narrow column cuts the model first, then the account. An agent on its own login shows that login’s name, or System, while the agent has accounts, and nothing otherwise; one whose folder variable points somewhere you set yourself shows custom.

▾Workspaces▾main↓2▸nvim›bash+ Tab▾feat/dark-mode+4−0◐claudeOpus 5.5·work·7%◐claudeOpus 5…·personal·12%+ Tab▾feat/gift-cards↓1 more+ NewIssuesChanges 1FilesTODOWorktreesRecapMore▴Help
Two Claude Code agents side by side, one on work and one on personal.

Settings › UI has three switches, on by default and shown only once you have an account: account for that mark, account switcher for the row under each pane (the panes’ menus keep account ›), and account picker for the account lists in the issue, flow and schedule dialogs.

cornercase status --json gives each agent’s pane an account: the account’s folder name, or custom when its folder variable points somewhere else (one you exported by hand). A pane without one has no account key. When cornercase restarts, each agent resumes its conversation with the account it had; if that account was removed meanwhile, the pane comes back as a plain shell and a message names the account.

Usage › Limits shows a section for each account of Claude Code and Codex, after the one for their own login, each titled by its name, and marks with ● each agent’s default account. cornercase usage prints the same, and its JSON gives each entry its account, its label and whether it is active.

2Bots›3 #[derive(Debug, Deserialize)]4 pub struct Address {5 pub lines: Vec<String>,6 pub city: String,UsageLimitsStatsClaude Code·work·max planupdated just nowsession (5h)34%·resets in 2h 14mweek81%·resets in 3d 4hweek·Opus12%·resets in 3d 4hClaude Code·personal·pro planupdated just nowsession (5h)8%·resets in 4h 23mweek19%·resets in 3d 4hweek·Opus0%·resets in 3d 4hCodex·plus planupdated just nowsession (5h)22%·resets in 3h 41mweek9%·resets in 4d 10hdone~~s~~~src/returns/address.rs 11,1Helpclaude: work▾
The limits of each account, the default marked.

Select it in Settings › Accounts and press Backspace: a dialog asks first and reminds you to log out before (see below). Or:

Terminal window
cornercase account remove claude personal

It asks first, then deletes the account’s folder and forgets its name; an agent that used it goes back to its own login, and so does every profile that named it. The agent’s own login cannot be removed.

  • The folder’s path is the login. Claude Code finds its login in the keychain by the exact path of its folder, and the folders live in cornercase’s state folder (~/.local/state/cornercase/accounts/, see Files). If you move that folder, set XDG_STATE_HOME to another place or run a server with CORNERCASE_SOCKET, the path changes and each account has to log in again. A build from source (cargo run) has its own accounts.
  • Tokens in the environment win. ANTHROPIC_API_KEY, CLAUDE_CODE_OAUTH_TOKEN, CODEX_API_KEY, OPENAI_API_KEY and the like override the folder’s login. cornercase leaves them as they are, and Settings › Accounts and account list name the ones set (never their values); unset them in the environment the server starts from if you want the accounts to decide.
  • Gemini CLI with encrypted storage shares one login. With GEMINI_FORCE_ENCRYPTED_FILE_STORAGE=true, Gemini CLI keeps its login in one keychain item for every folder, so its accounts cannot be told apart. Leave it unset to use accounts.
  • Which agents. Claude Code, Codex and Gemini CLI. GitHub Copilot CLI, Cursor CLI, Grok Build and Vibe CLI may keep their login in a place that does not depend on the folder, so they are left out until that is checked; opencode uses providers of its own.
  • From a program: the requests are account-list, account-add, account-login-tab, account-remove, account-rename, account-use, profile-list, profile-new, profile-set, profile-use, profile-delete, account-restart and flow-account (a running flow’s team); start, new-tab and flow-run take profile and accounts, and the queue’s entries accounts; cornercase contract lists the features accounts, account-login (account-list with check), account-switch (account-rename, account-use and the accounts field), account-restart, accounts-revision, account-login-tab (the request of that name, and a view with account-add) and flow-account (the request, and each role’s account and the run’s account_change in flow runs). accounts_revision in status --app moves each time the accounts change, so another window or a script knows when to list them again, also for an account a command typed in a pane added. See Scripts and agents.