Skip to content

Relative path permission patterns don't match absolute tool paths #18200

Description

@markus-psx

Description

Relative path patterns in permissions.allow (e.g., Write(.claude/**)) don't prevent permission prompts when the Write tool uses absolute paths internally.

Steps to Reproduce

  1. Create .claude/settings.json in a project with:
{
  "permissions": {
    "allow": [
      "Write(.claude/**)",
      "Write(./**)"
    ]
  }
}
  1. Restart Claude Code session (to load fresh permissions)

  2. Ask Claude to write a file to the .claude/ directory

  3. Claude uses the Write tool with an absolute path like:
    /Users/username/path/to/project/.claude/temp-file.txt

  4. Result: Permission prompt appears despite the Write(.claude/**) rule

Expected Behavior

According to the documentation, patterns like .claude/** or ./path should resolve relative to the current working directory. The pattern Write(.claude/**) should match writes to any file in the .claude/ subdirectory without prompting.

Actual Behavior

The permission prompt still appears, suggesting the relative pattern isn't being matched against the absolute path the Write tool uses.

Environment

  • Claude Code CLI
  • macOS (Darwin 25.2.0)
  • Project-level settings in .claude/settings.json

Workaround Attempted

Using absolute paths in user-level ~/.claude/settings.json works, but this isn't portable for team projects where different developers have different checkout paths.

Additional Context

The same settings file has Read(./**) and Edit(./**) patterns - it would be helpful to know if these have the same issue or if it's specific to the Write tool.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions