Getting it into your agent
This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.
/plugin marketplace add NYCU-Chung/my-claude-devteam/plugin install my-claude-devteamWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/hooks/nycu-chung/my-claude-devteam/pre-tool-use)<a href="https://agentmods.dev/hooks/nycu-chung/my-claude-devteam/pre-tool-use"><img src="https://agentmods.dev/badge/hooks/nycu-chung/my-claude-devteam/pre-tool-use.svg" alt="Measured on agentmods" height="20"></a>Grade C, and why
PreToolUse scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the commands this hook runs, not an audit. A hook is shell that executes on your machine at the event it names, which is why every command in it is printed with what was found.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
"command": "input=$(cat | jq -r '.input // empty'); if echo \"$input\" | grep -qE 'rm\\s+(-[a-zA-Z]*r[a-zA-Z]*f|--recursive.*--force|-rf)'; then echo 'BLOCKED: rm -rf is dangerous' >&2; exit 2; fi; exit 0", How it starts
The opening of the file, as written. The whole thing — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.
{
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "input=$(cat | jq -r '.input // empty'); if echo \"$input\" | grep -qE 'rm\\s+(-[a-zA-Z]*r[a-zA-Z]*f|--recursive.*--force|-rf)'; then echo 'BLOCKED: rm -rf is dangerous' >&2; exit 2; fi; exit 0",
"description": "Block rm -rf"
},
{
"type": "command",
"command": "input=$(cat | jq -r '.input // empty'); if echo \"$input\" | grep -qE 'git\\s+push.*(-f|--force).*\\s+(main|master)'; then echo 'BLOCKED: Force pushing to main/master is not allowed.' >&2; exit 2; fi; exit 0",
"description": "Block force push to main/master"
},
{
"type": "command",
"command": "node -e \"let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const i=JSON.parse(d);const cmd=i.tool_input?.command||'';if(/--no-verify/.test(cmd)){process.stderr.write('[devteam] BLOCKED: --no-verify is not allowed. Let git hooks run.\\n');process.exit(2)}process.stdout.write(d)})\"",
"description": "Block --no-verify flag (git hooks must run)"
},
{
"type": "command",
"command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/branch-protection.js",
"description": "Block direct commits / force pushes on main / master / production"
},
{
"type": "command",
"command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/commit-quality.js",
"description": "Pre-commit: block debugger statements and secrets in staged files"
}
]
},
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "filepath=$(cat | jq -r '.file_path // .filePath // empty'); if echo \"$filepath\" | grep -qE '\\.(env|pem|key)$|/secrets/|credentials'; then echo \"BLOCKED: Cannot modify sensitive file: $filepath\" >&2; exit 2; fi; exit 0",
"description": "Block writes to .What else hooks.json configures
This page is one entry in a file that holds 5. Installing the file brings all of them; each is measured and scanned on its own page.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 74 lines scan C 9257da026713
PreToolUse is a hook published in the GitHub repository NYCU-Chung/my-claude-devteam (269 stars, last pushed 4mo ago), licensed MIT. Its token cost is not measured: a hook is shell that never enters the context. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other hooks, from other repositories
PostToolUse
Runs after a tool call finishes for tool == "Write" && tool_input.file_path matches "config\.json$" tool calls, running an inline shell check. From charles001-wong/autocode-flow.
PostToolUse
Runs after a tool call finishes for Write and Edit tool calls, executing format_and_lint.sh. From supabase/supabase.
SessionStart
Runs when a session starts on startup, executing install_pkgs.sh. From supabase/supabase.
SessionStart
Runs when a session starts, executing on-start.js via node. From google-gemini/gemini-cli.
PreToolUse
Runs before the agent uses a tool for Bash tool calls, running an inline shell check. From apache/superset.
PreToolUse
Runs before the agent uses a tool, executing pre-write.sh and pre-bash.sh (2 commands). From anthropics/claude-cookbooks.