Repository navigation
Description
Operating system
macOS
Orca version
1.4.164
Details
Short summary
Orca creates an empty ~/.claude directory even when Claude is disabled in disabledTuiAgents, there are no managed Claude accounts, no active Claude account, and no Claude session has been launched.
Deleting the empty directory is temporary: a later Orca background usage refresh can recreate it.
Steps to reproduce
- Disable Claude in Orca's agent settings.
- Ensure there is no active/managed Claude account and quit Orca.
- Remove an existing empty
~/.claudedirectory. - Start Orca and allow its deferred usage refresh to run, or focus/show/restore the Orca window.
- Observe that
~/.claudeis created again even though Claude was not launched.
A visible Orca window also runs the rate-limit poll on the normal 15-minute cadence, so the directory can reappear later after deletion.
Expected behavior
Reading runtime paths or checking whether Claude usage is available should not create Claude's configuration directory. Orca should create it only when an operation actually needs to write Claude configuration or credentials.
Disabling Claude should also prevent unrelated background usage preparation from materializing Claude state.
Actual behavior
The default Claude runtime path resolver creates the directory as a side effect of resolving paths:
const configDir = inheritedConfigDir || join(homedir(), '.claude')
mkdirSync(configDir, { recursive: true })The background call path is:
RateLimitService refresh
-> ClaudeRuntimeAuthService.prepareForRateLimitFetch()
-> getPreparation()
-> ClaudeRuntimePathResolver.getRuntimePaths()
-> mkdirSync(~/.claude)
The main window attaches usage refreshes to focus/show/restore, starts a deferred startup refresh, and runs a 15-minute polling timer. This rate-limit path is not gated by disabledTuiAgents.
Suggested fix
Make ClaudeRuntimePathResolver.getRuntimePaths() side-effect free: return the paths without calling mkdirSync. Create the directory only inside the specific credential/config mutation that requires it.
Suggested regression coverage:
- Calling
getRuntimePaths()with a nonexistent default config directory returns the expected paths without creating the directory. - Preparing a rate-limit fetch with no selected Claude account does not create
~/.claude. - An actual Claude config/credential write still creates its required parent directory.
This is separate from the agent-hook config-directory issue in #11641: that issue also has a local disabled-agent removal side effect, while this ~/.claude case originates in the Claude usage/auth path resolver.
Activity
fix(claude-accounts): stop path resolution from creating the config d…
fix(claude-accounts): stop path resolution from creating the config d…