You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(accounts): launch Claude in user-owned profile folders - #38149
Some people keep more than one Claude Code setup on the same machine, each in its own folder with its own settings, CLAUDE.md, memory, skills and login. Today they start them from shell aliases like CLAUDE_CONFIG_DIR=~/.claude-work claude. This PR lets you register such a folder once in Settings, and then it shows up as its own entry in the agent menu, for example "Claude · work".
What Changed
Before: Orca knew one kind of extra Claude setup, the managed account. Managed accounts live in Orca's data folder, are selected globally ("the next Claude you start uses it"), and Orca copies settings.json, CLAUDE.md and parts of .claude.json from ~/.claude into them on every setup. There was no way to start Claude in a folder the user owns from the agent menu.
After:
Settings > AI Provider Accounts > Claude has a new "Claude Profiles" block. You add a profile with a label and an absolute folder path (typed or picked with Browse). Remove only forgets the profile; the folder is never touched.
Each profile appears as a terminal launch row "Claude · " next to Claude in the tab bar agent menu (AgentLaunchPickerMenu) and in the plain agent menu (ProjectedAgentMenuItems). Rows appear only when the Claude CLI is detected and the workspace runs on this computer.
Launching a profile row starts the normal claude terminal agent with two extra launch env entries: CLAUDE_CONFIG_DIR=<folder> and ORCA_CLAUDE_CONFIG_PROFILE_DIR=<folder>. They go through the existing agentEnv of the startup plan, so they are recorded in the launch config and a cold restore resumes the session in the same folder.
In main, both PTY spawn preflights (IPC and runtime) recognise a launch whose ORCA_CLAUDE_CONFIG_PROFILE_DIR equals its CLAUDE_CONFIG_DIR. For such a launch Orca skips managed-account routing: withClaudeProfileTerminalEnv does not inject the pointer or the selected account's CLAUDE_CONFIG_DIR, and prepareClaudeAuth is not called. Instead, prepareClaudeConfigProfileLaunch creates the folder if it is missing and merges Orca's status hooks into its settings.json (only when agent status hooks are enabled for Claude), using the existing claudeHookService.install({ configDir }). Nothing else in the folder is written.
The plain "Claude" entry and the global account switcher behave exactly as before.
Mechanism, in short: the profile is a launch-scoped env overlay on the existing claude agent, not a new TuiAgent id and not a new kind of managed account.
Why
The motivating setup: two folders, ~/.claude-operayo and ~/.claude-placeholder, started today through aliases that run CLAUDE_CONFIG_DIR=... claude --dangerously-skip-permissions. Both need to be startable side by side from Orca, each with its own configuration.
Their selection is global, so two setups cannot run next to each other from the menu.
A launch that sets its own CLAUDE_CONFIG_DIR is either replaced by the selected account's folder (terminal panes) or refused with managedAccountEnvOverride (structured sessions).
Alternatives considered:
A kind: 'profile' variant inside claudeManagedAccounts. Rejected: that list feeds the switcher, usage and rate limits, WSL account push, the session move dialog and more. Each consumer would need a branch to keep profiles out of the sync and the global selection. A sibling claudeConfigProfiles list keeps those paths unchanged.
One dynamic TuiAgent id per profile. Rejected: TuiAgent is a closed union used by detection, hooks, permissions, telemetry and the agent catalog.
agentDefaultEnv.claude.CLAUDE_CONFIG_DIR already works, but only for one folder and it changes every Claude launch.
Linked Issue
#25065 (the Claude half: "connect an existing CLI configuration folder" and show it as its own launch entry). Codex homes from that issue are not part of this PR.
Related: #27660 and #24873 (status hooks missing for a custom config folder). This PR installs the hooks for registered profile folders only.
Visual Proof
Screenshots omitted: I did not run the Electron app for this change, so the UI is untested. Reviewers should check the new "Claude Profiles" block in Settings > AI Provider Accounts and the "Claude · " rows in the tab bar agent menu.
Testing
Automated:
pnpm tc: passes.
New tests, each failing without the change:
src/main/ipc/pty/pty-launch-race-parity.test.ts: on both spawn lanes, a profile launch reaches the provider with its own CLAUDE_CONFIG_DIR while prepareClaudeAuth would route it to a selected account. Verified to fail on both lanes with the preflight change reverted.
src/main/claude-accounts/claude-profile-router.test.ts: with an account selected, withClaudeProfileTerminalEnv leaves a profile launch env unchanged and still routes an ordinary pane.
src/shared/claude-config-profiles.test.ts: normalization drops ~, relative and .. paths, blank labels, and repeated ids or folders; the env marker only counts when it equals CLAUDE_CONFIG_DIR.
src/renderer/src/components/tab-bar/claude-config-profile-rows.test.ts: placement of profile rows, and no rows on an SSH host.
pnpm check:changed: typecheck, format, oxlint, every ratchet, localization, import boundaries and changed-code quality pass. Its unit test step fails only on tests that also fail on unmodified main in my checkout:
47 tests/e2e/cross-version-wire/* tests, because my clone is shallow and lacks the release tags they check out (the harness says so).
src/main/runtime/rpc/agent-sender-refresh.test.ts (2 work-count tests), which fails the same way on main.
pnpm test --changed=origin/main: 41771 passed; the 38 failures are the ones listed above.
src/shared/remote-runtime/host-store/wsl-host-deployment-store.test.ts (3 tests) also fails on unmodified main locally.
Manual steps for a reviewer (macOS or Linux):
Create two folders, for example ~/.claude-a and ~/.claude-b, and sign in to Claude once in each (CLAUDE_CONFIG_DIR=~/.claude-a claude).
In Settings > AI Provider Accounts > Claude > Claude Profiles, add both with absolute paths.
Open the tab bar agent menu in a local workspace. "Claude · a" and "Claude · b" appear below Claude.
Start both. In each, /status shows that folder's login, and echo $CLAUDE_CONFIG_DIR in a shell started from that tab is not affected. The sidebar shows working/idle status for both.
Select a managed account in the status bar switcher and start "Claude · a" again: it still runs in ~/.claude-a. Plain "Claude" uses the selected account.
Remove a profile: its row disappears and the folder still exists.
Platforms: only the automated checks above were run, on macOS. Not tested on Windows, Linux, over SSH or WSL.
Risk
Level: Low
Saved settings gain an optional claudeConfigProfiles array. Older builds ignore it. Normalization runs on load, in the main settings update and in the renderer settings slice.
The main-side change only applies to launches that carry ORCA_CLAUDE_CONFIG_PROFILE_DIR equal to CLAUDE_CONFIG_DIR. Every other launch takes the existing path.
Orca writes its status hooks into the profile folder's settings.json, as it already does for ~/.claude/settings.json. Removing a profile does not remove those hooks. The hook script exits immediately outside an Orca pane, so stale entries are inert.
Profiles are host folders. Rows are hidden for SSH and Orca server workspaces, and a profile launch is refused for SSH, server and WSL (\\wsl$) workspaces instead of falling back to another account. A Windows host whose agent runtime is set to WSL for a non-UNC folder is not detected and is untested.
Profile launches are terminal only. They never take the structured chat route, and they skip the host-side prompt paste path because that path rebuilds the launch env from settings.
Back out with a plain revert. Saved profiles stay in settings as an unused key.
AI Disclosure
Review
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Security: the folder path must be absolute and contain no .. segment; ~ is rejected because env values are not shell-expanded. Main re-checks the marker before skipping account routing.
Cross-platform: path validation accepts POSIX and C:\ style paths. The env overlay and hook install use existing cross-platform code.
Remote SSH and mobile: profiles are not offered there.
Not done in this PR: profile rows in the tab bar omnibox search results, per-profile usage display, Codex homes.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
Register a Claude config folder (CLAUDE_CONFIG_DIR) with a label in
Settings > AI Provider Accounts. Each profile becomes its own terminal
entry "Claude · <label>" in the agent menus. The launch carries the
folder as CLAUDE_CONFIG_DIR plus ORCA_CLAUDE_CONFIG_PROFILE_DIR in its
agent env, so a cold restore resumes in the same folder.
Main skips managed-account routing for such launches: no pointer or
account CLAUDE_CONFIG_DIR is injected and prepareClaudeAuth is not
called. It creates the folder when missing and merges Orca's status
hooks into its settings.json; nothing else in the folder is written,
unlike managed accounts, which sync settings.json, CLAUDE.md and
.claude.json from ~/.claude.
Profiles are host folders, so they are not offered for SSH, Orca
server or WSL workspaces, and a launch there is refused rather than
falling back to another account.
The change adds saved Claude configuration profiles to global settings, with validation and normalization. The accounts settings view lets users add, browse, and remove profiles. Launch menus display eligible profiles and pass the selected profile ID into local Claude launches. The launch flow applies the profile environment. PTY preflight prepares the profile directory and conditionally installs status hooks.
Merge Risk: Moderate · up to 2ef2e
An incompatible folder path can launch Claude with the wrong configuration. Reaching the profile limit can also erase an unsaved entry. Refuse incompatible paths before launch and preserve drafts at the limit before merging.
Pre-merge checks: 5
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: launching Claude in user-owned profile folders.
Description check
The description is mostly complete. It explains the user impact, implementation, rationale, linked issue reference, testing, risks, platform limitations, rollback plan, and scope. It does not provide …
Docstring Coverage
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description is mostly complete. It explains the user impact, implementation, rationale, linked issue reference, testing, risks, platform limitations, rollback plan, and scope. It does not provide the required explicit N/A statement for visual proof and does not include a direct issue link, but these omissions do not make the description largely incomplete.
Full details: Docstring Coverage
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 31 functions across 30 files.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Tip
🎯 Customize your risk assessments
Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.
✅ Automatic approvals, with your rules
Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
- A profile folder that cannot be created now fails the PTY spawn with
claudeAccountSetupFailed instead of starting Claude with only a
console warning. Status hook installation stays non-fatal.
- Profiles are refused and hidden when the workspace's resolved
project runtime is WSL, including Windows-drive projects set to run
in WSL, not only for \\wsl$ paths.
- Profile folders may be UNC shares such as \\server\share\claude; any
control character is rejected along with `..` segments.
- Doc comments on the new and touched functions.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (1)
Minor · Guard add() when the profile limit is reached. · claude-config-profiles-setting.tsx:60-75
src/renderer/src/components/settings/accounts/claude/claude-config-profiles-setting.tsx:60-75 Minor · Functional Correctness · Quick win
Guard add() when the profile limit is reached.
The Add button is disabled at 32 profiles, but pressing Enter in the directory field still calls add(). A valid 33rd profile is appended, discarded by normalizeClaudeConfigProfiles, and followed by clearing both draft fields. Check full inside add() before validating or clearing the draft.
Suggested fix
/** Save the draft as a new profile, or show why it cannot be saved. */
const add = (): void => {
+ if (full) {+ return+ }
const problem = draftError(label, configDir, profiles)
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 630439b5-7a5a-43a2-a013-8ce6cc6df4aa
Commits
Reviewing files that changed from the base of the PR and between 6d4ee4c and 2ef2eb1.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Major · Functional Correctness · Heavy lift
Check that the profile path is absolute on the launch host.
On macOS or Linux, this expression accepts C:\Users\me\.claude and \\server\share\claude. Those are not absolute paths on that host. The settings form can save either value, and profile preflight then passes it to mkdir. Orca can create a directory relative to its working directory while Claude resolves CLAUDE_CONFIG_DIR from the terminal’s working directory. The selected profile can therefore start with the wrong configuration. Keep normalization cross-platform if saved settings must survive a host change, but reject a profile at launch and before mkdir unless its path is absolute for that host. (raw.githubusercontent.com)
Based on learnings, Windows path prefixes do not make a path absolute on Unix, and platform-specific behavior requires runtime checks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
Some people keep more than one Claude Code setup on the same machine, each in its own folder with its own settings, CLAUDE.md, memory, skills and login. Today they start them from shell aliases like
CLAUDE_CONFIG_DIR=~/.claude-work claude. This PR lets you register such a folder once in Settings, and then it shows up as its own entry in the agent menu, for example "Claude · work".What Changed
Before: Orca knew one kind of extra Claude setup, the managed account. Managed accounts live in Orca's data folder, are selected globally ("the next Claude you start uses it"), and Orca copies
settings.json,CLAUDE.mdand parts of.claude.jsonfrom~/.claudeinto them on every setup. There was no way to start Claude in a folder the user owns from the agent menu.After:
AgentLaunchPickerMenu) and in the plain agent menu (ProjectedAgentMenuItems). Rows appear only when the Claude CLI is detected and the workspace runs on this computer.claudeterminal agent with two extra launch env entries:CLAUDE_CONFIG_DIR=<folder>andORCA_CLAUDE_CONFIG_PROFILE_DIR=<folder>. They go through the existingagentEnvof the startup plan, so they are recorded in the launch config and a cold restore resumes the session in the same folder.ORCA_CLAUDE_CONFIG_PROFILE_DIRequals itsCLAUDE_CONFIG_DIR. For such a launch Orca skips managed-account routing:withClaudeProfileTerminalEnvdoes not inject the pointer or the selected account'sCLAUDE_CONFIG_DIR, andprepareClaudeAuthis not called. Instead,prepareClaudeConfigProfileLaunchcreates the folder if it is missing and merges Orca's status hooks into itssettings.json(only when agent status hooks are enabled for Claude), using the existingclaudeHookService.install({ configDir }). Nothing else in the folder is written.Mechanism, in short: the profile is a launch-scoped env overlay on the existing
claudeagent, not a newTuiAgentid and not a new kind of managed account.Why
The motivating setup: two folders,
~/.claude-operayoand~/.claude-placeholder, started today through aliases that runCLAUDE_CONFIG_DIR=... claude --dangerously-skip-permissions. Both need to be startable side by side from Orca, each with its own configuration.Managed accounts do not cover this:
settings.json,CLAUDE.md(as an import of~/.claude/CLAUDE.md) and.claude.jsonfrom the user's config dir into the managed home, so a second, independent configuration is overwritten (see also [Bug]: Model and effort chosen with /model don't persist on managed Claude accounts (profile settings.json is overwritten from ~/.claude on every launch) #36850).CLAUDE_CONFIG_DIRis either replaced by the selected account's folder (terminal panes) or refused withmanagedAccountEnvOverride(structured sessions).Alternatives considered:
kind: 'profile'variant insideclaudeManagedAccounts. Rejected: that list feeds the switcher, usage and rate limits, WSL account push, the session move dialog and more. Each consumer would need a branch to keep profiles out of the sync and the global selection. A siblingclaudeConfigProfileslist keeps those paths unchanged.TuiAgentid per profile. Rejected:TuiAgentis a closed union used by detection, hooks, permissions, telemetry and the agent catalog.agentDefaultEnv.claude.CLAUDE_CONFIG_DIRalready works, but only for one folder and it changes every Claude launch.Linked Issue
#25065 (the Claude half: "connect an existing CLI configuration folder" and show it as its own launch entry). Codex homes from that issue are not part of this PR.
Related: #27660 and #24873 (status hooks missing for a custom config folder). This PR installs the hooks for registered profile folders only.
Visual Proof
Screenshots omitted: I did not run the Electron app for this change, so the UI is untested. Reviewers should check the new "Claude Profiles" block in Settings > AI Provider Accounts and the "Claude · " rows in the tab bar agent menu.
Testing
Automated:
pnpm tc: passes.src/main/ipc/pty/pty-launch-race-parity.test.ts: on both spawn lanes, a profile launch reaches the provider with its ownCLAUDE_CONFIG_DIRwhileprepareClaudeAuthwould route it to a selected account. Verified to fail on both lanes with the preflight change reverted.src/main/claude-accounts/claude-profile-router.test.ts: with an account selected,withClaudeProfileTerminalEnvleaves a profile launch env unchanged and still routes an ordinary pane.src/shared/claude-config-profiles.test.ts: normalization drops~, relative and..paths, blank labels, and repeated ids or folders; the env marker only counts when it equalsCLAUDE_CONFIG_DIR.src/renderer/src/components/tab-bar/claude-config-profile-rows.test.ts: placement of profile rows, and no rows on an SSH host.pnpm check:changed: typecheck, format, oxlint, every ratchet, localization, import boundaries and changed-code quality pass. Its unit test step fails only on tests that also fail on unmodifiedmainin my checkout:tests/e2e/cross-version-wire/*tests, because my clone is shallow and lacks the release tags they check out (the harness says so).src/main/runtime/rpc/agent-sender-refresh.test.ts(2 work-count tests), which fails the same way onmain.pnpm test --changed=origin/main: 41771 passed; the 38 failures are the ones listed above.src/shared/remote-runtime/host-store/wsl-host-deployment-store.test.ts(3 tests) also fails on unmodifiedmainlocally.Manual steps for a reviewer (macOS or Linux):
~/.claude-aand~/.claude-b, and sign in to Claude once in each (CLAUDE_CONFIG_DIR=~/.claude-a claude)./statusshows that folder's login, andecho $CLAUDE_CONFIG_DIRin a shell started from that tab is not affected. The sidebar shows working/idle status for both.~/.claude-a. Plain "Claude" uses the selected account.Platforms: only the automated checks above were run, on macOS. Not tested on Windows, Linux, over SSH or WSL.
Risk
Level: Low
claudeConfigProfilesarray. Older builds ignore it. Normalization runs on load, in the main settings update and in the renderer settings slice.ORCA_CLAUDE_CONFIG_PROFILE_DIRequal toCLAUDE_CONFIG_DIR. Every other launch takes the existing path.settings.json, as it already does for~/.claude/settings.json. Removing a profile does not remove those hooks. The hook script exits immediately outside an Orca pane, so stale entries are inert.\\wsl$) workspaces instead of falling back to another account. A Windows host whose agent runtime is set to WSL for a non-UNC folder is not detected and is untested.AI Disclosure
Review
Agent skill upstream boundary
Notes
..segment;~is rejected because env values are not shell-expanded. Main re-checks the marker before skipping account routing.C:\style paths. The env overlay and hook install use existing cross-platform code.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)