goodvibes: Hook for Claude Code

.claude/settings.json

PreToolUse is a hook for Claude Code from jgiox/goodvibes. Its token cost is not measured, scanned C, original, Apache-2.0.

A pre-tool hook that runs a shell check before selected Bash, read, or search actions. A hook is an automatic check attached to an agent event; the supplied configuration mainly checks shell commands involving Git.

In plain words
What is it for?
Use it as an automatic guard around the listed tool calls, especially when you need to check Git commands before the agent executes them.
Why use it?
It can inspect commands before they run, helping enforce a repository-specific rule before Git-related shell actions proceed.

Hook for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: positional $N argument.

This is jgiox/goodvibes's own configuration. It tells Claude Code how to work on goodvibes itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything goodvibes configures →

One of 3 entries in settings.json upstream. Installing this one merges just its entry into your config; the other 2 are separate, each on its own page.

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/jgiox/goodvibes/main/.claude/settings.json
Clone the repo
git clone --depth 1 https://github.com/jgiox/goodvibes

Made for: Claude Code.

Wrote 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.

agentmods badge for PreToolUse

README.md
[![agentmods](https://agentmods.dev/badge/hooks/jgiox/goodvibes/pre-tool-use/github.svg)](https://agentmods.dev/hooks/jgiox/goodvibes/pre-tool-use)
Your own site
<a href="https://agentmods.dev/hooks/jgiox/goodvibes/pre-tool-use"><img src="https://agentmods.dev/badge/hooks/jgiox/goodvibes/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.

agentmods 80×15 button for PreToolUse

Your own site · 80×15
<a href="https://agentmods.dev/hooks/jgiox/goodvibes/pre-tool-use"><img src="https://agentmods.dev/badge/hooks/jgiox/goodvibes/pre-tool-use.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session not measured What this adds to a session before it is invoked.
When invoked not measured Not applicable: nothing here is loaded into a session.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Security

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 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/, \"\"
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.claude/settings.json · 22 lines

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": ": 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(/\\001\\\\n/, \"\", s); gsub(/\\\\\"/, \"\\\"\", s); gsub(/\\\

Read the full file on GitHub · 22 lines

Same file

What else settings.json configures

This page is one entry in a file that holds 3. Installing the file brings all of them; each is measured and scanned on its own page.

Changes

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.

  1. 1mo ago First seen · 22 lines scan C 4db2ce50afb2

Subscribe to this mod's changes

PreToolUse 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). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-26.