Skip to content

[FEATURE] Trusted workspace patterns to skip trust prompt for git worktrees #23109

@chasemcdo

Description

@chasemcdo

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Note: This was previously reported in #993 and #21283, both auto-closed without resolution. A comment on #993 suggested additionalDirectories as a workaround — I've tested this and confirmed it does not skip the workspace trust prompt (tested with absolute paths, ~ expansion, and wildcard patterns).

Problem Statement

When using git worktrees, every new worktree creates a new directory that Claude Code has never seen before. This triggers the workspace trust prompt ("Quick safety check: Is this a project you created or one you trust?") every single time.

For developers who use worktrees heavily (one worktree per feature branch), this becomes repetitive friction. The parent repository is already trusted, and all worktrees are derived from it — there's no security benefit in re-prompting for each one.

Proposed Solution

Add a trustedWorkspacePatterns (or similar) setting in ~/.claude/settings.json that accepts glob patterns for directories that should be automatically trusted:

{
  "trustedWorkspacePatterns": [
    "~/worktrees/my-project/*",
    "~/repos/**"
  ]
}

When Claude Code launches in a directory matching any of these patterns, the trust prompt would be skipped.

Alternative Solutions

  • additionalDirectories: Tested all of the following in global ~/.claude/settings.json — none skip the trust prompt:

    • Absolute path: /Users/me/worktrees/my-project
    • Tilde path: ~/worktrees/my-project
    • Absolute with wildcard: /Users/me/worktrees/my-project/*
    • Tilde with wildcard: ~/worktrees/my-project/*

    This setting only controls file access scope from within an already-trusted session — it does not affect the initial workspace trust prompt.

  • --dangerously-skip-permissions: Disables all permission checks, not just the trust prompt. Overkill for this use case.

  • -p flag: Skips trust but only works in non-interactive mode.

  • Manually confirming each time: Current workaround, but adds unnecessary friction on every new worktree.

Priority

Medium - Would be very helpful

Feature Category

Configuration and settings

Use Case Example

  1. Developer works on a monorepo at ~/repos/my-project/
  2. They create worktrees via git worktree add ~/worktrees/my-project/feature-xyz feature-xyz
  3. They run claude in the new worktree directory
  4. Currently: trust prompt appears every time for each new worktree
  5. With this feature: directories under ~/worktrees/my-project/* would be auto-trusted via a glob pattern

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions