claude-code-pathfix 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,6 +83,13 @@ Add this to your Claude Code settings (`~/.claude/settings.json`):
|
|
|
83
83
|
|
|
84
84
|
That's it. One step. `npx` downloads and caches the package automatically on first run — no global install needed.
|
|
85
85
|
|
|
86
|
+
Or, have Claude Code configure itself:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
claude -p --allowedTools "Edit(~/.claude/settings.json)" \
|
|
90
|
+
"Add a PreToolUse hook to your user settings.json: matcher 'Bash', type 'command', command 'npx -y claude-code-pathfix'"
|
|
91
|
+
```
|
|
92
|
+
|
|
86
93
|
## What it converts
|
|
87
94
|
|
|
88
95
|
| Input | Output |
|
|
@@ -95,11 +102,17 @@ That's it. One step. `npx` downloads and caches the package automatically on fir
|
|
|
95
102
|
### What it doesn't touch
|
|
96
103
|
|
|
97
104
|
- Paths that are already POSIX (`/d/Users/Tom/...`)
|
|
98
|
-
- Relative paths (
|
|
105
|
+
- Relative paths with backslashes (`src\file.ts`) — see tip below
|
|
99
106
|
- URLs (`https://example.com`)
|
|
100
107
|
- Escape sequences (`\n`, `\t`)
|
|
101
108
|
- Non-path backslash usage (`grep 'foo\|bar'`)
|
|
102
109
|
|
|
110
|
+
> **Tip:** This hook can only reliably detect Windows paths that start with a drive letter (`C:\...`). Relative paths with backslashes (`src\components\App.tsx`) are ambiguous in bash and can't be safely distinguished from escape sequences. To get the most out of this hook, add the following to your project's `CLAUDE.md`:
|
|
111
|
+
>
|
|
112
|
+
> ```
|
|
113
|
+
> Always use absolute paths in shell commands.
|
|
114
|
+
> ```
|
|
115
|
+
|
|
103
116
|
## Cross-platform safe
|
|
104
117
|
|
|
105
118
|
**If your Claude Code settings are symlinked across Windows and WSL** (a common setup), `claude-code-pathfix` detects the platform at startup and silently exits on non-Windows systems. It will never interfere with native Linux or macOS Bash commands.
|
package/package.json
CHANGED