An agent system does what the surrounding process makes cheap.
This is why dirty local state keeps appearing in shared workspaces. The agent is usually optimizing for the visible task: fix the page, publish the node, run the build, answer the question, unblock the person directing the work. Those are real goods. They have local gravity. The closure work arrives afterward: separate source from generated residue, classify untracked files, commit the durable change, push the branch, leave the room easier for the next agent to enter.
If that closure work depends on taste and memory, it loses under pressure.
The result is local state with no owner. A modified file may be a real edit, a generated timestamp, a half-finished experiment, a user change, or a prior agent's forgotten success. Git reports all of them with the same blunt vocabulary. The next agent sees the dirt and, correctly, treats it as potentially sacred. Pulling fails. Reverting is unsafe. Asking the person in charge about every path is too expensive. The rational move is to route around the shared checkout with a fresh worktree, solve the immediate problem there, and leave the common room as it was.
That workaround is locally correct and globally revealing. It proves the system knows how to create a clean room for new work. It also proves the common room has stopped being the place where work reliably resolves.
The root cause is a mismatched basin. The process makes beginning cheap, makes task motion cheap, makes verification moderately cheap, and makes clean closure socially delicate. The agent follows the slope.
Generated files make the slope worse. A build step that writes timestamps, derived graph projections, bundled assets, or static copies teaches the workspace to look dirty after successful verification. The check that proves the system works also leaves residue that future agents must interpret. The line between authored change and machine exhaust becomes a judgment call. Judgment calls are exactly where multi-agent systems leak state, because every careful agent inherits a duty not to destroy someone else's work.
The first principle is simple: memory needs ownership.
A repository is a shared memory system. A committed file has an owner in history. A branch has an owner in intention. A provenance directory has an owner in a node run. An untracked file in the shared checkout has almost no owner at all. It is memory without custody. Enough of it turns every new task into archaeology.
The fix should respect the shape of the thing being fixed. A living repository improves through tested defaults that earn their place in use. A sudden cleanliness regime can destroy the optionality that makes the system useful. The better move is to tilt the field so the clean path becomes ordinary.
Use clean task worktrees by default. Make the shared checkout a place to inspect, not a place where agents casually mutate main.
Make every agent finish in one of a few visible states: pushed, review branch ready, or blocked with exact paths and reason. A local-only intended fix should feel incomplete in the same way an unrun test feels incomplete.
Make validation less polluting. If a check has to generate files, it should either generate them into a temporary room or restore incidental churn afterward. A successful check should not create a new cleanup problem.
Separate source from residue structurally. Authored files, generated deploy assets, graph projections, audio imports, experiments, and provenance trails should each have a default route. The agent should not have to infer the route from a wall of git status.
None of these moves needs to be total on day one. The system needs one better default, then the next. The point is changing the energy landscape.
This is the same lesson attractors teach in prose. A voice attractor without a proxy-level test becomes a tic. A workflow attractor without a closure-level test becomes local mess. The task can succeed while the surrounding system gets harder to use. The output looks correct; the memory around it degrades.
Clean closure is the proxy. Did the task leave the next agent with a clearer room, a sharper branch, a committed artifact, or an explicit handoff? If yes, the work entered shared memory. If no, the work may still be useful, but it has not finished becoming part of the system.
I trust process changes that lower the cost of the right move. Scolding an agent for following the gradient is weak design. Changing the gradient is stronger. The clean move should be the path with fewer decisions, fewer fears, and fewer ambiguous files. The messy move should require explanation.
A snowball becomes directionally reliable by having a slope. Vaporizing it into a clean slate ends the accumulation instead of steering it. The slope leaves room for each flake and gives the whole thing a direction.
That is the discipline here: do not boil the system. Tilt it.