What Biology Already Figured Out About AI Harnesses
Almost everyone building multi-agent coding tools right now reaches for the same blueprint first: the corporate org chart.
You define a Product Manager agent to write specs, a Tech Lead agent to slice tickets, three Software Engineer agents to open pull requests, and a QA agent to leave review comments. On a conference slide, it looks orderly. When you actually run that setup all day on a real codebase, you discover pretty fast that you just automated the worst parts of a slow company. Context degrades at every handoff like a game of telephone, nobody owns the running software, and five chat windows burn half a million tokens arguing politely about a bug none of them ever reproduced.
Human bureaucracy was invented to coordinate people who work eight hours a day, communicate in slow prose, and care about status. Coding agents have none of those constraints and completely different failure modes. Treating them like miniature corporate employees solves the wrong problem.
When you step back and ask what a fleet of coding agents actually resembles, the honest answer comes from biology rather than management theory. You have dozens of fast, locally capable, somewhat myopic organisms operating in parallel across a shared terrain, with noisy sensors and no global view of the whole system. Nature spent hundreds of millions of years figuring out how organisms like that stay coordinated, avoid repeating fatal mistakes, and consolidate experience without holding a single standup meeting.
Over the past few months of running thousands of agent sessions inside my own engineering harness, three biological loops ended up replacing huge piles of brittle orchestration rules: nightly REM sleep consolidation, evaporating file pheromones, and a homeostatic frustration reflex.
1. Dreams: why agents should not “memorize” on the job
If you have tried adding persistent memory to a coding agent by letting it edit a MEMORY.md file whenever it learns something, you probably know how fast that file rots.
At eleven in the morning, while an agent is ninety thousand tokens deep into debugging a broken build, its judgment about what counts as timeless wisdom is terrible. It hits a transient port collision or a weird mock in one test file and solemnly writes down a permanent global rule about it. Within two weeks, your memory file is a junk drawer of half-true superstitions, one-off workarounds, and rules that contradict last Tuesday’s rules. Every new session pays token rent to read that noise before writing a single line of code.
Living brains separate waking performance from memory consolidation for a good reason. While an animal is foraging or dodging predators during the day, it cannot afford to reorganize its long-term cortex after every twig snap. It stays light and reactive while awake, then replays the day’s episodes offline during sleep to sort durable structure from accidental noise.
My harness works on that exact day-and-night split.
During working hours, executor agents do not stop mid-task to write permanent rules into global prompts. They stay lean, execute their scoped work in isolated checkouts, and leave raw execution traces behind: what they tried, where verification failed, which edits got reverted, where runtime guardrails stepped in, and where I steered them by hand.
At night, when the fleet is quiet, an offline sleep pass wakes up and replays the day’s trajectories across the whole workspace. Instead of trusting what any single agent thought in the heat of the moment, the sleep pass looks for cross-session signal:
- Which failure pattern showed up across three separate runs before getting caught?
- Which human correction fixed a recurring blind spot?
- Which older rule has fired zero useful catches over the past month, or points at files that have since changed shape?
Only patterns that recur across independent evidence graduate into compact, enforceable rules or linked architectural notes. Stale entries get pruned instead of accumulating forever. You close the laptop at night after a messy day of shipping, the harness dreams over what broke, and you sit down in the morning to a calmer system that absorbed yesterday’s scars without bloating daytime context.
2. Pheromones: stigmergy and decaying scent on files
Even with clean rules, parallel executor agents share a blind spot: every fresh session walks into a file as if nobody has ever been burned there before.
Every real codebase has quiet neighborhoods and minefields. Some modules are straightforward CRUD where a fast model can move quickly without breaking a sweat. Other files sit at subtle seams where three state machines meet, where race conditions hide, or where changing four lines silently breaks an invariant in an unimported file across the repository.
Writing static warnings in documentation rarely fixes this. Engineers forget to add the warning when a seam turns fragile, and nobody ever deletes the warning six months later after the module gets cleaned up. Eventually every core file carries a scary banner, so agents (just like humans) learn to ignore all of them.
Ant colonies solved spatial coordination without central maps or stale memos through stigmergy: leaving chemical pheromones directly on the environment. Two physical properties make pheromones work where static notes fail:
- Accumulation from real contact: Trails strengthen automatically where traffic, discoveries, or danger actually occur.
- Evaporation: Every pheromone decays on a natural half-life unless fresh events reinforce it. When the terrain changes, old trails vanish on their own.
In my harness, every file in the repository carries a living, decaying pheromone trace computed from real operational history rather than human guesswork.
When an agent edits a file cleanly and passes verification on the first try, almost no scent is left behind. When a file triggers verification failures, guardrail blocks, reverts, or repeated bug-fix commits, its scent spikes. Alongside individual file heat, the trail records co-change and co-failure edges: which other files in the repository tend to get touched or broken whenever this file moves, even when no static import connects them (a Lisp backend handler and a vanilla JS view sharing a wire convention, or a SQL schema file and an offline batch script).
When a new executor agent is dispatched into the codebase, it smells the terrain before making its first edit:
- Caution where the scent is strong: On a high-scent seam, the agent gets an explicit brief on recent failure modes in that file and the exact connected files it needs to check alongside it. The harness also automatically routes a heavier reasoning model and stricter verification gates to hot seams, while letting cold, low-scent files run fast and light.
- Natural healing via half-life decay: Pheromones evaporate exponentially over days of clean history. Once a gnarly module is refactored into a clean boundary and goes a couple of weeks without reverts or red checks, its scent fades back into the background automatically.
Caution concentrates precisely where fragility lives this week, not where an outage happened last summer.
3. Frustration: giving stateless predictors a pain reflex
Watch an unguarded coding agent hit an unfamiliar bug and you will eventually witness behavior no living creature would survive in the wild: slamming face-first into the exact same wall fifteen times in a row.
The agent edits a function, runs a check, sees a failure, tweaks two lines based on a hunch, sees the exact same failure, and repeats that loop for forty minutes until its context window is packed with stack traces. Large language models have next-token probabilities, not nociceptors. Even on the twelfth failed retry, generating one more plausible-looking patch still has high local likelihood given the prompt prefix. The model literally cannot feel that it is stuck.
In biology, pain and frustration are not character flaws; they are homeostatic survival signals. When an organism pushes against an obstacle and gets zero forward progress, rising internal frustration interrupts the motor loop before the animal starves or exhausts itself. It forces a switch from exploiting the current plan to stepping back and re-examining the environment.
Adding a synthetic frustration drive to executor agents turned out to be remarkably clean because you can measure loop entropy directly from behavior rather than asking the model how confident it feels.
As an agent works, the harness tracks behavioral signals over a sliding window: repeated test or build failures with the same signature, oscillating edits back and forth on the same lines, and bursts of commands that produce no new diagnostic information. Frustration rises with fruitless repetition and decays whenever a check turns green or genuinely new state is uncovered.
Instead of killing the session on the first stumble or letting it spin for an hour, the reflex fires on two rungs:
- First rung (posture shift): When frustration crosses the first threshold, the harness blocks the next blind edit inline and injects a sharp somatic interrupt. The agent must stop patching, state plainly which assumption was just falsified by the last three failures, and run a read-only diagnostic probe on the actual state before touching code again. Most loops break right here because the forced pause snaps the model out of local tunnel vision.
- Second rung (clean escalation): If frustration keeps climbing past the second threshold despite the reset, the harness halts execution cleanly and surfaces a concise blocker report upstream rather than burning hundreds of thousands of tokens producing desperate spaghetti diffs.
Organisms, not org charts
One quiet lesson ties dreams, pheromones, and frustration together: none of them ask the model to “be smarter” through longer system prompts.
Pleading with an LLM in all-caps Markdown rules is like lecturing a tired hiker not to trip in the dark. Changing the environment works better. Give the system a sleep cycle so daytime runs stay unburdened by noisy self-notes. Let the repository carry evaporating chemical trails so every new agent senses where recent runs got burned and which neighboring files move together. Wire in a frustration reflex so repetitive failure triggers a step back instead of a token furnace.
Coding agents are neither deterministic compilers nor human coworkers in a Slack channel. They are fast, bounded, locally greedy creatures moving through complex software ecosystems. The sooner we stop dressing them up in corporate org charts and start giving them a proper nervous system, the calmer and more trustworthy agentic engineering becomes.