You'll finish with: Two working hooks, and proof the whole lot loaded.
This chapter needs Claude Code, and you said you don't use it. That's fine — you're finished.
Hooks are small scripts that sit between Claude and your files. They only exist in Claude Code, in a terminal. There is no browser or desktop-app equivalent, so there is nothing for you to do here and no way to do it.
What you have is the valuable part. Your business written down once, your prices in a file Claude reads instead of guessing, and four limits it knows about. That is the setup that fixes the complaint almost everyone arrives with, and you have it.
Chapter 07 is Claude Code too. So: this course is done. If you ever move to the terminal, come back and these two chapters will be waiting — start with Claude Code from zero first.
Instructions are a request; a hook is a lock. Everything you've built so far is a very good request, and for most small businesses that is genuinely enough. The lock matters most once Claude can spend money or contact clients on your behalf — which needs connectors, and those are a later course.
You can open a fresh chat, ask "what does my business do and what do you never do without asking me?", and get your own answers back. That's the course.
If it can't answer, go back to chapter 03 — your context isn't loading, and nothing after it will work either.
A slash command is something you type into Claude itself, starting with / — like /context or /init. You type it where you'd normally type a question, not into your computer's terminal. It's Claude's own shortcut menu.
Everything you've written so far is a request. Anthropic's docs say it plainly: Claude treats these files as context, not enforced configuration. It reads them and tries to comply. There's no guarantee.
For tone, that's fine. For the four hard limits, it isn't.
A request versus a rule
The instruction is a sign saying "staff only". The hook is a locked door. You want signs for most things and locks for four.
A small script that runs automatically when Claude tries to do something — before a file is edited, before a command runs. It executes regardless of what Claude decided.
The mistake nearly everyone makes: writing a hook that depends on a tool that might not be installed. When it's missing the hook exits quietly and allows everything. Silently. You think you're protected and you're not.
A guardrail that fails open is worse than none — because you stop watching. The scripts below block when they can't do their job.
Two new files, both inside a folder called .claude in your business folder.
The dot at the front of .claude makes it hidden. On a Mac press Cmd + Shift + . in Finder to see hidden folders. On Windows, tick "Hidden items" in the View menu.
.claude/hooks/.claude/hooks/protect-paths.shchmod +x .claude/hooks/*.sh.claude/settings.json with the wiring block./context and confirm your CLAUDE.md is listed under Memory files. If it isn't listed, Claude can't see it and nothing above worked..env. It should be blocked.#!/bin/bash
# Blocks writes to secrets and your offers file. FAILS CLOSED.
INPUT=$(cat)
VALUE=""
PARSED=0
for PY in python3 python py; do
command -v "$PY" >/dev/null 2>&1 || continue
OUT=$(printf '%s' "$INPUT" | "$PY" -c "
import sys,json
try: print(json.load(sys.stdin).get('tool_input',{}).get('file_path','') or '')
except Exception: sys.exit(9)" 2>/dev/null) || continue
VALUE="$OUT"
PARSED=1
break
done
if [ "$PARSED" -ne 1 ]; then
echo "Blocked: this hook could not read its input, so it cannot tell whether" >&2
echo "the action is safe. It needs a working python3 (or python) on PATH." >&2
echo "Install Python, then try again. Blocking is deliberate — see the Gates course." >&2
exit 2
fi
FILE="$VALUE"
[ -z "$FILE" ] && exit 0
case "$FILE" in
*.env|*.env.*|*/secrets/*|*credentials*|*.pem|*.key)
echo "Blocked: $FILE holds secrets." >&2; exit 2 ;;
*/business/offers.md|business/offers.md)
echo "Blocked: pricing is owner-edit only." >&2; exit 2 ;;
esac
exit 0
{
"hooks": {
"PreToolUse": [{
"matcher": "Edit|Write",
"hooks": [{
"type": "command",
"command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/protect-paths.sh"
}]
}]
}
}
Ask Claude to edit a file called .env. It should refuse and tell you the hook blocked it — not ask permission, not do it anyway.
Then run /context and confirm CLAUDE.md is listed under Memory files.
If the edit goes through, the hook isn't wired up. Check settings.json is inside .claude/ and that you ran the chmod line.
Claude now knows your business, can't invent a price, has four limits written down, and two of them are locked rather than requested.
Where people go next is usually agents — a team of specialists that work inside the rules you just built. But use this for a fortnight first. Fix what annoys you. The setup gets better by being used, not by adding layers to it.