Skip to content

[Feature]: Add per-project and per-worktree account assignment for token and credit management #7782

Description

@llewellynvz

Problem or use case

Orca’s account switching is very useful, especially when working across multiple Claude, OpenAI, or other coding-agent accounts. However, account selection currently operates as a global application-level setting.

The main limitation is not simply that switching accounts affects multiple projects but rather resource allocation. When working across several projects/teams, and on multiple worktrees, or agentic sessions, different tasks may have different levels of priority, cost sensitivity, token demand, or account availability.

For example, a user may want to allocate:

  • Claude account 1 (with more credits) to a high-priority production project
  • Claude account 2 (with less credits) to a large exploratory or research project
  • Claude account 3 to lower-priority background work

This would make it possible to use the right account for the right project, rather than having all active work inherit the same global account. It would also help users manage credit consumption, subscription limits, rate limits, team usage, and token-heavy workflows more deliberately.

At the moment, if account selection is only global, users cannot reliably assign accounts to specific projects or worktrees. This makes it harder to optimize token usage across larger projects, parallel agentic workflows, and teams with different priorities.

Proposed solution

Add support for scoped account assignment, ideally at the project level and, if feasible, at the worktree level.

A possible hierarchy could be:

  1. Worktree-specific account, if set
  2. Project-specific account, if set
  3. Global default account

This would preserve the current global account selector while allowing users to override it where more granular account control is needed.

Example behavior:

  • Project A uses Claude account 1 because it is high priority
  • Project B uses Claude account 2 because it is token-heavy exploratory work
  • Project C uses OpenAI account 1 for a specific workflow
  • Project D inherits the global default account

Suggested UI behavior:

  • Keep the existing global account selector as the default.
  • Add an account selector in project settings.
  • Optionally add an account selector in worktree settings.
  • Clearly display which account is active for each project or worktree.
  • Prevent global account changes from overriding projects or worktrees with explicit account assignments.

This would give users more control over how credits, tokens, rate limits, and subscriptions are allocated across active work.

Alternatives or additional context

The current workaround is to manually switch accounts depending on which project is active. This is easy to get wrong when multiple projects, worktrees, or agents are running in parallel.

Another workaround would be to run separate Orca instances, separate operating-system profiles, or separate environments. However, that adds operational overhead and reduces the benefit of managing multiple agentic workflows inside one interface.

This feature would be especially useful for users who:

  • Run multiple agentic coding sessions in parallel
  • Use multiple Claude or OpenAI accounts
  • Need to prioritize token and credit usage across projects
  • Work with larger teams or multiple collaborators
  • Need to separate high-priority work from exploratory or background work
  • Want predictable account usage across projects and worktrees
  • Need better rate-limit, subscription, and usage management

The main request is to make account selection assignable per project, and ideally per worktree, so users can allocate the right account to the right work rather than relying only on a global application-wide account setting.

Activity

  1. added theissue type on Jul 12, 2026
  2. juandl commented on Jul 21, 2026

    @juandl

    Hello any ETA?

  3. metheoryt commented on Aug 1, 2026

    @metheoryt

    A project group tier would slot between project and global in your proposed hierarchy — groups already carry executionHostId / connectionId with repo-then-group precedence and a cycle-guarded parentGroupId walk, so the resolver shape exists. Proposed in detail on #6921 (answering its open question about where the binding lives): worktree → repo → group chain → global.

  4. nwparker commented on Aug 23, 2026

    @nwparker
    Contributor

    Closing as a duplicate of #6921.
    Disagree? Please respond! I will re-visit this ticket in 5 days. If you respond, I will re-open it 🙏.

  5. nwparker commented on Oct 9, 2026

    @nwparker
    Contributor

    Reopening to retain the broader account-assignment request. #6921 describes Claude-specific worktree binding; this report also explicitly includes OpenAI/other agents and project/worktree/global precedence for resource allocation. The Claude-only issue does not establish completion or coverage of the whole request.

  6. AlexanderAbramovPav commented on Oct 25, 2026

    @AlexanderAbramovPav

    Adding a use case and a proposal for one shared shape, since this is the issue kept open for the broader request (Claude and Codex, project and worktree precedence).

    Use case. One person, two subscriptions per provider: a work Claude plan and a personal one, plus Codex on both sides. A fleet of agents runs across many repos at once, started from the UI and by a coordinator agent through the CLI. The split is fixed by repo, not by task:

    • Billing and quotas: work usage must land on the work plan, personal usage on the personal plan.
    • Compliance: the employer's code must only run under the work account. With a global switcher this depends on remembering to switch. One forgotten switch sends work code through a personal account. So does a session restarted after a switch, because it comes back on whichever account is selected at that moment.

    Today the selected Claude and Codex account is one setting per runtime (host or WSL distro), and orca account select only accepts OpenCode and Devin, so neither a project nor a CLI launch can choose its account.

    Proposal: one binding, read by every launch path. Most of the pieces are already in flight. This is an attempt to line them up so they share one setting.

    1. Per-project binding, per agent. feat(claude-accounts): per-project Claude account (ask on launch, remember per project) #23228 already stores Repo.agentAccounts.claude, next to the per-project GitHub account from feat(github): bind projects to a specific gh account #13664. Keeping that shape and adding codex covers the Codex half. Precedence: explicit launch flag → the session's recorded account (resume/restore) → worktree override → project binding → global selection.
    2. The same binding from the CLI, so coordinator agents and headless hosts can set and use it:
    3. Visible per workspace. The account a workspace's agents run on is shown on the workspace (sidebar row or hover card), not only on the tab, so a wrong account is caught before the first prompt ([Feature]: Show which Claude account each chat/session uses, before the first message #30354, feat(accounts): keep a Claude or Codex agent on its account #28684).
    4. Fail closed. If the bound account was removed or can't be used on that host, the launch stops with a reason instead of starting on the global account. feat(claude-accounts): per-project Claude account (ask on launch, remember per project) #23228 already does this for Claude. The same rule should hold for Codex and for CLI launches, since a silent fallback is exactly the failure the binding exists to prevent.
    5. Optional, later: a default agent per project. The default agent is global today. Some repos are Codex repos and others Claude repos, so the same project setting could also carry which agent a new workspace starts with.

    Since each Claude account now has its own folder (#24434, #26801), a launch can be pointed at one account without copying credentials. The remaining work is mostly where the account is chosen, not how credentials are handled.

    Would the maintainers accept #23228's agentAccounts shape as the shared binding, with Codex and the CLI flags added on top of it in small follow-ups?

  7. capoyeti commented on Nov 1, 2026

    @capoyeti

    +1 to @AlexanderAbramovPav's proposal to reuse #23228's Repo.agentAccounts with a codex key. My case is the same split: company repos on a company ChatGPT account for billing, everything else on personal. Today I route it with a wrapper set as the Codex Command (picks CODEX_HOME from the repo's git common dir). One addition to that proposal: the usage chip and account indicator should reflect the account a session actually launched with. With externally routed CODEX_HOME it currently shows "System default", which hides exactly the mis-route the binding is meant to prevent. Details in #9496.

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

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions