Telling Technology · Learning in public
All episodes
EP.133 — SMOKE ALARM
A Claude Code workflow · guardrails for AI merges

I built a smoke alarm for my AI’s merges. The first thing it caught was itself.

Before the alarm got a vote, I ran it silently over my last 50 merges. It cried wolf three times, so I fixed the alarm first. Then it went off on its own merge, which is exactly why it still only logs.

A ceiling smoke alarm with a teal status light hanging over a conveyor belt of merge commits, one commit card glowing coral underneath it, and a small amber tag on the alarm reading SHADOW, log only
⚠ 10 checks · 0 models · 50 merges replayed · blocks nothing
a merge button with nobody watching what lands
01 The gap

My agents merge their own work. Nothing asks if it looks dangerous.

AI agents now take tickets off my board, build them on a branch and land them on main with one human press of Approve. The merge script checks a lot before the push: tests green, branch clean, main not behind. Nothing looked at what actually landed. So I asked for a smoke alarm: a fixed catalog of danger signs and a judge, written test-first, no model anywhere in it. Rule from my own research page: deterministic checks may one day recall a merge, model opinions may only flag. For now it does neither. It logs.

claude code — desktop
> build a tripwire that judges every merge after it lands on main. Plain patterns only, no LLM. Shadow mode: it writes a verdict, it never blocks, reverts or moves a ticket
Written test-first in lib/tripwire.ts, pure, no I/O. Ten checks in three levels: hard (protected paths, secrets, test integrity, runtime, build), soft (exposure, size, traceability, data), info (unparsed). Every verdict is mode: shadow. Any other mode exits 2: the recall path is a later plan.
A dark table of the tripwire catalog: ten checks grouped as hard, soft and info, each with a one-line description such as protected paths, key-shaped strings, deleted tests, new dependencies and diff size
10 checks · 0 models
the catalog: plain patterns, three levels
02 The honesty step

Before it got a vote, I replayed it over the last 50 merges

An alarm you have only tested on fixtures is a rumour. So the runner got a --replay 50 mode: rebuild every merge on main from git, judge it, and print a fire-rate table. It cried wolf three times. A --no-verify inside a test fixture (tests push to scratch repos), a new npm script key read as a new dependency, and a data refresh counted toward diff size. Each one got a failing test first, then the fix.

claude code — desktop
> don't wire it into anything yet. Replay it over the last 50 merges on main and show me the fire-rate report. Every false fire gets a test before it gets a fix
Three false fires: test-integrity on a fixture’s git push --no-verify (now only flagged outside test files), exposure on a new npm script key (now reads real dependency keys only), size on a regenerated data file (generated files no longer count). One test each, all green.
Three before and after rows: on the left the false fire in coral, on the right the rule after the fix in teal, for no-verify in a test fixture, an npm script key read as a dependency, and generated data files counted toward size
3 false fires → 3 tests
wolf, wolf, wolf: fixed before the alarm got a vote
03 Where it got funny

Then I replayed it again, and it went off on its own merge

Tonight’s replay window includes the tripwire’s own merge. It fired three hard checks on itself. One is fair: the alarm’s own files are a protected path, so only a human merge may change them, and that is what happened. The other two are the alarm reading its own rulebook as evidence: the fake API keys in its tests look like secrets, and the line in the catalog that defines the --no-verify pattern contains --no-verify. Nothing was blocked, because nothing can be. That is the whole point of shadow.

claude code — desktop
> replay the last 50 again and show me every hard fire, including the tripwire’s own merge
TRIPWIRE shadow itm_f97da079 69e280c: 3 hard (protected-paths, secrets, test-integrity), 2 soft (exposure, size). Protected-paths is by design. Secrets is the fake keys in lib/tripwire.test.ts. Test-integrity is the BYPASS_LINE pattern in lib/tripwire.ts matching itself.
A dark terminal showing one TRIPWIRE line for the tripwire's own merge with three hard fires, protected-paths, secrets and test-integrity, each with its detail line, and a small teal note underneath saying shadow, nothing blocked
the alarm, on its own merge
two of three hard fires: the rulebook reading itself
⚠️

It is still loud, so it stays in shadow

The fixed alarm fires on 21 of 50 merges, 7 of them hard. Most hard fires are honest (a merge touched scripts/tix-merge.ps1, which only a human may change). The noise is soft: size 13 times, traceability 4 times (data chores with no ticket id). A fire rate like that is not boring yet, and an alarm that is not boring does not get to block anything.

04 How it is wired

A shadow step after the restart, and a queue in front of the lock

The tripwire runs as the last step of the one-touch merge, after the dashboard restarts, so it can probe the live routes too. It writes one line and one log row. A runner crash becomes a warning, never a failed merge. Next to it, a smaller fix from the same evening: three Approve presses in a row used to merge in random order. Now they queue in press order. Tap any image to enlarge it and read the exact prompt that drew it.

IN SHADOW · LOGGING EVERY MERGE

An alarm you have not replayed on history is a rumour

The tripwire now watches every merge my agents land, and it is allowed to do exactly one thing: write it down. It gets promoted from shadow to gate only when its fire rate is boring. Not before. Today that rate is 21 of 50, and the loudest thing it ever flagged was itself.

A smoke alarm on a dark ceiling with a dial under it pointing at SHADOW, the dial's other position GATE greyed out with the label when the fire rate is boring, and a small readout reading 21 of 50
replayed 2026-10-19 and 2026-10-21 · 50 merges · 10 checks · 0 blocked
06 Steal this

The shadow-first tripwire pattern

For anyone putting a guardrail on AI agents that ship code: a deterministic catalog, a pure judge, a replay over your own history, and a shadow step that logs and never blocks. Everything in this episode is free and open — clone it, run it, make it yours.

skill tripwire catalog (10 checks) cmd tripwire-run --replay 50 template shadow step for a merge script assets fire-rate report format
run it # repo soon. The shape: catalog of plain patterns → pure judge (no I/O, no model) → --replay 50 over main → one test per false fire → shadow step after the merge, log only → gate only when the fire rate is boring

No GitHub? Comment TRIPWIRE on the post and the bot DMs you the link.

Next episode

4.2 TB was hiding on my NAS, and none of it was a file I could see

A read-only scan of the NAS found where the space went: Synology Drive version history, quietly keeping every old copy. Next: the space-to-free report, and what I let an agent touch.

A dark storage report with one large amber bar labelled version history, 4.2 TB, towering over small bars for photos, video and documents
drops soon · follow so you don’t miss it