Permission patterns don't match /tmp/ paths when resolved to relative

Resolved 💬 4 comments Opened Feb 26, 2026 by kkauf Closed Mar 27, 2026

Bug

Permission patterns using absolute paths (e.g., Write(/tmp/**)) don't match when Claude Code internally converts the path to a relative traversal (e.g., ../../../../../../tmp/file.txt) before checking permissions.

Repro

  1. Add Write(/tmp/**), Write(/tmp/*), Write(/private/tmp/**), Write(/private/tmp/*) to ~/.claude/settings.json allow list
  2. Open a project with a deeply nested working directory (e.g., ~/Library/Mobile Documents/com~apple~CloudDocs/Documents/Personal Support)
  3. Have Claude call Write with an absolute path: Write("/tmp/test.txt", "hello")
  4. The UI shows the path as ../../../../../../tmp/test.txt (relative to working directory)
  5. User is prompted for permission despite the allow pattern

Expected

The permission system should resolve paths to absolute before matching against allow/deny patterns. Write(/tmp/**) should match regardless of whether the internal representation is /tmp/file.txt or ../../../../../../tmp/file.txt.

Patterns tried (none work)

  • /tmp/* and /tmp/**
  • /private/tmp/* and /private/tmp/** (macOS symlink)
  • **/tmp/* and **/tmp/**

Environment

  • Claude Code v2.1.45
  • macOS (Darwin 25.2.0)
  • Working directory: iCloud path (~/Library/Mobile Documents/com~apple~CloudDocs/...)
  • defaultMode: "acceptEdits"

Notes

  • This previously worked (likely regressed in a recent update)
  • Absolute paths match fine when the working directory is shallow or the project is under /tmp itself
  • The Write tool spec says file_path must be absolute, but the permission system converts it to relative before matching

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗