Skip to content

Absolute paths converted to tilde paths, breaking permission matching #16800

Description

@jwhartley

Description

When making Read/Write/Edit tool calls with absolute paths (e.g., /Users/james/github/...), Claude Code appears to convert them to tilde paths (~/github/...) somewhere in the pipeline. This breaks permission matching when permissions are defined with absolute paths.

Steps to Reproduce

  1. Configure ~/.claude/settings.json with absolute path permissions:
{
  "permissions": {
    "allow": [
      "Read(/Users/james/**)",
      "Write(/Users/james/github/**)",
      "Edit(/Users/james/github/**)"
    ]
  }
}
  1. In a Claude Code session, Claude makes a tool call like:
Read(file_path="/Users/james/github/solutions-projects/CLAUDE.md")
  1. The UI displays the call as:
⏺ Read(~/github/solutions-projects/CLAUDE.md)
  1. Permission prompt appears even though the absolute path should match Read(/Users/james/**)

Expected Behavior

  • Absolute paths in tool calls should remain absolute for permission matching
  • Read(/Users/james/github/file.md) should match Read(/Users/james/**) permission

Actual Behavior

  • Paths appear to be normalized to tilde form (~/...)
  • ~/github/file.md does not match Read(/Users/james/**) pattern
  • Permission prompts appear despite having appropriate permissions configured

Environment

  • Claude Code version: 2.1.1
  • OS: macOS (Darwin 24.6.0)
  • Shell: zsh

Related Issues

Workaround

Currently none known. Adding both tilde and absolute path versions to permissions doesn't help if the conversion happens after the tool call is made but before permission checking.

Additional Context

This issue manifests alongside the "allow reading from X from this project" prompts, which appear to be a separate project-scoped permission layer. The combination of tilde conversion and project-scoped permissions makes it very difficult to configure Claude Code for autonomous operation without permission prompts.

Activity

  1. jwhartley commented on Jan 8, 2026

    @jwhartley
    Author

    Update: Found the Solution

    After more investigation, I found that the permission matching issue is resolved by using double-slash // for absolute paths:

    The Fix

    {
      "permissions": {
        "allow": [
          "Read(//Users/james/**)",
          "Write(//Users/james/github/**)",
          "Edit(//Users/james/github/**)"
        ]
      }
    }

    Why This Works

    Format Interpretation
    /Users/james/** Relative path (from settings file location)
    //Users/james/** Absolute filesystem path
    ~/github/** Home directory expansion

    The single-slash format I was using was being interpreted as a relative path, not an absolute path. This is documented in #6881.

    Recommendation

    This issue can probably be closed as "not a bug" - the path format was the problem. However, it would be helpful if:

    1. Claude Code generated // paths when users accept permission prompts (currently generates single-slash)
    2. The documentation made this clearer

    The UI still shows tilde paths (~/github/...) but permission matching works correctly with // format.

  2. jwhartley commented on Jan 8, 2026

    @jwhartley
    Author

    Closing - the root cause was using single-slash paths instead of double-slash. Using //Users/james/** instead of /Users/james/** resolves the permission matching. See my previous comment for details.

  3. github-actions commented on Jan 16, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  4. locked as resolved and limited conversation to collaborators on Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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