[Feature Request] Add option to skip trust prompt when .claude/settings.local.json allows it

Status Fixed / completed
Maintainer reply None cached
Activity 15 comments · opened Dec 3, 2025 · closed Aug 17, 2026

Bug Description
Feature request: Option to skip trust prompt when settings.local.json exists

Use case: I use git worktrees extensively, with a shared settings.local.json symlinked across all worktrees. Each
worktree is a different absolute path, so I get the "Do you trust the files in this folder?" prompt every time I open
Claude in a new worktree - even though I've already explicitly configured my permissions in settings.local.json.

The problem: The existence of a .claude/settings.local.json file with permissions.allow entries is itself an explicit
declaration of trust. Prompting me to confirm trust for a directory where I've already placed a carefully crafted
settings file is redundant. I wrote the file - I obviously trust it.

Proposed solution: Add a setting (in ~/.claude/settings.json or CLI flag) like:

{
"trustProjectsWithLocalSettings": true
}

Or a CLI flag: --trust-local-settings

When enabled, if .claude/settings.local.json exists in the project, skip the trust prompt entirely. The settings file IS
the trust declaration.

Current workaround: Manually accepting the prompt in every new worktree, which defeats the purpose of having shared,
pre-configured settings.

Environment Info

  • Platform: linux
  • Terminal: gnome-terminal
  • Version: 2.0.57
  • Feedback ID: 78151e3f-2e79-41b7-91b9-a7d8f95748c0

View original on GitHub ↗

13 Comments

github-actions[bot] · 9 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

tomgilder · 9 months ago

This is still occurring, and I would like it too 😊

jtmarmon · 9 months ago

We ran into this issue trying to use worktrees as well. Took some playing around but it looks like claude trusts all subdirectories of a trusted folder if those subdirectories dont have their own .claude. So you can solve this by:

  1. Stop copying .claude/ into worktree directories
  2. Put all worktrees inside a directory like my-app-worktrees/
  3. Symlink your app's main .claude/ into the my-app-worktrees/ and accept the trust prompt once

i.e the structure will look like:

myapp/.claude
myapp-worktrees/.claude (symlink)
myapp-worktrees/wt1/ (no .claude)
myapp-worktrees/wt2 (no.claude)

You should no longer get the trust prompt in new worktrees

shkm · 8 months ago

Still hoping for this as it's really annoying in worktrees. I saw it's not the only request.

@jtmarmon thank you for your workaround, but since .claude already exists in the base repo, it's going to end up in the worktrees as well. Making a change shows it up in git status.

avihut · 8 months ago

Worktrees are the biggest reason to have this feature. In a way what I would like even more is to associate permissions with a base route that all of a single repo's worktrees are located so they can all share the same permissions and even resume sessions.

cameronfleet-paxos · 8 months ago

+1 running into this aswell with worktrees, without this you're kind of stuffed trying to create new worktrees for agents to work on - you have to approve each one. Running into the same issue with the workaround mentioned above by @shkm
the base repo has a .claude directory.

DrAlexHarrison · 8 months ago

+1

I would love any claude settings.* file to be able to allow it, not only settings.local.json.

shkm · 8 months ago
Still hoping for this as it's really annoying in worktrees. I saw it's not the only request. @jtmarmon thank you for your workaround, but since .claude already exists in the base repo, it's going to end up in the worktrees as well. Making a change shows it up in git status.

Follow-up, i have this working for my workflow, which is based around worktrees. Once the main repo is trusted, I create worktrees inside $REPO/.worktress/branch-name. We can avoid the "change is in git" with git update-index --skip-worktree.

Putting it together, I have a git checkout hook which automates the process.

#!/usr/bin/env bash
# .git/hooks/post-checkout
repo_root=$(git rev-parse --path-format=absolute --git-common-dir)
repo_root=${repo_root%/.git}
worktree=$(git rev-parse --show-toplevel)

# Only run inside a worktree, not the main repo.
if [ "$worktree" = "$repo_root" ]; then
  exit 0
fi

echo "Setting up worktree..."

# Remove .claude/ so Claude Code inherits trust from the repo root.
# See: https://github.com/anthropics/claude-code/issues/12980
if [ -d "$worktree/.claude" ]; then
  rm -rf "$worktree/.claude"
fi
git ls-files .claude/ | xargs -I{} git update-index --skip-worktree {}

Works on MacOS, YMMV on linux because xargs can differ.

Bonus: add any post-worktree-setup operations at the end (copy node modules, etc).

mymomot · 7 months ago

Use case: headless/server agent environment

Running Claude Code as a personal assistant on a dedicated LXC container (Proxmox). The working directory is ~ which is a local git repo specifically to persist Claude Code trust.

Despite having the project settings file with {"isTrusted": true}, the trust prompt appears every single session. This is particularly painful for:

  • Server-side agent workflows where Claude Code is launched frequently
  • Environments where bypassPermissions + skipDangerousModePermissionPrompt are already configured in global settings
  • Use cases where the user has explicitly opted into full trust via multiple config files

Suggestion: If isTrusted: true is set in the project settings AND defaultMode: "bypassPermissions" is in global settings, the trust prompt should be skipped entirely. The user has already made their intent crystal clear through configuration.

Claude Code v2.1.62 on Linux (Debian LXC).

moritzWa · 7 months ago

+1 - This creates unnecessary friction on every startup. I launch Claude Code frequently via a shell alias and having to confirm trust for my home directory every single time is tedious. A trustedDirectories config in ~/.claude/settings.json would be a simple, welcome fix.

depoultry · 6 months ago

I was able to get this to work so far by doin two things:

  1. In ~/.claude.json, I made sure that hasTrustDialogAccepted = true under the directory that I am trying to skip the trust prompt on. Mine was set to false.
  2. This might not be necessary - In ~/.claude/settings.json, add the directory to permissions.additionalDirectories so Claude Code treats it as a trusted workspace:
{
  "permissions": {
    "additionalDirectories": ["/home/p-gabriel"]
  }
}

Afterwards, you might need to trust the directory once but all subsequent launches in that directory will not show a trust prompt.

pengyanai · 4 months ago

@depoultry Thanks, this worked for me on macOS. Two small additions in case it helps others:

  1. Both settings really are needed — flipping hasTrustDialogAccepted alone wasn't enough; the additionalDirectories entry is what stops the prompt from returning on relaunch.
  1. ~ is not expanded in additionalDirectories. I had "~" there and it silently did nothing. Use an absolute path:

``json
{ "permissions": { "additionalDirectories": ["/Users/<username>/<dir>"] } }
``

  1. To trust every project already in ~/.claude.json in one shot:

``bash
jq '.projects |= with_entries(.value.hasTrustDialogAccepted = true)' \
~/.claude.json > ~/.claude.json.tmp && mv ~/.claude.json.tmp ~/.claude.json
``

kym6464 · 3 months ago

As of 2026-07-03 and Claude Code version 2.1.199 on MacOS, setting ~/.claude.json > projects > /Users/myuser > hasTrustDialogAccepted to true works. I created a gist to make this easier: https://gist.github.com/kym6464/587c0acf4991eae0ba3df213a02999a0

Showing cached comments. Read the full discussion on GitHub ↗