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/heygen-com/hyperframes/pre-tool-usegit clone --depth 1 https://github.com/heygen-com/hyperframesGrade A, and why
PreToolUse scanned grade A 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 yesterday.
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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
"command": "node -e \"\nconst chunks = [];\nprocess.stdin.on('data', d => chunks.push(d));\nprocess.stdin.on('end', () => {\n const input = JSON.parse(Buffer.concat(chunks).toString());\n const cmd = input.tool_input?.co How it starts
The opening of the file, as written. The whole thing — 15 lines — stays where its author put it; the contents beside it link to each section on GitHub.
{
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"timeout": 180,
"statusMessage": "Running build + lint + typecheck before commit…",
"command": "node -e \"\nconst chunks = [];\nprocess.stdin.on('data', d => chunks.push(d));\nprocess.stdin.on('end', () => {\n const input = JSON.parse(Buffer.concat(chunks).toString());\n const cmd = input.tool_input?.command || '';\n if (!/git\\s+commit\\b/.test(cmd)) process.exit(0);\n const { execSync } = require('child_process');\n const fs = require('fs');\n const path = require('path');\n const os = require('os');\n // A leading 'cd <path>' in the command is the real target directory:\n // Claude Code prefixes this whenever the session's tracked cwd differs\n // from this hook process's own cwd (e.g. a sibling repo worktree) — the\n // hook process itself always inherits the primary working directory,\n // never the command's actual target.\n function resolveTargetDir() {\n const m = cmd.match(/^\\s*cd\\s+('([^']+)'|(\\S+))\\s*(?:&&|;|\\n|$)/);\n if (m) {\n let dir = m[2] || m[3];\n if (dir.startsWith('~')) dir = path.join(os.homedir(), dir.slice(1));\n dir = path.resolve(process.cwd(), dir);\n if (fs.existsSync(dir)) return dir;\n }\n return process.cwd();\n }\n const targetDir = resolveTargetDir();\n let repoRoot;\n try {\n repoRoot = execSync('git rev-parse --show-toplevel', { cwd: targetDir, encoding: 'utf8' }).trim();\n } catch {\n process.exit(0);\n }\n // Only this repo's own bun build/lint/typecheck applies — skip silently\n // for any other repo (e.g. a sibling Go/Python repo touched in the same session).\n const pkgPath = path.join(repoRoot, 'package.json');\n if (!fs.existsSync(pkgPath)) process.exit(0);\n let pkg;\n try {\n pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));\n } catch {\n process.exit(0);\n }\n if (pkg.name !== 'hyperframes-monorepo') process.eWhat 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.
- yesterday First seen · 15 lines scan A 8eff150d1739
PreToolUse is a hook published in the GitHub repository heygen-com/hyperframes (43,141 stars, last pushed yesterday), licensed Apache-2.0. Its token cost is not measured: a hook is shell that never enters the context. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other hooks, from other repositories
SessionStart
Runs when a session starts, executing check-setup.sh via bash. From KumarSashank/motiscope.
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, executing pre-write.sh and pre-bash.sh (2 commands). From anthropics/claude-cookbooks.
SessionStart
Runs when a session starts, executing session-start.sh. From anthropics/claude-cookbooks.