Skip to content

[BUG] /add-dir directories should inherit existing permission rules #36682

Description

@toddthetrainnut

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?

When using /add-dir to add an additional working directory, commands that access paths in that directory still prompt for permission — even when the user has broad allow rules like Bash(ls *) and Read in their settings.

What Should Happen?

The command should run without prompting, since:

  • Bash/Read/Glob/Grep is in the allow list
  • The directory was explicitly added via /add-dir

Error Messages/Logs

ls /c/Source/Server/MyProject/ | grep -i "SOMEFILE"
Run shell command

Do you want to proceed?
❯ 1. Yes
  2. Yes, allow reading from //c/EpicSource/TS2M/AnotherProject/M-routines/ from this project
  3. No

Steps to Reproduce

  1. Configure global settings (~/.claude/settings.json) with:
    "permissions": {
    "allow": ["Read", "Glob", "Grep", "Bash(ls *)"]
    }
  2. Start Claude Code in a project directory (e.g., /c/Source/Client/MyProject)
  3. Use /add-dir /c/Source/Server/MyProject to add a second working directory
  4. Claude runs a Bash or Read command that reads from the added directory

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.80

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions