Home / Claude Code mods / Security / path-guard

path-guard

path-guard is a Claude Code mod by Justmalhar that blocks Write, Edit and MultiEdit calls that target a path outside the project root or inside .git, plus optional deny globs.

Updated 2026-10-04

What is path-guard?

path-guard is a Claude Code mod by Justmalhar that blocks Write, Edit and MultiEdit calls that target a path outside the project root or inside .git, plus optional deny globs. It is listed under Security and has 1 GitHub stars.

TypeClaude code mod
AuthorJustmalhar
RepositoryJustmalhar/awesome-claude-mods
Popularity1 GitHub stars
CategorySecurity
SecurityLow risk (88/100)
Rank#1,890 of 5,272 Claude Code mods; #223 in Security
LicenseMIT
Last commit2026-10-04
Hooks1 events
Seesevery tool call
Draws onnothing

Is path-guard safe to install?

path-guard scores 88/100 on the MCPMods security check: Low risk. Things to review: reads environment variables. It passed 7 of 8 checks.

Mod footprints come from claude plugin validate, which lists every event a mod hooks and every API call it makes without running it.

CheckResult
No network accessPass
Starts no processesPass
Writes no files or configPass
Reads environment variablesReview
Only sees the events it hooksPass
Doesn't drive ClaudePass
Passes claude plugin validatePass
Has an open-source licensePass

API calls in its code

CallWhat it means
$.env.getreads env vars
$.session.cwd
$.session.repo

How do I install path-guard?

  1. Check your Claude Code version. Mods need Claude Code 2.1.287 or later and are on by default.
    claude --version
  2. Read its footprint. This lists every event it hooks and every API call it makes, without running it.
    git clone https://github.com/Justmalhar/awesome-claude-mods
    claude plugin validate ./awesome-claude-mods/mods/path-guard
  3. Install it. Run this in your terminal, then /reload-plugins in an open session.
    claude plugin marketplace add Justmalhar/awesome-claude-mods && claude plugin install path-guard@awesome-claude-mods

Or ask Claude to set it up

Paste this into Claude Code and it installs path-guard for you:

Install the "path-guard" Claude Code mod from https://github.com/Justmalhar/awesome-claude-mods/tree/main/mods/path-guard. Run claude plugin validate on it first and show me what it can access before you enable it.

More from Justmalhar/awesome-claude-mods

This repository has at least 9 Claude Code mods on MCPMods.

  • auto-checkpoint: Snapshots the working tree into hidden git refs at the start of every turn, with /checkpoints to list them and /undo-tur (Low risk)
  • branch-guard: Stops Claude from editing files or running mutating git commands on main or master, and points it at a worktree instead. (Low risk)
  • cost-bar: A one-row band above the prompt with session cost, 5h/7d plan limits and an optional budget bar. (Low risk)
  • file-tree-pane: Adds /tree: a side pane with a lazy file tree coloured by git status. Press a file to put @path in the prompt. (Low risk)
  • notify-on-finish: Sends a desktop notification when a long turn finishes, so you can look away while Claude works. (Low risk)
  • powerline-bar: A one-row powerline-style band above the prompt: directory, git branch and state, model, context fill. (Review before installing)
  • secret-guard: Blocks Write, Edit and Bash calls that would put an API key, token or private key into a file or command. (Low risk)
  • sensitive-file-guard: Blocks Read, Write, Edit, Grep, Glob and Bash calls that touch .env files, private keys and credential stores. (Low risk)