Back to Mods

Protected Paths Guard

Install Command
npx claude-code-templates@latest --mod security/protected-paths-guard
View on GitHub
claude-code — protected-paths-guard

Scanned by NVIDIA SkillSpector

Automated static analysis (no LLM) · v2.12.0 · 2026-10-17

Partial analysis: some checks could not run on this component.

6 observations
scanner score 55/100

SkillSpector looks for patterns such as shell commands, credential access, network calls or unpinned dependencies. An observation is something worth reading in the files before you install, not a confirmed vulnerability. Components that run code locally, like hooks, MCP servers and security tooling, naturally show more of them.

  • Agent Config Directory Access
    Agent Snooping · README.md:17
  • Credential Access
    Privilege Escalation · .claude-plugin/plugin.json:4
  • Credential Access
    Privilege Escalation · SKILL.md:3
  • Credential Access
    Privilege Escalation · hooks/hooks.json:2
  • Credential Access
    Privilege Escalation · hooks/protected-paths-guard.ts:28

Showing 5 of 6 observations. Learn more about NVIDIA SkillSpector.

Content

Claude Mod. A mod is a complete Claude Code plugin built on function hooks (Anthropic's mods/ layout); it is on by default in Claude Code 2.1.287+. Hooks module: hooks/protected-paths-guard.ts. Options: protect, allow (set in user or managed settings pluginConfigs, or /config). Run claude plugin validate on the installed folder to see every event it hooks and every $ call it makes.

protected-paths-guard

Denies Edit / Write / NotebookEdit calls that target sensitive files (.env, lockfiles, CI workflows, git internals, private keys) unless the path is allowlisted. A tool.call hook under an array matcher (any of the named tools); on a match it returns { deny } without calling next.

If the check itself fails (it throws or runs out of its time budget), the edit is denied, never let through unchecked.

Options

  protect: string  extra globs to protect, comma-separated
  allow:   string  globs that are always allowed (checked first), comma-separated

Declared in .claude-plugin/plugin.json (userConfig). Set them in /config, in user settings (~/.claude/settings.json, not project settings), with --settings <file> or in managed settings:

json
{ "pluginConfigs": { "protected-paths-guard@skills-dir": { "options": { } } } }

Install

sh
npx claude-code-templates@latest --mod security/protected-paths-guard
claude

It is written to .claude/skills/protected-paths-guard/, which Claude Code auto-loads as protected-paths-guard@skills-dir. For one session with hot reload: claude --plugin-dir .claude/skills/protected-paths-guard. claude plugin validate .claude/skills/protected-paths-guard prints every event it hooks and every $ call it makes.

Requirements. Mods are on by default in Claude Code 2.1.287+. Typed against Anthropic's declarations: https://github.com/anthropics/claude-code/tree/main/mods

Stack Builder

0 components

Your stack is empty

Browse components and click the + button to add them to your stack for easy installation.