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 settings/shanraisshan/claude-code-hooks/settingsgit clone --depth 1 https://github.com/shanraisshan/claude-code-hooksGrade A, and why
claude-code-hooks 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 body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
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.
This is a copy
95% identical to claude-code-best-practice — 90 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 400 lines — stays where its author put it; the contents beside it link to each section on GitHub.
{
"disableAllHooks": false,
"hooks": {
"PreToolUse": [
{
"hooks": [
{
"type": "command",
"command": "python3 ${CLAUDE_PROJECT_DIR}/.claude/hooks/scripts/hooks.py",
"timeout": 5000,
"async": true,
"statusMessage": "PreToolUse"
}
]
}
],
"PermissionRequest": [
{
"hooks": [
{
"type": "command",
"command": "python3 ${CLAUDE_PROJECT_DIR}/.claude/hooks/scripts/hooks.py",
"timeout": 5000,
"async": true,
"statusMessage": "PermissionRequest"
}
]
}
],
"PostToolUse": [
{
"hooks": [
{
"type": "command",
"command": "python3 ${CLAUDE_PROJECT_DIR}/.claude/hooks/scripts/hooks.py",
"timeout": 5000,
"async": true,
"statusMessage": "PostToolUse"
}
]
}
],
"PostToolUseFailure": [
{
"hooks": [
{
"type": "command",
"command": "python3 ${CLAUDE_PROJECT_DIR}/.claude/hooks/scripts/hooks.py",
"timeout": 5000,
"async": true,
"statusMessage": "PostToolUseFailure"
}
]
}
],
"PostToolBatch": [
{
"hooks": [
{
"type": "command",
"command": "python3 ${CLAUDE_PROJECT_DIR}/.claude/hooks/scripts/hooks.py",
"timeout": 5000,
"async": true,
"statusMessage": "PostToolBatch"
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "python3 ${CLAUDE_PROJECT_DIR}/.claude/hooks/scripts/hooks.py",
"timeout": 5000,
"async": true,
"statusMessage": "UserPromptSubmit"
}
]
}
],
"UserPromptExpansion": [
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 · 400 lines scan A 590a16a460f4
claude-code-hooks is a settings file published in the GitHub repository shanraisshan/claude-code-hooks (531 stars, last pushed 2mo ago), licensed MIT. Its token cost is not measured: this kind of file is read by the harness, not the model. A static security scan graded it A with 0 findings. It is 95% identical to claude-code-best-practice, differing in 90 lines, and is treated as a copy.
Other settings, from other repositories
claude-code-best-practice
Agent settings declaring 30 hook events (PreToolUse, PermissionRequest, PostToolUse, PostToolUseFailure) and 24 allowed tools.
codex-cli-best-practice
Agent settings declaring 27 hook events (PreToolUse, PermissionRequest, PostToolUse, PostToolUseFailure) and 7 allowed tools.
moai-adk
Agent settings declaring 20 hook events (SessionStart, PreCompact, SessionEnd, PreToolUse) and 114 allowed tools.
agentfactory
Agent settings declaring 5 hook events (PreToolUse, SessionStart, PreCompact, UserPromptSubmit).
supabase
Agent settings declaring 2 hook events (SessionStart, PostToolUse).
superset
Agent settings declaring 1 hook event (PreToolUse).