Borrowing it
Nothing to install: this file belongs to ForgeyClap/claude-forge. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/ForgeyClap/claude-forge/main/.claude/settings.jsongit clone --depth 1 https://github.com/ForgeyClap/claude-forgeWrote 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/forgeyclap/claude-forge/pre-tool-use)<a href="https://agentmods.dev/hooks/forgeyclap/claude-forge/pre-tool-use"><img src="https://agentmods.dev/badge/hooks/forgeyclap/claude-forge/pre-tool-use/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/hooks/forgeyclap/claude-forge/pre-tool-use"><img src="https://agentmods.dev/badge/hooks/forgeyclap/claude-forge/pre-tool-use.svg" alt="Reviewed on agentmods" width="80" 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 28d 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.
"_doc": "2026-09-24 (v2.7.0, WP16 + security wp9b + review wp9a): the GATE HOOK. Before every Bash or PowerShell tool call it asks forge-actiongate.cjs whether the command trips one of FIVE command hard gates (a classifi 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|PowerShell",
"hooks": [
{
"type": "command",
"command": "node \"$CLAUDE_PROJECT_DIR/.claude/forge-bin/forge-gate-hook.cjs\"",
"timeout": 10
}
],
"_doc": "2026-09-24 (v2.7.0, WP16 + security wp9b + review wp9a): the GATE HOOK. Before every Bash or PowerShell tool call it asks forge-actiongate.cjs whether the command trips one of FIVE command hard gates (a classifier, not a proof) — destructive-delete (rm -rf, rm -r, Remove-Item -Recurse, rd /s, rimraf), kill-by-name (taskkill /IM or a non-PID /FI, Stop-Process -Name, pkill, kill $(pgrep …)), git-destructive (reset --hard, clean -f, checkout -f / . / -- <path>, restore <path>, switch -f, stash drop/clear) opaque-exec (a pipe into a shell, eval/iex, sh -c on a variable, an encoded PowerShell command) or, since 2.9.0, secret-print (printing the contents of a secret file: a .env file, a key, a credentials file or anything in secrets/, via cat/type/Get-Content, grep and friends, git show/log -p/diff/blame or find -exec; .env.example and the names-only helper forge-env-names.cjs stay allowed) — or tries to switch the gate itself off. Exit 2 = blocked with a plain NL+EN reason and Claude must ask the owner; exit 1 = not blocked but VISIBLE (gate is off, or the hook could not check the call); exit 0 = allowed. Quoted data (writer heredocs, echo/commit-message/log-event/search-tool literals) is not treated as a command, and a delete whose every target is provably inside _scratch/, node_modules/, dist/ or the temp dir passes. The owner-approved one-off off-switch is `node .claude/forge-bin/forge-config.cjs set gate-hook off --once \"<owner's words>\"` (10 minutes); the owner can also run a command himself with `!`. Timeouts in this file are SECONDS (Claude Code hook contract). The permissions.deny block keeps .env variants, keys and secrets out of Claude's Read tool; .env.example stays readable. Details and honest lWhat else settings.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.
- 28d ago Changed 8b7dcc77fe92
- 1mo ago Changed 738f47d9ef8d
- 1mo ago First seen · 15 lines scan C e9517d9be633
PreToolUse is a hook published in the GitHub repository ForgeyClap/claude-forge (2 stars, last pushed 29d 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-09-25.
Other hooks, from other repositories
UserPromptSubmit
Runs when you submit a prompt, before the agent sees it, executing reminder.sh via bash. From itsinseong/value-for-fable.
SessionStart
Runs when a session starts, executing session-start.sh via bash. From fazxes/Claude-code.
SessionStart
Runs when a session starts on startup, executing install_pkgs.sh. From supabase/supabase.
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, 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.