Skip to content

[BUG] Workspace Trust Dialog Not Respecting Pre-configured ~/.claude/.claude.json #9113

@matguthrie

Description

@matguthrie

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Workspace trust dialogs appear every time Claude Code is launched in a git worktree subdirectory, even when the worktree path has been pre-configured in ~/.claude/.claude.json with allowedTools: []. This blocks automated multi-agent orchestration workflows where Claude instances are spawned
programmatically in isolated worktrees.

The ~/.claude/.claude.json configuration correctly contains the worktree path:
{
"projects": {
"/workspace/worktrees/initialize-blazor-server-project-task-qnh0ys8fs": {
"allowedTools": []
}
}
}

However, when spawning Claude in this exact path, the "Do you trust the files in this folder?" dialog still appears, requiring manual approval despite the pre-configuration.

What Should Happen?

When a workspace path is pre-configured in ~/.claude/.claude.json under the projects object with allowedTools: [], Claude Code should recognize this as a trusted workspace and skip the workspace trust dialog on launch.

This would enable:

  • Automated spawning of Claude instances in worktrees without manual intervention
  • Multi-agent orchestration systems where multiple Claude instances work in parallel
  • CI/CD integration where Claude processes run in subdirectories

Error Messages/Logs

Steps to Reproduce

  1. Create a git worktree subdirectory:
    git worktree add /workspace/worktrees/test-task-123 -b test-branch
  2. Pre-configure workspace trust in ~/.claude/.claude.json:
    cat > ~/.claude/.claude.json << 'EOF'
    {
    "projects": {
    "/workspace/worktrees/test-task-123": {
    "allowedTools": []
    }
    }
    }
    EOF
  3. Launch Claude Code in the worktree with permission bypass flags:
    cd /workspace/worktrees/test-task-123
    claude --dangerously-skip-permissions --permission-mode bypassPermissions
  4. Expected: Claude launches without prompts
    Actual: "Do you trust the files in this folder?" dialog appears

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.0.8

Claude Code Version

2.0.10

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

Environment:

  • Claude Code Version: 2.0.9+
  • Platform: Linux (WSL2 in Docker devcontainer)
  • Terminal: tmux
  • Parent directory: Git repository with worktrees
  • Worktree structure: /workspace/worktrees/{task-id}/

Workaround:
Manually clicking "Yes, proceed" on first launch per worktree, but this defeats automated workflows.

Feature Request:
Add a command-line flag like --trusted-workspace or --skip-trust-dialog for automation use cases where the workspace is known to be safe.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corearea:securityautocloseIssue will be closed automaticallybugSomething isn't workinghas reproHas detailed reproduction stepsplatform:windowsIssue specifically occurs on Windows

    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