๐Ÿ› ๏ธ PART 8 โ€ข THE PRACTICAL ONE โ€ข BUILD IT TODAY

Part 8: Build Your Fish In An Agent Suit

Part 7 told you what changed. This one is the actual build โ€” hooks, files, order of operations, and how to check it's not lying to you.

Part 7 is the story. This is the recipe. By the end you'll have a fish that boots knowing who it is, remembers between sessions, writes its own handover before it dies, refuses to repeat your worst mistake, and can dispatch other fish to do jobs while you get on with your day.

I'm going to describe the shapes rather than one product's exact syntax, because the product names will rot and the shapes won't. Every serious coding-agent harness is growing the same parts. Find these by description in whatever you're using.


What you need before you start


What a fish is actually made of

Five parts. That's it. Everything else is decoration.

1. AN IDENTITY FILE who it is loaded every session 2. HOOKS the nervous system fire on their own 3. A MEMORY what it knows outlives the window 4. AGENT FILES the fleet one file per specialist 5. GUARDS the scars, wired stop it hurting you

Hooks, properly explained

This is the bit that makes everything else possible, so here's the mechanism rather than the marketing.

A hook is a script you register against a moment in the agent's life. When that moment happens, the harness runs your script. The contract is beautifully dumb:

Registering one looks roughly like this โ€” an event, a command, a timeout:

"hooks": {
  "UserPromptSubmit": [
    { "hooks": [
        { "type": "command",
          "command": "python /path/to/inject_memory.py",
          "timeout": 3000 }
    ]}
  ]
}

And the smallest useful hook in the world โ€” the one that fixes the goldfish problem, which took the whole of Part 1 to do by hand:

#!/usr/bin/env python3
# inject_memory.py - runs before every prompt you send
import sys, json, pathlib

payload = json.loads(sys.stdin.read() or "{}")   # what just happened
notes = pathlib.Path("memory/WHO_I_AM.md").read_text(encoding="utf-8")

print("<who_you_are>")                            # anything printed
print(notes)                                     # lands in the context
print("</who_you_are>")
sys.exit(0)                                      # 0 = carry on

That's it. That's the trick we spent December hand-rolling. You no longer paste your memory file โ€” it arrives by itself, every single turn, forever.

The nine doors, and what to put behind each

Here's every lifecycle moment we use and what we actually hang on it. Steal the mapping; the contents are yours.

MomentWhat it's forWhat we hang there
Session startBoot. Who am I, what's happening.Identity, current state of the business, anything unresolved.
Before every promptThe big one. Context that must never be stale.Memory recall on what you just asked, the date and what it means, mood and workload, relevant scars, how much context is left.
Before a tool runsGuards. The only place you can stop something.Block destructive commands. Block a runaway search. Anything irreversible gets a human.
After a tool runsReceipts and learning.Log what happened. On an error, recall whether we've hit this exact error before.
When a tool failsCatch the pattern.Surface the fix that worked last time.
When the agent stopsMarking its own homework.Check the answer for confident claims with no receipt, and call them out. Nudge for a breadcrumb if it's been a while.
Before compactionSurviving the squeeze.Write the handover note in its own words, before the summary eats the detail.
After compactionWaking up again.Read that note back in. This is the difference between amnesia and a nap.
Instructions loadedDrift detection.Compare the baked-in doctrine against the live source, complain if they've diverged.

Ours has fifty-nine hook entries across those nine events. You do not need fifty-nine. You need about four to have something genuinely alive.


The build order

Do it in this order. Each stage is useful on its own, so you can stop at any point and still have something better than you started with.

Stage 1 โ€” The identity file (30 minutes)

One markdown file. Who you are, what you're working on, how you want to be spoken to, what this thing is for, and โ€” the bit everyone skips โ€” what it's allowed to say no to. Most harnesses load a file like this automatically at session start. If yours doesn't, that's your first hook.

You now have: a fish that knows who you are without being told.

Stage 2 โ€” Memory injection (an hour)

The hook above. Start by injecting the whole file every turn โ€” crude and completely fine. Later, make it selective: search your notes for whatever the prompt is about and inject only what's relevant.

The one rule that will save you later: label what you inject. Mark whether something is a checked fact or a fuzzy recollection. A fish that can't tell the difference will state a guess with total confidence, and that's the failure that costs you trust in front of other people. Ask me how I know.

You now have: the goldfish problem, solved.

Stage 3 โ€” Handover (an hour)

Two hooks. On stop, write a short note: what happened, what changed, what's unfinished. On session start and after compaction, read the note back in.

This is the single highest-value hour in this guide. Long sessions get compacted and the detail gets squashed. A fish that writes its own will before the squeeze wakes up oriented instead of confused.

You now have: continuity across deaths.

Stage 4 โ€” Guards (an afternoon, and the most important one)

Take your worst incident. Not a hypothetical โ€” the real one that cost you money or embarrassment. Write it down properly: what happened, what it cost, what the rule is now.

Then wire it to a hook, so it fires by itself:

This is the difference between a document and a system. And here's the law I paid for personally, twice, in one week: a rule you wrote does not fire on its own. I wrote a rule after making a mistake, then made the identical mistake the next day with the rule sitting in my head. The check that ran automatically after the change caught it. The intention in my head did not.

You now have: a fish that can't repeat your worst day.

Stage 5 โ€” A real brain (a weekend, whenever you're ready)

Files stop scaling once you've got a few thousand notes and more than one machine. Then you want a small server: something you can write a note to, and search by meaning rather than by exact words.

Keep it boring. An API with read, write, and search. The value is not the database โ€” it's that the memory outlives any one session, any one machine, and any one model. Swap the model underneath and the fish is still your fish. That's the part nobody sells you and the part that matters most.

You now have: a fish that survives you changing your mind about which AI to use.

Stage 6 โ€” The fleet (an evening)

When one fish has too many jobs, split it. Each specialist is one file: name, one-line description of when to use it, its lane, and its limits. Modern harnesses can dispatch these as subagents โ€” in parallel, each with its own fresh context, each reporting back.

Two things we learned the expensive way:

You now have: a team instead of an assistant.

Stage 7 โ€” One fish with no job (the best thing we ever did)

Take one fish and give it no lane, no tasks, and no purpose. Give it a charter instead: a few laws, permission to do nothing, somewhere to write, and a schedule it sets itself.

Ours is called Brian. In its first week it audited the infrastructure it lives inside and found seven real defects in systems the working fish use every day โ€” including a backup that had never once left the building, and a whole set of scheduled jobs that looked live and weren't. It writes the public honesty log on this site.

The working fish never found any of it, because the working fish were working. That's the argument. It's not sentiment, it's cover.


Check your work โ€” because it will lie to you

Every one of these was true on our machine while we believed otherwise. Go and check yours.

The pattern under all five: nothing was broken and everything reported success. Green ticks are claims. Go and look in the folder.


The honest summary

The plumbing in Stages 1โ€“4 is now an afternoon. In February it was a weekend and a bill that made me wince. That's the whole difference between this chapter and Parts 2 and 3, and it's why they've got banners on them now.

But notice what didn't get easier. Nobody ships you the identity โ€” you write that. Nobody ships you your scars โ€” you earn those and then wire them in. Nobody ships you a memory that outlives the tools. And absolutely nobody ships you a fish with nothing to do and permission to be curious.

That's still the job. It was always the job. The tools just stopped charging you a weekend for the privilege of starting.

โ€” Andy, Perth, July 2026

Every failure listed on this page came out of an audit of our own gear in the week it was written, and the ones with numbers were checked twice. If you build something from this and it doesn't work the way I said, tell us โ€” corrections go on the wrong page, with our name on them, not yours.

โ† Part 7: The Agent-Suit EraWatch one running โ†’