Saturday morning. The bed is buried under a week of family laundry: jeans, hoodies, work shirts, tiny pajamas, a pink puffer vest, and a scatter of socks that may or may not have partners.
Before I fold a single thing, I do what I always do. I split the mountain into piles. Mine. My wife's. Our toddler's. Only then do I start folding.

My wife has teased me about this for years. Who sorts the whole pile before folding anything? This morning I answered without thinking: "I'm just sorting the way I use SQL."
It was a throwaway line. But it stuck with me through the second load, because it's true. And because it's exactly what I've spent the last several months trying to teach AI agents to do.
GROUP BY before you fold
Folding is the expensive operation. Sorting is cheap. If you partition first, every pile gets one set of rules.
The toddler's clothes are small, get folded in thirds, and all go into one dresser. My shirts get hung. My wife's things have their own system that I've learned not to improvise on. Sort first, and each pile is folded once, carried once, and put away once. Fold first, and you walk across the house for every sock.
In SQL terms, it's PARTITION BY owner, then apply the per-partition logic. Nobody taught me to do laundry this way. Years of working with data just shaped how I attack any messy pile of work: find the grouping key, split, then process each group with rules that fit it.
Here's the thing. A model doesn't have that reflex for your domain. Hand a capable model the whole pile and say "fold the laundry," and it will. Competently, one item at a time. The output looks fine. The process is wasteful, the results drift between runs, and when something comes out wrong you can't tell why.
The harness is where your instincts live
The harness is everything around the model: the system prompt, the tools it can call, how context gets assembled, memory, skills and playbooks, how work is split across sub-agents, the guardrails, and the evals that tell you whether any of it works.
The model is the hands. The harness is the order of operations.
Most of the conversation about agents is still about which model to use. That matters less than people think. The difference between an agent that folds every sock individually and one that sorts first isn't intelligence. It's whether someone wrote down how the work should be decomposed.
Why the harness is worth the investment
Models are rented. The harness is owned. A better model ships every few months, and you'll switch. A well-built harness moves with you and usually gets better on the new model. Work on the harness compounds; work tuned to one model's quirks expires.
It encodes judgment, not just instructions. "Sort before you fold" isn't a rule about laundry. It's a strategy that applies to any pile. Skills and playbooks are where strategies like that get written down, so the agent starts each task with your decomposition instead of inventing its own.
Context is the scarcest resource. Partitioning means each sub-agent gets only its pile. Smaller, homogeneous context produces better results and costs fewer tokens. Dumping the whole pile into one context window is the agent equivalent of folding on the floor.
Partitions parallelize. Once the piles exist, they can be folded at the same time by different hands. Split work fans out to sub-agents; a single undifferentiated task can't.
Failures become legible. When an agent gets something wrong inside a structured harness, you can see which step failed: the sort or the fold. Without structure, you get a wrong answer and a shrug.
You can measure it. An explicit process can be evaluated step by step. An instinct can't. Evals turn "it seems better" into a number you can track across model upgrades.
Finding your GROUP BY
Before writing a prompt, write down how you would actually do the task. Not the goal, the process. Then turn it into harness:
- Find the grouping key. What do you split on before doing any real work? Owner, file type, customer, risk level, service boundary.
- Make the cheap step cheap. Give the agent tools that do the sort deterministically: a query, a classifier, a file glob. Don't spend reasoning tokens on what a
WHEREclause can do. - Write per-partition rules. Each pile gets its own skill or playbook with only the rules that apply to it.
- Scope the context. Each sub-agent sees its partition and its rules. Nothing else.
- Evaluate each stage. Check the sort separately from the fold, so you know which one to fix.
Take a code review agent. The naive version reads the diff top to bottom and comments as it goes. The harnessed version groups the changes first: migrations, API contracts, UI, tests. Then it reviews each group against the checklist that actually applies to it. Same model. Very different review.
Your instincts are the asset
My wife is right that it's an odd way to fold laundry. But the habit is years of experience compressed into a reflex: partition, then process.
Models show up without your reflexes. They're brilliant generalists who have never seen your house, your codebase, or your customers. The harness is where you teach them.
The most valuable work in building agents right now isn't choosing the model. It's writing down how you sort the laundry.
Next up, in Part 2: the thousand-line prompts I wrote before I had a harness, and why they only got me close.