Command Guard

Use when an agent's shell tool needs a guard: block catastrophic commands before they run.

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add SamueleBassoli/hermes-fleet-apps --skill command-guard
Manual install
git clone --depth 1 https://github.com/SamueleBassoli/hermes-fleet-apps.git /tmp/hermes-fleet-apps
mkdir -p ~/.claude/skills
cp -r /tmp/hermes-fleet-apps/roles/coder/skills/command-guard ~/.claude/skills/command-guard

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Command Guard

A denylist that stops an agent's shell tool from running catastrophic commands.
One plain-text pattern file, one small Python adapter, one regression suite.

It guards against **accidents**, not a hostile agent. A regex cannot see through
`python -c "shutil.rmtree('/')"`. Treat it as a seatbelt, not a cage.

## File map

```
  ~/.agents/hooks/dangerous-patterns.txt   THE denylist - one regex per line
  ~/.agents/hooks/deny_dangerous.py        adapter - hook JSON in, exit 2 blocks
  ~/.agents/hooks/test_guard.py            regression suite - run after EVERY edit
```

The folder is a suggestion; any user-level folder works if every agent's config
points at the same files. Pure stdlib Python. No `jq`, no bash, no deps — chosen
because git-bash on Windows has no `jq`, and a bash guard that needs it does not
work there.

## Build it if it is missing

This skill ships the method, not the files. If the three files are not there:

1. **Pattern file.** One Python regex per line, `#` for comments. Start from the
   groups in "What it covers" below.
2. **Adapter, about 50 lines.** Read the hook JSON from stdin, take the command
   (`tool_input.command` for Claude Code, `.command` for Cursor-shaped payloads),
   match it against every line with `re.MULTILINE | re.IGNORECASE`. On a match,
   print the reason to stderr and exit 2. On any error (no file, bad JSON, bad
   regex line), exit 0: see "Fails open" below.
Read the full skill on GitHub

Details

Skill name
command-guard
Path
roles/coder/skills/command-guard/SKILL.md
License
MIT
Repo updated
31 October 2026

FAQ

What does the Command Guard skill do?

Use when an agent's shell tool needs a guard: block catastrophic commands before they run.

How do I install the Command Guard skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add SamueleBassoli/hermes-fleet-apps --skill command-guard. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Command Guard popular?

It lives in SamueleBassoli/hermes-fleet-apps, which has 44 GitHub stars and 0 forks.

Related skills

Browse the most popular Claude skills, all ai, llms & agents skills, or write your own with the skills generator.