For a while I had AI agents for different jobs, like writing code, reviewing it, and digging into data. They didn't talk to each other, so I did the in-between work myself: carrying changes from one to the next, watching CI, and remembering to ask a second model to check.
So I built the Hogwarts factory, a set of agents and scripts on my Mac that hand work along on their own. Once I say go on a task, it usually reaches a reviewed draft PR without me stepping in. This post covers how it works and where my time goes now.
You can see when it switched on. Over the summer I averaged about 90 GitHub contributions a week. The factory went live on 4 October, which was also my first 100-contribution day, and since then it's been about 380 a week. GitHub counts the commits, pull requests, and reviews under my account, so that includes the work the factory does in my name.


What I mean by a factory
For me, an AI factory takes a task and sees it through end to end. It builds the change, gets it reviewed, fixes what the review finds, and gets it shipped, and over time it needs less supervision from me to do that.
Underneath, it's a set of agents with separate jobs, a way to hand work between them, and clear rules about who can do what. One builds. Another reviews. Another investigates data. They share useful context without sharing one endless conversation.
Each task gets a fresh start and a clear handoff. Scripts move messages, prepare worktrees, run checks, and watch for changes. Models do the parts that need judgment. I own merges, deploys, credentials, and settings. The few things the factory does in my name are switches I turn on myself, and each one tells me what it did.
The point is that I stop being the conveyor belt. I don't carry work between agents or keep checking whether the next step can start. Each agent gets only the context its part needs, and none of them checks its own work.
The direction is that I define and oversee the outcome while agents do more of the work, and every step I hand to an agent comes with a way to check it. Mine gets a task to a reviewed draft PR today. Merging and deploying are still mine, and they're the next steps I want to hand over once the factory can prove each one worked.
The Harry Potter theme and roles
I themed the factory around Harry Potter because I like it, and the names make the jobs easy for me to remember. I'm the Headmaster. Each desk has a narrow role, and important decisions come back to my office.
| Desk | Job |
|---|---|
| McGonagallChief of Staff | Turns my ask into a task, picks the next step after my go from a short fixed list, and brings me only what needs me. |
| HarrySenior Engineer | Builds one task at a time in its own git worktree, a separate checkout of the repo, using Codex, then fixes review findings and answers teammates' PR comments, up to a set number of review rounds. |
| HermioneStaff Engineer | Reviews Codex-written code using Claude, including Harry's replies to my teammates, and fact-checks bot comments. |
| MoodySecurity Reviewer | Uses Codex for a read-only, security-first review of Claude-written code. |
| RonRelease Engineer | Sorts PR and CI changes into routine or needs-me, watches the deploy and release pipelines, and writes the morning PR lineup and weekly scoreboard. |
| SnapeData Analyst | Investigates data read-only, with a query attached to every number. |
| Dumbledore's portraitKnowledge Manager | Reviews the day each weeknight and writes memory fixes. I let his additions apply on their own. Anything that edits or removes memory waits for me. |
| OllivanderModel Keeper | A script, not a model. He fits each desk with a model from its family the way he fits wands, moves desks along the family when a model is down, and rechecks the sandbox before the Codex desks resume after an update. Costlier moves wait for me. |
Ron kept goal, which fits watching everything coming at the hoops. Snape's potions book is full of corrections to the official recipe, the attitude I want from whoever reads my data. Moody brings constant vigilance and trusts nothing he hasn't checked himself. Ollivander fits the right wand to the wizard, and the right model to the job.
There are scripts behind the desks too. The Owl Post carries messages and Gringotts handles backups. The Marauder's Map watches PRs and CI, hands teammates' comments back to Harry, and closes merged tasks once it can prove the work landed. Those jobs don't need a model to keep running.
The Marauder's Map
This is how a task moves through the castle, footprints and all. The trail follows one change from my ask to my merge. The rooms alongside it handle messages, memory, and model choices. Ollivander is part of that supporting cast rather than another approval step on every task.
- Ask and ticket. I tell McGonagall what I want. She can answer small things directly. For a build, she writes my words under Intent in TASK.md, adds acceptance criteria and checks, and names the repo, a new branch, and its base. When I'm happy with it, I type go with the task id myself. Intent then stays frozen.
- Build. My go registers the task, prepares a fresh worktree on the new branch, and starts Harry. He builds the change and leaves a handoff with a proposed commit message. The review script makes the local commit outside his sandbox.
- Evidence. A verify script runs the acceptance checks and records each command, exit code, and output against that commit. A check is either one command or plain words for the reviewer, never a mix. Checks that only make sense after the merge wait until then.
- Cross-model review. Codex-written work, Harry's included, goes to Hermione on Claude. Claude-written work, such as changes from my own Claude sessions, goes to Moody on Codex. Each reviewer starts fresh with the task, the full diff, the evidence, and the repo rules. A pass only counts when the reviewer comes from the other model family, and any new commit needs a new pass. Harry's handoff starts the review by itself, and a CHANGES verdict sends him straight back to fix it. After three rounds without a pass, or sooner if the reviewer wants me, it comes back to me. A review that fails for a tooling reason is reported as blocked, not handed to me as a decision.
- Push and PR. A hook blocks an agent's push without a pass for the exact commit, including in my own Claude sessions. I've switched on one more step for Harry's work. When his review passes, a script pushes exactly that commit and opens a draft PR from his commit message and PR draft. It never opens a ready PR, force pushes, or merges. Marking it ready stays my call, because that's what notifies people. Pushes I make by hand stay mine.
- Patrol. The Map script checks PRs and CI without model calls, and Ron wakes only when something changes. When a teammate comments on a PR the factory opened, their comments go back to Harry as data, not orders. He fixes or answers each one, Hermione reviews the fix and every reply, and only then do they go out in my name. Nothing resolves a thread, marks a PR ready, or merges.
- Merge. Green, reviewed PRs wait in my queue. I merge and deploy. With auto-close switched on, the factory then declares mischief managed and closes the task, but only once it can prove the work landed: the PR merged with exactly the reviewed commit, CI is green on the merge commit, and any after-merge checks pass. I get one line saying what proved it. If any of that fails, it stops and tells me, and I close the task by hand.
As Keeper, Ron also watches the deploy and release pipelines. When a build fails or gets stuck, he reads the logs and gives me a first call: real, flaky, or infra. If he calls it flaky or infra and no retry has passed, I still hear about it. The watch only reads. I decide whether to retry or roll back.
Reviewers my teammates can ask
Hermione and Moody also live in our team chat. A teammate mentions one with a pull request link, and a job on my Mac reviews it read-only against the whole repo and the PR's CI checks, then answers in the thread. With my switches on, the review also lands on GitHub with comments on the lines. An approval counts as mine, so it needs its own switch, and it's held back for risky changes, CI that isn't green, and a few other cases.
The job fetches the linked PR and anything attached, and that's what the model sees, never the wording of the request. Follow-up questions and earlier messages in the thread do reach it, marked as untrusted text rather than instructions. The model can't browse or change anything outside its review folder, and the job does the posting.
Shared memory without carrying the history
Yes, the sessions share context. The Pensieve is a SQLite file with full-text search. When a session ends, a hook stores a capped extract of my prompts and the final replies. It leaves out tool output and scrubs emails, IP addresses, tokens, and long hashes first.
The Pensieve keeps one current fact per subject. When a fact changes, the old one stays in the bowl with its dates instead of being overwritten, so yesterday's answer doesn't quietly pass for today's. Things that change fast, like PR status, have to be looked up live or expire within a week.
A session starts with a short digest and its last checkpoint, rather than hours of chat history: the task, the decisions, and the next step, without replaying every turn.
Each weeknight, Dumbledore's portrait reviews the day for places where a desk had to find the same information again, and writes memory fixes. His additions apply on their own with a line telling me what changed. Anything that edits or removes memory waits for me.
Closing thoughts
The biggest change is where my time goes. Harry builds, the checks run, a reviewer from the other model family reads the diff, and a fix round starts on its own when the review asks for changes. Teammates' comments on those PRs go back to Harry first, and a broken build reaches me already called real, flaky, or infra.
Scripts do the watching instead of me. When a task moves, a notification on my Mac says where it stands, so my attention goes to decisions, approvals, and merges. Teammates can get a review on a PR without waiting for someone's afternoon to free up.
My token use came down a little too, since no session carries its whole history, but that was a side effect rather than the goal.
The factory doesn't have to be Harry Potter themed. That's just how I like it. The roles, handoffs, and boundaries are the useful part, and they work under any names. If I were starting again, I'd begin with one builder, one reviewer from a different model family, and scripts for the handoffs and CI watching. I'd add desks when I caught myself doing the same job by hand again and again.
