[BUG/FEATURE] PreToolUse hook resolving path
Resolved 💬 3 comments Opened May 16, 2026 by poof86 Closed May 17, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The PreToolUse file_path tool input data is being resolved/normalised to an absolute path, making it impossible to get the original path information that was passed to the tool call. This wasn't the case in earlier versions of Claude Code.
What Should Happen?
In PreToolUse the actual tool input should be passed as the file_path value or at the very least add a property that preserves it.
Error Messages/Logs
Steps to Reproduce
Read("./p1-child-dir/../src/file.ts")
PreToolUse receives:
{
"tool_input": { "file_path": "/home/claude/projects/p1/src/file.ts" }
}
❌ original path is GONE
PostToolUse receives:
{
"tool_input": { "file_path": "/home/claude/projects/p1/src/file.ts"},
"tool_response": { "file": { "filePath": "./p1-child-dir/../src/file.ts" }
}
✅ original path is PRESERVED
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.143
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗