Path portability guard
A deterministic Claude Code PreToolUse gate for Write, Edit, and MultiEdit that rejects Windows-reserved names, forbidden characters, trailing dots or spaces, control bytes, and case-fold collisions with existing siblings.
Runs on
What it does
Block new repository paths that are invalid or collision-prone across common filesystems.
When it fires
- implementation
- review
- maintenance
How it behaves
Validate proposed repository paths for cross-platform filename safety and sibling case-fold collisions.
It does not rename, move, delete, normalize, transliterate, or create a requested path.
It does not guarantee portability to every filesystem, archive format, or deployment target.
It does not follow project-defined ignore files or inline exceptions authored by the agent.
It does not inspect file content or infer whether a portability issue is intentional.
Configuration
targets/claude-code/path-portability-guard.mjs
- Version
- 1.0.0
- Requires
- node
- Licence
- RiskThis automatic gate blocks new repository paths that are invalid or collision-prone across common filesystems; a false denial can interrupt legitimate work, but it does not execute the blocked action.
- Medium
- ModeHow it works: fixed rules, model instructions, or both.
- Deterministic only
- Behaviour
- Enforces, blocks on violation
- On failure
- Denies and blocks
- LatencyThe entrypoint handles one intercepted event to block new repository paths that are invalid or collision-prone across common filesystems without deferred work.
- Immediate
- Data retentionWhether data remains after use and who manages its storage.
- Not retained
Often used with
All in Operations