Amagi Hookguard — Security skill for Claude Code
Tested Claude Code PreToolUse/PostToolUse hooks: block destructive shell commands, secret-file reads and force pushes to main, keep a local audit log, and check your settings.json hook wiring with do.
How to install Amagi Hookguard
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open amagilabs/amagi-hookguard and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Amagi Hookguard does
Tested Claude Code PreToolUse/PostToolUse hooks: block destructive shell commands, secret-file reads and force pushes to main, keep a local audit log, and check your settings.json hook wiring with `doctor`.
Alternatives in Security
- Security Guardian — Comprehensive security analysis for RTK CLI tool, focusing on command injection, shell escaping, hook security 11.9k ★
- Secfoo — AI security review CLI: SAST, secret scanning, SCA, threat modeling and architecture review with Claude Code 356 ★
- Omarchy Plugin Security Skill — Agent skill and field guide: the security pitfalls that block Omarchy plugins on the marketplace, from 5,000+ 70 ★
README
amagi-hookguard
Claude Code hooks that stop `rm -rf ~`, a force push to `main`, or a read of your `.env` before they run. One command wires them into `settings.json`. From then on every Bash, PowerShell, Read and Grep call is checked first: the dangerous ones are blocked with a reason Claude can read, and the risky ones (`git reset --hard`, `curl | sh`) open a permission prompt for you to answer. Every call is written to a local log, and `doctor` tells you why a hook in your settings isn't firing.

It has 14 rules, 252 tests and no runtime dependencies. It makes no network calls and needs no API key.
Install
pipx install amagi-hookguard
It isn't on PyPI yet. Until it is, install from a clone:
git clone https://github.com/amagilabs/amagi-hookguard
cd amagi-hookguard
pipx install .
Needs Python 3.9+.
Usage
Wire it in
amagi-hookguard install
Wired hookguard into ~/.claude/settings.json (PreToolUse + PostToolUse, matcher "*", command `amagi-hookguard hook`).
Restart Claude Code (or open /hooks) so it picks up the change, then run: amagi-hookguard doctor
It adds one `PreToolUse` and one `PostToolUse` entry and leaves your other settings and hooks alone. If the file already existed, the old copy is saved next to it as `settings.json.bak-hookguard`. Running it twice doesn't add a second entry.
--scope projectwrites.claude/settings.jsonin the current folder, so the guard travels with the repo.--scope localwrites.claude/settings.local.json.--absolutewrites the full path to the executable, for when Claude Code'sPATHdiffers from your shell's.--dry-runprints the new file without writing it.amagi-hookguard uninstallremoves only hookguard's entries.
Check the wiring
amagi-hookguard doctor
amagi-hookguard doctor 0.1.0
user ~/.claude/settings.json
ok valid JSON
ok 2 command hook(s) found
project ~/myapp/.claude/settings.json
i
Related Skills
Audit Hook Wiring
Validate ~/.claude/settings.json hooks block — event names, file existence, executability, matcher syntax; --f
My Security Review
Run a personal agent-tooling security review - secrets, shell/hook command execution, untrusted input, plugin/
Agent Overwatch
A deterministic guard for AI coding agents — checks each tool call before it runs (allow/ask/deny) and blocks
Claude Code Usage Audit
Where did my Claude Code usage go? Reads local Claude Code and Codex logs and splits the main agent's usage in
Obey
Rule enforcement plugin. Save rules with natural language, enforce with 17 lifecycle hooks. Three scopes (glob
Claude Deploy Kit
Enterprise controls for deploying Claude agents: policy chokepoint, destructive-command deny-hook, eval gate,
Related Agents
Project Automation Auditor
Audits a project's automation and verification posture: test runner, formatter/linter PostToolUse hooks, PreTo
Claude Code Integration
Claude Code 本体の仕様に関する専門家。hooks(PreToolUse, SubagentStop 等)のペイロード、.claude/agents/.md のフォーマット、settings.json、セッショ
Git Workflow Master
Use for git hygiene: branches, worktrees, commit messages in the repository's convention, rebases, cherry-pick