[BUG] `claude rc` on the home directory: accepting the trust dialog never persists (`hasTrustDialogAccepted` stays false), trust loops forever
What happened
When I try to start claude rc for my home directory (/home/spe), it tells me I need to accept the workspace trust dialog. I accept the dialog, but nothing changes: it still refuses and keeps asking me to accept the trust dialog. I can never get past it for the home directory.
Trust works fine for other (non-home) directories: accepting the dialog there persists and claude rc works.
Expected
Accepting the trust dialog for the home directory should persist and let claude rc start, or if trusting the home directory as a workspace root is intentionally disallowed, the error should say so clearly instead of repeatedly showing a trust dialog that has no effect.
Actual
The trust dialog reappears every time. Accepting it does not persist. Inspecting ~/.claude.json, the home directory entry stays at hasTrustDialogAccepted: false no matter how many times I accept:
"/home/spe": {
"hasTrustDialogAccepted": false,
"hasCompletedProjectOnboarding": null,
"hasClaudeMdExternalIncludesApproved": false
}
For contrast, other directories in the same ~/.claude.json show hasTrustDialogAccepted: true and work as expected. In my file, 8 entries are true and 16 are false; the home directory is one of the ones stuck at false even after accepting.
Steps to reproduce
cd ~(home directory).- Run
claude rc. - It asks to accept the workspace trust dialog. Accept it.
claude rcstill refuses and asks to accept the trust dialog again.- Check
~/.claude.json: the home directory entry is stillhasTrustDialogAccepted: false.
Notes
- This may be related to #70501 (trust flag reverts to false despite accepting the dialog), but that report is on Windows. Mine is on Linux/WSL2 and appears specific to the home directory.
- Possibly the home directory is being special-cased (many tools refuse to treat
$HOMEas a workspace root). If so, the messaging should reflect that rather than looping on an ineffective trust dialog.
Environment
- Claude Code version: 2.1.210
- OS: Linux (WSL2,
6.18.33.1-microsoft-standard-WSL2) - Shell: bash
- Directory:
/home/spe(user home)
3 Comments
We reproduced this on Linux (non-WSL, Ubuntu 22.04) — same symptom: accepting the trust dialog for
~never persists,hasTrustDialogAcceptedstaysfalsein~/.claude.json, andclaude rcloops forever asking to accept.Pattern we observed across all stuck-at-false entries in our
.claude.json: they're all either/home/useritself OR directories with symlinks in their resolved path (e.g.,/home/user/workspace → /mnt/nvme/workspace).Non-home, non-symlinked directories (
/tmp/test-project) accepted and persisted immediately.Hypothesis: The trust persistence logic may be comparing the path BEFORE and AFTER resolution (e.g., user passed
~but the trust check resolved it to/home/spe, or vice versa), and the mismatch causes the write to miss or be rejected.Debugging suggestions:
~or a symlink) but the persistence layer expects the fully resolved path, the write will target the wrong key.~/.claude.jsonto see what path key it's trying to write and whether the write succeeds or silently fails (permissions, JSON corruption, write-after-read race, etc.).~), the error message should reflect that instead of showing an ineffective dialog.Quick test to isolate symlink vs. home-directory cause:
If Test 2 also loops, the bug is symlink-related (path normalization mismatch). If only Test 3 fails, it's specific to the home directory.
User impact: This blocks
claude rcfor any dev whose projects live under~(which is most Linux users). The workaround — moving projects outside~— is not discoverable from the error loop.If the home directory is intentionally blocked, the dialog should say so upfront: "claude rc cannot run in your home directory. Navigate to a project subdirectory and try again." If it's a bug, the path normalization fix should be straightforward (canonicalize the path ONCE before both the trust check and the persistence write, and use the canonicalized form as the key).
Let me know if you need a traced repro (strace/logs showing the file write succeeding or failing).
---
We've debugged trust-persistence bugs on Linux for long-running daemon sessions. SwarmAI. Discussion: T-MEM
Thanks for the detailed report — tested this on 2.1.233 (Linux, tmux).
Two things are going on:
hasTrustDialogAcceptedstayingfalsefor your home directory is intentional. For security, Claude Code never saves workspace trust for$HOMEitself — accepting the dialog there grants trust for that session only. I confirmed on 2.1.233 that a subdirectory persists trust normally while the home directory does not; that part is by design and not changing.claude rctelling you to accept a dialog whose acceptance can never persist, looping forever — was fixed in 2.1.214. Runningclaude rcfrom the home directory now explains that home-directory trust is never saved and suggests running it from a project directory instead. See the changelog.Closing as fixed — if you still see the loop on 2.1.214 or later, reply here and we'll reopen.
🤖 Generated with Claude Code
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.