Borrowing it
Nothing to install: this file belongs to jgiox/goodvibes. 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/jgiox/goodvibes/main/.gemini/settings.jsongit clone --depth 1 https://github.com/jgiox/goodvibesWrote 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/jgiox/goodvibes/before-tool)<a href="https://agentmods.dev/hooks/jgiox/goodvibes/before-tool"><img src="https://agentmods.dev/badge/hooks/jgiox/goodvibes/before-tool/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/jgiox/goodvibes/before-tool"><img src="https://agentmods.dev/badge/hooks/jgiox/goodvibes/before-tool.svg" alt="Reviewed on agentmods" width="80" height="20"></a>Grade C, and why
BeforeTool 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 1mo 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.
Reaches for credential fileshighPrivilege escalation
SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.
"command": ": goodvibes-read-guard; case $GOODVIBES_READ_GUARD in off) exit 0;; esac; M=$(awk 'function dec(s, h, x) { gsub(/\\\\\"/, \"\\\"\", s); gsub(/\\\\n/, \"\\n\", s); gsub(/\\\\t/, \"\\t\", s); gsub(/\\\\r/, \"\" This is a copy
92% identical to PreToolUse — 8 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 — 24 lines — stays where its author put it; the contents beside it link to each section on GitHub.
{
"BeforeTool": [
{
"matcher": "^run_shell_command$",
"hooks": [
{
"type": "command",
"name": "goodvibes-journal-gate",
"command": ": goodvibes-journal-gate; IN=$(tr -d \"\\r\\n\"); case $IN in *'\"command\"'*|*'\"command_line\"'*) ;; *) exit 0;; esac; CMD=$(printf \"%s\" \"$IN\" | sed -E \"s/.*\\\"command(_line)?\\\"[[:space:]]*:[[:space:]]*\\\"((\\\\\\\\.|[^\\\"\\\\\\\\])*)\\\".*/\\\\2/\"); case $CMD in *git*) ;; *) exit 0;; esac; RES=$(printf \"%s\" \"$CMD\" | awk '{ gsub(/\\\\\\\\/, \"\\001\"); n = split($0, L, /\\\\n/); d = \"\"; nh = 0; sep = \"\"; for (i = 1; i <= n; i++) { l = L[i]; if (d != \"\") { t = l; if (dash) sub(/^(\\\\t)+/, \"\", t); if (t == d) { d = \"\"; nh = 0 } else H[++nh] = l; continue } if (l ~ /^([ ]|\\\\t)*#/) continue; printf \"%s%s\", sep, l; sep = \"\\\\n\"; if (match(l, /(^|[^<])<<-?[ ]*\\\\?[\\042\\047]?[^ \\t;&|<>()\\042\\047\\\\]+/) && l !~ /(^|[|;&(`]|\\$\\()[ ]*((sudo|doas|env|exec|command|nohup|time|timeout|nice|xargs)[ ]+([^ |;&]+[ ]+)*)?([^ |;&<]*\\/)?(sh|bash|zsh|dash|ksh|ssh|eval)([ <]|$)/) { d = substr(l, RSTART, RLENGTH); dash = (d ~ /<<-/); sub(/^[^<]?<<-?[ ]*\\\\?[\\042\\047]?/, \"\", d) } } for (j = 1; j <= nh; j++) printf \"\\\\n%s\", H[j]; print \"\" }' | awk 'function fl() { if (st) { nt++; T[nt] = cur; TU[nt] = cu; TD[nt] = cdl; TT[nt] = ctl; TO[nt] = cu && cur ~ /^(&&|\\|\\||;|&|\\||\\(|\\)|`|\\$\\(|\\n)$/ } cur = \"\"; st = 0; cu = 1; cdl = 0; ctl = 0 } function res(k, v) { if (k > nt || TO[k]) return \"\"; v = T[k]; if (TT[k]) { if (v !~ /^~(\\/|$)/ || HM == \"\") return \"\"; v = HM substr(v, 2) } else if (TD[k]) { if (TD[k] != 1 || v !~ /^\\$(HOME|\\{HOME\\})(\\/|$)/ || HM == \"\") return \"\"; sub(/^\\$(HOME|\\{HOME\\})/, \"\", v); v = HM v } if (v ~ /^-/ || v ~ /\\n/) return \"\"; return v } BEGIN { HM = ENVIRON[\"HOME\"]; QF = \"\\047[^\\047]*\\047|\\\"[^\\\"]*\\\"\"; QS = QF \"|\\001\\047\"; cu = 1 } { s = $0; gsub(/\\001\\001/, \"\\004\", s); gsub(/\\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.
- 1mo ago First seen · 24 lines scan C 11502f11c721
BeforeTool is a hook published in the GitHub repository jgiox/goodvibes (5 stars, last pushed 6d ago), 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 C with 1 finding (reaches for credential files). It is 92% identical to PreToolUse, differing in 8 lines, and is treated as a copy.
Other hooks, from other repositories
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.
PreToolUse
Runs before the agent uses a tool, executing pre-write.sh and pre-bash.sh (2 commands). From anthropics/claude-cookbooks.
PostToolUse
Runs after a tool call finishes for Bash tool calls, executing hooks.sh via sh (3 commands). From anthropics/claude-plugins-official.