Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add hooks/fullselfbrowsing/fsb/pre-tool-usegit clone --depth 1 https://github.com/fullselfbrowsing/FSBGrade A, and why
PreToolUse scanned grade A with 0 findings 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 2d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
Copies of this mod
3 near-identical copies found in the catalogue:
- PreToolUse — 100% identical, 0 lines differ
- PreToolUse — 88% identical, 2 lines differ
- PreToolUse — 88% identical, 2 lines differ
How it starts
The opening of the file, as written. The whole thing — 22 lines — stays where its author put it; the contents beside it link to each section on GitHub.
{
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "CMD=$(python3 -c \"import json,sys; d=json.load(sys.stdin); print(d.get('tool_input',d).get('command',''))\" 2>/dev/null || true); case \"$CMD\" in *grep*|*rg\\ *|*ripgrep*|*find\\ *|*fd\\ *|*ack\\ *|*ag\\ *) [ -f graphify-out/graph.json ] && echo '{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"additionalContext\":\"MANDATORY: graphify-out/graph.json exists. You MUST run `graphify query \\\"<question>\\\"` before grepping raw files. Only grep after graphify has oriented you, or to modify/debug specific lines.\"}}' || true ;; esac"
}
]
},
{
"matcher": "Read|Glob",
"hooks": [
{
"type": "command",
"command": "HIT=$(python3 -c \"import json,sys;d=json.load(sys.stdin);t=d.get('tool_input',d);exts=('.py','.js','.ts','.tsx','.jsx','.astro','.vue','.svelte','.go','.rs','.java','.rb','.c','.h','.cpp','.hpp','.cc','.cs','.kt','.swift','.php','.scala','.lua','.sh','.md','.rst','.txt','.mdx');vals=[str(t.get('file_path') or ''),str(t.get('pattern') or ''),str(t.get('path') or '')];j=' '.join(vals).lower().replace(chr(92),'/');tails=[('.'+x.rsplit('.',1)[-1]) for v in vals if v for x in [v.lower().replace(chr(92),'/').rsplit('/',1)[-1]] if '.' in x];sys.stdout.write('1' if 'graphify-out/' not in j and any(tl in exts for tl in tails) else '')\" 2>/dev/null || true); if [ \"$HIT\" = 1 ] && [ -f graphify-out/graph.json ]; then echo '{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"additionalContext\":\"MANDATORY: graphify-out/graph.json exists. You MUST run graphify before reading source files. Use: `graphify query \\\"<question>\\\"` (scoped subgraph), `graphify explain \\\"<concept>\\\"`, or `graphify path \\\"<A>\\\" \\\"<B>\\\"`. Only read raw files after graphify has oriented you, or to modify/debug specific lines. This rule applies to subagents too — include 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.
- 2d ago First seen · 22 lines scan A 175ccf2d7ef7
PreToolUse is a hook published in the GitHub repository fullselfbrowsing/FSB (187 stars, last pushed 5d ago), licensed MIT. Its token cost is not measured: a hook is shell that never enters the context. A static security scan graded it A with 0 findings. 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, executing post_tool_use.js via node. From DevZonayed/Mochi.
Stop
Runs when the agent finishes a response, executing stop.js via node. From DevZonayed/Mochi.
Stop
Runs when the agent finishes a response, executing tlc-cleanup.sh, continuous-execution-hook.sh and stop-validation-hook.sh via bash (3 commands). From johanolofsson72/Claude.
SessionEnd
Runs when a session ends, executing playwright-cleanup.py and dev-env.py via python3 (2 commands). From lukaskellerstein/vex.
SessionStart
Runs when a session starts, executing session_start.js via node. From DevZonayed/Mochi.
PreToolUse
Runs before the agent uses a tool for Read, Edit, Write, Bash, Edit, Write, MultiEdit, Bash, Edit and Write tool calls, executing spec-register-guard-hook.sh, pipeline-state-guard-hook.sh, spec-interview-guard-hook.sh, core-machinery-guard-hook.sh, core-owed-tick-guard-hook.sh, bash-write-guard-hook.sh…