Skip to content

[Bug]: Orca creates ~/.claude during background usage refresh even when Claude is disabled #12181

Closed

Description

@tsagi2045

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

  1. Disable Claude in Orca's agent settings.
  2. Ensure there is no active/managed Claude account and quit Orca.
  3. Remove an existing empty ~/.claude directory.
  4. Start Orca and allow its deferred usage refresh to run, or focus/show/restore the Orca window.
  5. Observe that ~/.claude is 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:

  1. Calling getRuntimePaths() with a nonexistent default config directory returns the expected paths without creating the directory.
  2. Preparing a rate-limit fetch with no selected Claude account does not create ~/.claude.
  3. 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

  1. added
    os:macos
    on Aug 3, 2026
  2. added a commit that references this issue on Aug 4, 2026
    919c0e0
  3. deleted a comment from edison7009 on Aug 23, 2026
  4. added a commit that references this issue on Sep 13, 2026
    d1309d8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

os:macos

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions