Skip to content

[Feature]: Per-worktree account pinning — run different Claude/Codex accounts concurrently #9496

Open

Description

@creatorKoo

Summary

Multi-account support for Claude Code (and Codex) currently works as a global hot-swap: exactly one account is active at a time, and swapping rewrites the active credential pointer for everything. I'd love to be able to pin an account to a worktree (or pick one per agent session at launch) so that different worktrees can run under different accounts concurrently.

Current behavior

Per the hot-swap docs:

  • Swapping rewrites the active credential pointer; any new session launched afterwards uses the new account.
  • Sessions already running keep their original account until restarted.
  • A restarted session picks up whichever account is active at restart time.
  • Usage readouts in the status bar follow the currently-active account only.

So the only way to get two accounts running side by side today is a fragile sequencing trick (launch sessions on account A → swap to B → launch more sessions), and it silently breaks the moment any session restarts.

Use case

  • Keep work repos on a work account and personal/OSS repos on a personal account — billing separation and IP hygiene — while both are open in the same Orca window.
  • Deliberately spread parallel agents across accounts to manage rate limits, instead of relying on launch order.

Proposed solution

  • An optional account pin at the worktree level, and/or a per-session account picker in the agent launch flow.
  • Pinned sessions always launch and restart with their pinned account; unpinned sessions follow the global active account, same as today.
  • Usage / rate-limit tracking reads the pinned account's state for those sessions.

Possible implementation

Claude Code already supports fully isolated profiles via CLAUDE_CONFIG_DIR — each directory holds its own independent credentials, so concurrent multi-account works at the CLI level today. Orca could manage one config dir per labeled account (e.g. ~/.orca/claude-profiles/<label>) and launch pinned sessions with that env var set. Codex looks analogous via CODEX_HOME.

Workaround today

Registering a custom CLI agent with CLAUDE_CONFIG_DIR=~/.claude-b claude works for launching a second account, but Orca's usage tracking and account-aware session start still read the default ~/.claude, so the second account's usage/limits aren't reflected — and it doesn't participate in the hot-swap or restart flows.

Thanks for the great tool — happy to add details or test a build.

Activity

  1. changed the title [-][Feature Request] Per-worktree account pinning — run different Claude/Codex accounts concurrently[/-] [+][Feature]: Per-worktree account pinning — run different Claude/Codex accounts concurrently[/+] on Jul 20, 2026
  2. hworknet commented on Oct 8, 2026

    @hworknet

    +1. My use case: separate Codex accounts per client project (each client pays for its own account), so work for client A must never run on client B's account. Today the only option is switching the account globally, which flips every open worktree at once. A per-project default with a per-worktree override (as proposed in #7782) would solve it.

  3. jorgej-ramos commented on Oct 8, 2026

    @jorgej-ramos

    +1

    I use up to three Claude accounts and up to two Codex for different clients, and none of them should cross to another client. This feature can be the killer one for complex workspaces. Actually I use profiles on iTerm2 to manage this, and it feels a bit ugly.

    I would also like to suggest that subscriptions could be assigned by repository groups.

  4. AmethystLiang commented on Oct 8, 2026

    @AmethystLiang
    Contributor

    Thanks for the feedback. Will look into it

  5. pawel-kotowski commented on Oct 9, 2026

    @pawel-kotowski

    Related work that may help here:

  6. nwparker commented on Oct 18, 2026

    @nwparker
    Contributor

    Consolidating #29808 here: the request is to run multiple Claude or Codex sessions at the same time, logged into different accounts. This matches the existing concurrent per-worktree/per-session account requirement. The feature remains open; closing that duplicate does not claim a complete account-selection/pinning flow has shipped or invalidate related work such as #28684.

  7. TerrysPOV commented on Oct 19, 2026

    @TerrysPOV

    +1, with a use case from agent orchestration that makes per-launch selection more than a convenience.

    I run my development cycle through Orca supervised workers: a Claude coordinator dispatches Codex workers with orca orchestration worker-start --agent codex …. I have two Codex seats on one Business workspace, both added as managed accounts in the Orca UI. When one seat hits its usage limit mid-task, the worker stalls. The coordinator has no supported way to relaunch that worker on the other seat, because the account switch is global and neither orca agent launch nor orchestration worker-start takes an account. In practice the work waits until I notice and switch accounts by hand.

    What would solve it:

    • an --account <id|label> flag on orca agent launch and orca orchestration worker-start (Codex and Claude), applying only to that launch; and/or
    • a CLI command for the existing accounts.selectCodex runtime RPC, although per-launch is what concurrent workers actually need, and a global switch races with them.

    Workaround I'm using meanwhile, in case it helps others: each managed account already lives in its own home under <Orca userData>/codex-accounts/<accountId>/home, so orca terminal create --command "CODEX_HOME=<that home> codex …" followed by worker-start --terminal <handle> runs a supervised worker on a chosen seat, with no re-login. Two caveats:

    • A managed home that has never been the active account lacks the hooks.json, hook links and trust state that the active one has.
    • It relies on an internal directory layout, which is why a supported flag would be much better.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions