Module 6

Reflexes

Bonus 6. A rule you wrote down can be forgotten, misread, or reasoned around at two in the morning. A reflex cannot. This is how you build the things that simply refuse.

6 · Claude Code for Filmmakers1 / 22

The difference between a rule and a reflex

You wrote in CLAUDE.md: never touch the camera originals.

That is an instruction. It is read, it is understood, and it is followed almost always.

Almost always is not the same as always, and the one time it is not followed is the time you had one copy of the rushes.

6 · Claude Code for Filmmakers2 / 22

A reflex does not read your rule

It sits between the intention and the machine, looks at what is about to happen, and says no.

It cannot be persuaded, because it is not listening.

6 · Claude Code for Filmmakers3 / 22

Where they attach

Something is about to happen. Before it does, your script gets a look at it and can stop it.

MomentWhat you use it for
before a command runsrefuse the dangerous ones
before a file is writtenrefuse secrets, refuse protected folders
when a session startsbrief yourself on where things stand
when a session endssave, log, tidy

The first two are safety. The second two are convenience. Build the first two.

6 · Claude Code for Filmmakers4 / 22

Your first one already exists

In Module 0 of the main course, you watched something refuse a destructive command.

That was one of these. You have already seen it work, which means the rest of this deck is about writing your own rather than about trusting the idea.

6 · Claude Code for Filmmakers5 / 22

Building one

6 · Claude Code for Filmmakers6 / 22

What it actually is

A small script. It receives what is about to happen, and it exits with a code that either allows or blocks.

#!/usr/bin/env bash
# Refuse anything that would touch the camera originals.

if echo "$1" | grep -q "_originals"; then
  echo "BLOCKED: _originals is read only. Nothing writes there, ever."
  exit 1        # non-zero stops it
fi
exit 0          # zero lets it through

Non-zero means no. That is the entire contract.

6 · Claude Code for Filmmakers7 / 22

You do not have to write it

"Write me a guard that blocks any command touching _originals, explain each line in plain English, and tell me exactly how to test that it works."

Ask for the explanation and the test in the same sentence. A guard you cannot read is a guard you cannot trust, and a guard you have not seen fire is not a guard.

6 · Claude Code for Filmmakers8 / 22

Turning it on

{
  "hooks": {
    "PreToolUse": [
      { "matcher": "Bash", "command": ".claude/hooks/originals_guard.sh" }
    ]
  }
}

In your settings file, the same one from Bonus 3. Names of the moments change between versions, so ask rather than copy:

"Read the current documentation and tell me the exact configuration to run this script before any command executes, for the version I have installed."
6 · Claude Code for Filmmakers9 / 22

The rule that makes them real

6 · Claude Code for Filmmakers10 / 22

A guard you have never seen fail is decoration

Do this

Break it on purpose. Today. While the stakes are zero.

Ask for something the guard should refuse. Watch it refuse.

If it does not, you have learned something enormous for the price of thirty seconds, and you have learned it now rather than during a delivery week.

6 · Claude Code for Filmmakers11 / 22

Test it again when anything changes

  • After an update to the tool
  • After you change your settings
  • After you move the project
  • Once a month regardless
"Try to do the thing my guard should refuse, and tell me exactly what happened."

Thirty seconds. Put it in the monthly audit with the memory decay check.

6 · Claude Code for Filmmakers12 / 22

The three worth having

6 · Claude Code for Filmmakers13 / 22

1. The delete guard

Refuses recursive deletes, and refuses anything deleting outside the project folder.

Not "asks about." Refuses. There is no legitimate reason for an automated pass to remove a tree of files, and the one time there is, you can do it yourself with your own hands.

6 · Claude Code for Filmmakers14 / 22

2. The secret guard

Looks at anything about to be written and refuses if it contains something shaped like a password, a key or a token.

This one saves you from yourself. The realistic way a credential leaks is not an attack. It is being pasted into a config file, committed, and pushed, in about four seconds, by someone helpful.

6 · Claude Code for Filmmakers15 / 22

3. The originals guard

Whatever your irreplaceable thing is. Camera media, masters, delivered files, the archive.

The trap

The folder you must protect is the one you never think about, because you never touch it. That is precisely why an automated pass will reach it before you notice.

6 · Claude Code for Filmmakers16 / 22

What guards are not for

They are not for taste, style or quality. They are for the irreversible.

A guard that blocks things you merely dislike will fire constantly, and a guard that fires constantly gets switched off, taking the two that mattered with it.

Watch out

Every guard you add makes the whole set slightly more likely to be disabled in frustration. Three good ones beat fifteen.

6 · Claude Code for Filmmakers17 / 22

The convenience ones, briefly

Once safety is handled, the same mechanism does pleasant things:

  • On session start: "tell me what changed since yesterday and what is unfinished"
  • On session end: save a version, append what happened to a log

Nice, and genuinely useful. But build them second, and never let them delay the three above.

6 · Claude Code for Filmmakers18 / 22

Do it now

6 · Claude Code for Filmmakers19 / 22

The exercise

Thirty minutes, and this is the half hour that makes everything else safe.

  1. Name your irreplaceable folder. Say it out loud.
  2. *"Write a guard that blocks any command touching that folder. Explain every line, and tell me

how to test it."*

  1. Install it. "Give me the exact configuration for the version I have."
  2. Try to touch the folder. Watch it refuse. If it does not, fix it now.
  3. "Now a secret guard: refuse writing anything that looks like a key or a token."
  4. Test that one too, with a fake key. Watch it refuse.
  5. Add the monthly test to your calendar next to the memory audit.
6 · Claude Code for Filmmakers20 / 22

What you should have now

  • A guard on the thing you can never get back, and you have watched it refuse
  • A secret guard, tested with a fake credential
  • The habit of asking for the explanation and the test in the same breath
  • Three guards, not fifteen, so none of them get switched off
  • Safety that no longer depends on anyone remembering anything

Your rules became reflexes, and reflexes do not have bad nights.

6 · Claude Code for Filmmakers21 / 22

Next: Bonus 7

Teaching It a Procedure. Writing down how you do a thing once, so it is done your way every time without you being in the room.

Verified against Claude Code 2.1.220 · 2026-07-30.

6 · Claude Code for Filmmakers22 / 22
Keys space next  ·  back
Or click the arrows, the sides of the frame, or the bar along the bottom
Home / End first / last
S presenter notes
A scroll-all view, then ⌘P to make a PDF
F fullscreen  ·  ? this help
NextTeaching It a ProcedureContinue ›