[BUG] Workspace trust dialog re-prompts every session when CWD is home directory (non-git)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] 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
- Launch Claude Code in a non-git directory that happens to be the user's home directory
- Click "Trust" when prompted
- Exit and relaunch Claude Code in the same directory
- 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_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗