Trust dialog reappears every session — `hasTrustDialogAccepted` not persisted on `/exit`
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?
Title: Trust dialog reappears every session — hasTrustDialogAccepted not persisted on /exit
Version: 2.1.167
Platform: Linux (Ubuntu), CLI
---
Describe the bug
The "Do you trust the files in this folder?" dialog reappears every session for a given working directory, even after clicking "Yes, proceed" and exiting cleanly with /exit. Acceptance is never saved.
To reproduce
- Open Claude Code in any directory (e.g.
/home/ubuntu) - Accept the trust dialog when prompted
- Exit using
/exit, then close the terminal - Reopen Claude Code in the same directory
- Trust dialog appears again
Repeats every session indefinitely.
Root cause (confirmed)
The field hasTrustDialogAccepted in ~/.claude.json (under projects["/your/path"]) remains false after /exit. The value is never written back. For comparison, other project paths that were trusted in earlier versions have both hasTrustDialogAccepted: true and lastGracefulShutdown: true — confirming the schema is correct, just not being written.
Workaround
Manually edit ~/.claude.json and set hasTrustDialogAccepted: true for the affected path. This survives restarts as long as Claude Code doesn't rewrite the project entry (e.g. after an update).
Expected behavior
Accepting the trust dialog once per directory should persist across sessions.
What Should Happen?
Accepting the trust dialog once per directory should persist across sessions.
Error Messages/Logs
Steps to Reproduce
- Open Claude Code in any directory (e.g.
/home/ubuntu) - Accept the trust dialog when prompted
- Exit using
/exit, then close the terminal - Reopen Claude Code in the same directory
- Trust dialog appears again
Repeats every session indefinitely.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.162
Claude Code Version
2.1.167
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
Love you guys <3
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗