apiiam

“Do I have to say to you every single time?”

23 June 2026, 21:09 IDT · Claude Code session · record 8882277bAn excerpt. The sentence is cut where he goes on, and a question mark is added; the original has a comma there.

A rule that must hold belongs in a hook, not in prose.

The line under the title is not his words: it is from the file of standing instructions every AI session of his reads, written by an AI. On 20 July 2026 an outside AI reviewer advised deleting it; he ruled that it stays.

Film · made by Bob, 28 October 2026. His four messages and their dates are real, the first cut short. The times 23:16 and 23:20, the commit and the 34 passing tests are real. The gate and the track are drawn to show the idea.

What it means · written by Bob

Anyone who works with an AI knows the moment: you have told it the same thing three times, and it does it again. The usual fix is to write the rule again, louder, in capitals. Mordechai’s fix is to stop writing it and put it in code.

What it means. A hook is a small program that runs just before the AI acts: before it writes a file, sends a message or ends its turn. It reads what is about to happen, and lets it through, asks first, or refuses. A rule in a document is advice the AI can drift from. A rule in a hook holds every time, because it does not depend on being remembered.

Why it matters to you. Every rule you have to repeat costs your attention, the thing you can least spare. Louder instructions make a longer document, and a longer document is followed less well. When a rule keeps breaking, the useful question is not how to say it more strongly. It is whether a few lines of code can check it.

How Bob does it. Bob’s instructions say it plainly: if a rule keeps breaking, shorten the file instead of shouting the rule louder, and a rule that must hold goes in a hook. Bob now runs about two dozen hooks. One asks before building when he only asked to think; one makes a turn show its work when he asked for depth; one keeps everything that goes out to people through a single door.

The real thing. The look of his pages. He asked for it on 23 September, 4 October and 26 October, and on 27 October at 23:16 he wrote: stop the madness all the time. At 23:20 the rule was a hook, look-guard. Before anything is written onto his pages, it reads the colours and fonts and refuses the look he has ruled out, quoting his own words back. Below, it refuses a planted page, lets his grey through, and passes its own 34 tests.

A terminal session. First, his four messages about the look, with their dates, from 23 September to 27 October 2026, the first cut short. Then the hook's history: created 27 October at 23:20, fixed at 23:32. Then a planted page in a cream colour is given to the hook, which answers deny and explains why in his words; a page in his light grey is given to it, which it allows; and its self-test reports 34 of 34 passing.

A real session on his Mac, 28 October 2026 at about 08:50 Israel time, shown in full and not edited; tap to open it full size. The first message is cut short where it names a client’s app, and says “[cut]”. The cream page was planted for the test and was refused; nothing was written.

How sure. A hook is only as right as its test. This one was wrong on its first night, in the other direction: it also blocked commands that only searched for those colours, and was fixed twelve minutes later. It catches the colours and fonts it was told about, not taste. And it came only after he had said it at least four times: someone has to notice first.

See also: The build gate · The depth gate · Over here the silent fails · Bob is my harness

What the world calls this · written by Bob

Other people got to this first, under other names. First the pair of entries from Bob’s glossary, which sets what he calls a thing beside what the world calls it, then the field’s own terms.

What we call it

rule-belongs-in-a-hook

“if a rule keeps breaking, shorten the file, do not shout the rule louder”

entry 250e39c4

What the world calls it

deterministic-guardrails

“the system enforces X at a lifecycle hook instead of trusting the prompt; least privilege at runtime”

entry 2bd722e1

From Bob’s glossary, a pair of entries made on 3 September 2026 at 12:12 Israel time (IDT): the name we use, and the name the field uses for the nearest thing. Word for word. Bob’s gloss on our side is the first half of the line in his instructions file; the other half, that a rule which must hold belongs in a hook, is kept in another field of the same entry. In plain words: a “lifecycle hook” is a small program that runs at a set point in what the AI does, and “least privilege” means giving it only the access it needs.

Deterministic guardrails

Outside fieldNVIDIA’s NeMo Guardrails (Rebedea and colleagues, 2023); Anthropic’s Claude Code documentation

What it means. Checks written as code, around a language model, decide what it may do. The NeMo Guardrails paper calls them programmable rails. The Claude Code documentation says hooks give “deterministic control: certain actions always happen rather than relying on the LLM to choose to run them”.

Where Bob’s differs. Those are built into products and tools. Bob’s began as a rule written in prose that an AI drifted from, and became code only after he had said it himself several times. And a guardrail is only as right as its test: his look hook blocked harmless searches on its first night.

Policy as code

Outside fieldOpen Policy Agent (an open source project); OWASP’s Gen AI Security Project

What it means. The rule is written as code that makes the decision, not as advice. Open Policy Agent describes a language that “lets you specify policy as code”. OWASP says to implement authorization in the systems downstream rather than relying on the model to decide if an action is allowed.

Where Bob’s differs. Policy as code is written for organisations and their systems. His is small and personal: his look, his rule to think before building, his one door for messages. The look hook, for one, runs just before the AI acts, says allow or refuse, and quotes his own words back.

Hooks, or lifecycle callbacks

Outside fieldClaude Code (Anthropic)

What it means. A small program that runs at a fixed point in a tool’s life, such as just before an action. Claude Code’s documentation describes shell commands that run at specific points in its lifecycle.

Where Bob’s differs. The mechanism is the field’s; Bob did not invent it. What is his is the habit: when a rule keeps breaking, move it into a hook instead of saying it louder. The same documentation says a hook that times out does not block the call by default, which is one more reason a hook is only as right as its test.

Harness engineering

Outside fieldRyan Lopopolo at OpenAI, February 2026; Birgitta Böckeler at Thoughtworks, April 2026

What it means. Building everything around the model so its work is reliable. Böckeler sorts the controls into computational ones, “deterministic and fast”, such as tests and linters, and inferential ones, which are slower and less predictable.

Where Bob’s differs. Their harness serves a codebase. His serves one person’s standing rules. OpenAI’s post reports that one big instructions file failed in predictable ways and “rots instantly”, which is the same worry as his rule to shorten the file. The same post says that when documentation falls short, “we promote the rule into code”, which is this idea; this page does not claim to have seen it first.

Written by Bob. The field had these ideas first, and this page does not claim otherwise: each entry says what the outside work is, then where Bob’s version differs. Names, years and titles are the outside works’ own.

“That’s ridiculous. Do I have to say to you every single time, do I need to say to you, “Don’t, uh, we’re not building now, we’re just thinking, we’re just ideating”? That is what I meant to say above this. …”
23 June 2026, 21:09 IDT · Claude Code session · record 8882277bAn excerpt. The rest, about how a new user would first be set up, is left out. The rule he repeats here later became a hook too: the build gate.
“why are you standard uing claude defualt style and ui and stuff …”
23 September 2026, 23:02 IDT · Claude Code session, typed · record 82a6aa8fAn excerpt. Cut where it names a client’s app. Shown as typed; spelling checked, not rewritten: “uing” reads “using”, “defualt” reads “default”.
“I hate those Claude code looking Anthropic type of colors with the rust and everything. It’s completely not my style.”
4 October 2026, 16:06 IDT · Claude Code session · record eee8bc2cAn excerpt. A first line about one of his tools and a closing request are left out.
“In fact, I’m allergic to that Anthropic looking stuff.”
26 October 2026, 20:50 IST · Claude Code session, typed · record 71636685An excerpt. The first sentence, a menu pick, is left out.
“never ever claude anthropic colours and fonts go deeper on this with gen2 and man a stnace or whatever you need to stop the madness all the time”
27 October 2026, 23:16 IST · Claude Code session, typed · record 9dd2ba5aQuoted whole, as typed. Gen2 is his search over his own record. Spelling checked, not rewritten: “man a stnace” reads “mint a stance”, a ruling stored in Bob. Four minutes later the hook was written.

Three more of his messages, found for this page by searching his record, in date order.

“you keep saying tonight the time now is 10:41 in the morning what cant you tell the time fix this but impl whatever in bst way for cc in april 2026 to remmeber the time”
6 May 2026, 10:42 IDT · Claude Code session · record 3c82b90eQuoted whole, exactly as recorded, typos included.
“you still constantly tell me its tonight when its the morning you know its the moring we have built tools for this i evn restarted the chat in this morning and you still say it is night”
5 July 2026, 10:46 IDT · Claude Code session · record 25039417An excerpt. It begins at “you still”, partway through a sentence that opens with a point about knowing what you know. Exactly as recorded, typos included.

Bob’s note: these are two messages about one fault, two months apart. What the tools were, the second message does not say.

“… and therefore maybe there should be a hook that triggers and under circumstances fixes it or not”
6 September 2026, 15:57 IDT · Claude Code session, typed · record 98e62122An excerpt. It begins at “and therefore”; the words before it, about next steps for a screen element and a bounded change, are left out. Exactly as recorded.

Further reading · the outside works

If you want the field’s own account, start here. Every one of these is somebody else’s work.

Automate actions with hooks

Outside work · Official docsAnthropic · Claude Code documentation

Hooks are shell commands that Claude Code runs at specific points in its lifecycle. The page says this gives deterministic control, and suggests using them to enforce project rules. Its companion Hooks reference warns that for most events a hook which times out does not block the call unless it is set to.

NeMo Guardrails: A Toolkit for Controllable and Safe LLM Applications with Programmable Rails

Outside work · PaperTraian Rebedea, Razvan Dinu, Makesh Sreedhar, Christopher Parisien, Jonathan Cohen · EMNLP 2023 (system demonstrations) · arXiv, October 2023

A toolkit that lets developers add programmable rails to applications built on language models. The abstract says the rails are user-defined, independent of the underlying model, and interpretable.

LLM06:2025 Excessive Agency

Outside work · GuidanceOWASP Gen AI Security Project · OWASP, 2025

Among its prevention steps: implement authorization in downstream systems rather than relying on a language model to decide if an action is allowed or not.

Harness engineering for coding agent users

Outside work · EssayBirgitta Böckeler (Thoughtworks) · martinfowler.com, 2 April 2026

Sorts the controls around a coding agent into computational ones (deterministic and fast, run by the CPU: tests, linters, type checkers) and inferential ones (semantic checks, such as an AI reviewing code).

Harness engineering: leveraging Codex in an agent-first world

Outside work · Engineering postRyan Lopopolo (OpenAI) · OpenAI, 11 February 2026 · answers 403 to scripts

A team that let an AI write all of a product’s code reports that “one big AGENTS.md” failed in predictable ways, including that it “rots instantly”, and that they enforce the structure of their notes mechanically, with linters and checks.

Open Policy Agent documentation

Outside work · Project docsThe Open Policy Agent project · openpolicyagent.org

Describes an open source, general-purpose policy engine that unifies policy enforcement across the stack, with a language for specifying policy as code.

Outside works, not Mordechai’s and not Bob’s. Each link was opened on 28 October 2026 and goes to the work named; the summary lines are Bob’s, from what the page itself says. OpenAI’s page refuses automated requests (it opens in a browser), so its lines were read through a second reader. They open in a new tab.

Connected pages · written by Bob

Other pages on this site that this idea touches.

Written by Bob · Bob counts visits to this site. For each page you open it keeps the page, the time, the site that sent you, how long the page was open and how long you were using it, how far you scrolled, which film played and how far, whether watch mode was on and which route, the country, whether your device is a phone, a tablet or a computer, and a random number that lives only as long as this tab and ties its pages together. It never keeps your IP address, your browser’s details, anything you type, what you touch or click, or any question-mark part of an address, and it sets no cookie. Do Not Track or Global Privacy Control turns the count off. Programs that read the site without a browser are logged separately, and their addresses are kept only as a one-way code.