Trust dialog reappears every session — `hasTrustDialogAccepted` not persisted on `/exit`

Status Fixed / completed
Reported on v2.1.167
Maintainer reply None cached
Activity 5 comments · opened Jun 6, 2026 · closed Aug 17, 2026

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

  1. Open Claude Code in any directory (e.g. /home/ubuntu)
  2. Accept the trust dialog when prompted
  3. Exit using /exit, then close the terminal
  4. Reopen Claude Code in the same directory
  5. 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

  1. Open Claude Code in any directory (e.g. /home/ubuntu)
  2. Accept the trust dialog when prompted
  3. Exit using /exit, then close the terminal
  4. Reopen Claude Code in the same directory
  5. 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

View original on GitHub ↗

3 Comments

github-actions[bot] · 2 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/43958
  2. https://github.com/anthropics/claude-code/issues/63445
  3. https://github.com/anthropics/claude-code/issues/65451

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

DamosDrago · 2 months ago

There are similar bugs which may stem from the same root cause, however my report has more complete information and from a different OS/environment

marceloOrigoni · 1 month ago

Seeing a variant of this on Arch Linux, Claude Code 2.1.206.

In my case the flag is already persisted as true — but the dialog still reappears every launch:

// ~/.claude/settings.json
"projects": {
  "/home/marcelo": {
    "hasTrustDialogAccepted": true
  }
}

So this isn't just a "value never gets written" issue (as in the OP) — it can also fail when the value is correctly written and true, but whatever reads it on startup doesn't honor it. My working directory is also my home dir (/home/marcelo), which is likewise ~/.claude/'s parent — same overlap between project root and global config root that's been flagged in #63445 as the likely root cause.

Worth noting the OP's repro references ~/.claude.json, while mine lives in ~/.claude/settings.json — might be worth confirming both code paths (read + write) are pointed at the same file, in case that's part of the divergence.

Repro:

  1. cd ~ && claude
  2. Accept trust dialog
  3. Exit, relaunch claude from ~ again
  4. Dialog reappears despite hasTrustDialogAccepted: true already set for that path

Showing cached comments. Read the full discussion on GitHub ↗