claude-code - 💡(How to fix) Fix [BUG] Workspace trust dialog re-prompts every session when CWD is home directory (non-git)

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error Messages/Logs

Root Cause

Root Cause Analysis

Fix Action

Fix / Workaround

Note: attempting to add trustedDirectories to ~/.claude/settings.json is rejected by Claude Code's own settings schema validator with "Unrecognized field: trustedDirectories", so there is no known workaround short of git init in the home directory. Trust decision is persisted. No re-prompt on subsequent sessions for the same directory.

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Bug Description

The workspace trust dialog appears every time Claude Code is launched when the current working directory is the user's home directory (~, i.e. C:\Users\<username> on Windows), which is not a git repository.

After clicking "Trust", the decision is not persisted across sessions. The next launch re-prompts.

Environment

  • Platform: Windows 10 Pro
  • Claude Code version: 2.1.154 (CLI), 2.1.92 (desktop)
  • CWD: C:\Users\<user> (home directory, no git repo)

What Should Happen?

Actual Behavior

Re-prompts every session.

Root Cause Analysis

The home directory contains ~/.claude/ which is also Claude Code's global settings directory. For git-based projects, trust appears to be stored relative to the git root. For non-git directories — especially when the project root and the global config root overlap — the trust persistence mechanism appears to silently fail or have no stable identity to key the decision to.

Note: attempting to add trustedDirectories to ~/.claude/settings.json is rejected by Claude Code's own settings schema validator with "Unrecognized field: trustedDirectories", so there is no known workaround short of git init in the home directory. Trust decision is persisted. No re-prompt on subsequent sessions for the same directory.

Error Messages/Logs

Steps to Reproduce

Steps to Reproduce

  1. Launch Claude Code in a non-git directory that happens to be the user's home directory
  2. Click "Trust" when prompted
  3. Exit and relaunch Claude Code in the same directory
  4. Observe the trust dialog appears again

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

Claude Code version: 2.1.154 (CLI), 2.1.92 (desktop)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING