Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Run automatically on Claude Code events. Claude doesn't decide.
1 caution to review before installing
A hook runs when Claude uses the Bash tool
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Stop burning tokens on Windows path errors.
Every time Claude Code generates a Bash command on Windows, there's a coin flip: will it use D:\Users\Tom\file.txt or /d/Users/Tom/file.txt? The wrong one fails, Claude reasons about the error, retries, sometimes fails again — and you pay for every token.
claude-code-pathfix makes the problem disappear. It's a zero-config PreToolUse hook that silently rewrites Windows paths to POSIX format before Bash commands execute. No errors. No retries. No wasted tokens.
Claude Code runs Bash (Git Bash / MSYS2) on Windows, but the AI constantly generates Windows-style paths:
# What Claude generates
cat D:\Users\Tom\.claude\settings.json
git -C C:\dev\myproject status
ls "C:\Program Files\Git\bin"
# What Git Bash actually needs
cat /d/Users/Tom/.claude/settings.json
git -C /c/dev/myproject status
ls "/c/Program Files/Git/bin"
Each failure triggers a retry loop:
This is the most common source of wasted tokens on Windows. There are 15+ open issues about it in the Claude Code repo.
Install claude-code-pathfix and add two lines to your settings. Every Bash command is silently intercepted, paths are converted, and the corrected command executes on the first try.
Before: 3-4 attempts per path error × multiple errors per session = hundreds of wasted tokens
After: zero failures, zero retries, zero wasted tokens
The blog post Fixing Claude Code's PowerShell Problem with Hooks pioneered the idea of using hooks to catch Windows path errors. That approach blocks commands with bad paths and forces Claude to retry with the correct format — a "block-and-correct" pattern. The author reported going from "three attempts per PowerShell operation" to "zero failures."
claude-code-pathfix takes this further:
| netnerds.net approach | claude-code-pathfix | |
|---|---|---|
| Mechanism | Block the command, force a retry | Transparently rewrite the command |
| Retries needed | 1 (Claude must resubmit) | 0 (fixed before execution) |
| Tokens saved | ~60% of retry cost | ~100% of retry cost |
| Claude awareness | Claude sees the block, reasons about it | Claude never knows — command just works |
| Scope | PowerShell commands | All Bash commands |
The key difference: blocking still costs a round-trip. Claude sees the error, thinks about it, and resubmits — that's tokens spent on reasoning about a problem that could have been silently fixed. claude-code-pathfix uses Claude Code's updatedInput feature (shipped in v2.0.10) to rewrite the command in-flight. The AI never sees an error because there isn't one.
Inside Claude Code, run:
/plugin marketplace add fnrhombus/claude-plugins
/plugin install claude-code-pathfix@fnrhombus-plugins
Done. The hook is registered automatically — no settings.json edits required. Uninstall with /plugin uninstall claude-code-pathfix@fnrhombus-plugins.
The marketplace at
fnrhombus/claude-pluginsauto-discovers everyfnrhombusplugin tagged with theclaude-code-plugintopic, so adding it once gives you access to all of them.
Add this to your Claude Code settings (~/.claude/settings.json):
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "npx -y claude-code-pathfix"
}
]
}
]
}
}
npx downloads and caches the package automatically on first run — no global install needed.
Or, have Claude Code configure itself:
claude -p --allowedTools "Edit(~/.claude/settings.json)" \
"Add a PreToolUse hook to your user settings.json: matcher 'Bash', type 'command', command 'npx -y claude-code-pathfix'"
| Input | Output |
|---|---|
D:\Users\Tom\file.txt | /d/Users/Tom/file.txt |
C:\dev\myproject\src\index.ts | /c/dev/myproject/src/index.ts |
"C:\Program Files\Git\bin" | "/c/Program Files/Git/bin" |
E:\data\export\ | /e/data/export/ |
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
claude-code-pathfix@fnrhombus-plugins is listed by fnrhombus/claude-plugins — review the source before installing
npx claudepluginhub fnrhombus/claude-plugins --plugin claude-code-pathfixPlugins from other owners that cover similar ground