My Claude Code setup

Instructions get forgotten.
Code doesn't.

I write code with Claude Code, an AI that works in my terminal. It's good, but it forgets. An hour into a task, the rules I gave it at the start are buried in the conversation. So I turned the rules that matter most into small programs. A program doesn't forget, and it can stop a step before it happens.

● Edit scripts/deploy.sh

✗ refused by guideline_gate.py

Read shell_coding_guidelines.md before editing deploy.sh. Then make this edit again.

● Read shell_coding_guidelines.md

● Edit scripts/deploy.sh ✓

The loop

A loop of seven steps: session starts, hooks (a gate that can refuse a step), work, the commit gate (tests must catch bugs), commit, session ends, and the 04:30 check (a gate that rechecks every fact), then back to the next session. Session starts Hookscan refuse a step Work Commit gatetests must catch bugs Commit Session ends 04:30 checkrechecks every fact ↻ each night feeds the next morning

Gates refuse. They don't remind.

Gate 1 · hooks

A hook is a small program that runs around each of the assistant's steps. A reminder can be ignored. A refused step can't.

  • "Done. Shall I commit?"

    I skim, type "sure", and something I never read is committed.

    A question in prose is sent back. It asks again in a dialog, and waits.

  • A command is blocked

    It finds another way around.

    Every other step is refused until I answer.

Tests have to catch planted bugs

Gate 2 · the commit

Passing tests prove little if they'd pass anyway. So before a commit, the gate breaks the change on purpose and the tests have to notice. Python and shell alike.

  1. A change
  2. Every script's own testseach script tests itself
  3. Bugs plantedon each changed line, like < into <=
✓ Every bug caughtCommitted.
✗ One survivesNothing is committed. Back to the tests.

Memory that forgets on evidence

Gate 3 · 04:30, while nobody's here

A remembered fact goes stale, and tomorrow the assistant repeats it with confidence. So every fact carries a command that can prove it wrong, and every night it runs.

  1. A fact"releases ship from release"
  2. Its checka command that can prove it wrong
✓ HoldsKept.
✗ ContradictedDeleted by morning.
? No answerKept, and reported.
“Removing is generous, not violent. Deleting a wrong fact makes the rest believable.” — my credo
Notes wait for meWhen it spots something off-task, it writes a note instead of mentioning it once. Next session I say Do, Keep open or Drop. Do turns it into something that lasts:
  • checked fact
  • rule
  • script
  • setting
  • ticket
A journal line per changeCommitted as it goes, so "what did we do on Tuesday?" has an answer. When I ask, the lines become my Jira time log.

In the morning, the new session reads what ran overnight and tells me: which facts were deleted, which notes were placed, and which merged branches the daily sweep cleaned up.

It checks itself

Even the instructions have tests. When I change what a skill is for, new sessions try it out before I can commit. They check it starts when it's needed and stays out of the way when it isn't.

/inventory: what's earning its keep

One table of everything I wrote for it: how often each piece runs, what a run costs, when it last changed, and what names it.

A few rows from the census on 18 November 2026
nameruns$ / runlast editnamed by
change_gate.py100–2026-11-1825
audit242.132026-11-18–
confluence-children.sh0–2026-11-030

Three real rows from the census of 18 November 2026. Scripts cost nothing to run, so only skills show a price.

/audit: judged against the credo

This check isn't code, and that's on purpose. Everything here comes from one page, my credo. When I ask, a new session reads my work against it, line by line.

credo.md Build simple systems people can trust.

  1. A file, a changeor an answer
  2. A new sessionagainst every line of the credo
  3. Findingsnumbered, worst first
    • ☑ 1
    • ☐ 2
    • ☑ 3
    I pick which to fix

Take what fits

It fits one person: me. It says no exactly where I tend to slip. But the patterns travel, it's MIT-licensed, and each piece needs little of the rest.

–scripts, each with its own tests
–hooks around the assistant's steps
–skills it picks up when a request fits
–guides it reads before it edits code

– travel to any setup: gates, memory, self-checks – are plumbing for my job: GitHub reviews, Jira, Confluence, Slack

  • credo.md
    Where it all comes from. Yours would say something else.
  • ask_gate.py
    If you've ever said "sure" to a question you didn't read.
  • git_fact.sh
    A fact is only worth keeping with a command that can prove it wrong.
  • skill_trigger_test.py
    If you've ever edited a skill and it quietly stopped firing.

What it can't do yet

  • Nothing measures the outcome. The tests show each part works. Nothing shows the whole makes my work better.
  • Two sessions in one folder can trip over each other's half-finished edits.
  • The 04:30 check runs only while I'm logged in. A missed night runs at my next login.