Illustrated by Claude
Show animation
As we experience the ongoing AI transformation of the software industry, it can feel like the ground is constantly falling out from underneath us as many of the best practices we spent our careers learning are called into question.
Further reading: Code review is dead, long live code review; How AI-generated code accelerates technical debt, on DRY slipping; The end of process theater, on sprints, story points and standups; Code is no longer written for humans.
Show animation
Even the most historically durable tools like git and Emacs seem like they may no longer be fit for what the job now demands.
Further reading: Redesigning source control at Anthropic, on Scion, which replaced git for Anthropic’s monorepo; How version control will evolve for the agent boom; the race to rebuild code hosting for agents; Write-Only Code and Read the code, on no longer reading code by hand.
Show animation
Because it changes so rapidly, our industry tends to neglect history in favor of the Next Big Thing. This results in endless churn, where old ideas are reinvented and repackaged as something new, not always crediting what came before.
Sources: Cybernetics (Norbert Wiener, 1948), on feedback; Plans and the Structure of Behavior (George Miller, Eugene Galanter and Karl Pribram, 1960), which introduced the TOTE loop; Shakey the Robot (SRI, 1966 to 1972), which sensed, planned and acted; ReAct (Shunyu Yao and others, 2022), the reason, act and observe loop agent harnesses run.
Show animation
To make meaningful progress, we have to build on past contributions without letting them become a dogma. To avoid being overwhelmed by the sheer volume of information, we must compress the essentials into something we can understand.
Show animation
To understand the fundamentals of software development with agents, it is helpful to look beyond the typical computer science fundamentals. Data structures, algorithms, and theory of computation remain foundational, but as model capability increases, there are fewer opportunities to apply this knowledge directly in most domains.
Show animation
Instead, some of us are looking at a discipline that abstracts from computing, physics, biology, and other sciences in order to study what they all have in common: Cybernetics.
Show animation
Cybernetics takes its name from the Greek kybernētēs, the steersman. Norbert Wiener introduced the term in 1948 to describe systems that steer themselves by measuring the gap between where they currently are and where they’re supposed to be using sensors, and then incrementally closing the gap using actuators.
Show animation
From this perspective, coding agents are powerful but noisy actuators: they move a codebase far and fast, with unwanted results along the way. Control theorists have spent more than a century learning to point actuators like these at a target. Setting aside the question of what to aim for, this is the primary challenge of software development with agents.
Show animation
A central insight from control theory is that most answers to this challenge combine two kinds of control: feed-forward and feedback. Feed-forward acts on what you know before anything has been measured. For an agentic development session, that’s the context, which includes the system prompt, project guidance, and the initial prompt.
Show animation
Feedback acts on what you measure during operation: formatters/linters, type checkers, tests, and telemetry. Feed-forward is efficient but only as good as your initial model of the situation. Feedback catches surprises, but it arrives after work has already been done.
Applying this lens to the software development process as a whole yields a series of nested and interconnected loops1:
Show diagram
The edit loop is that of a single agent session modifying the software: infer, act through a tool (read, edit, run), observe the result, repeat.
1 Of course, these loops are not the only way to do software development with agents, and I’ve omitted some critical loops, like the ones we use for design and product vision. ↩
Applying this lens to the software development process as a whole yields a series of nested and interconnected loops:
Show diagram
The task loop sits outside of it and defines the verifiable outcomes that indicate that some unit of work is complete.
Applying this lens to the software development process as a whole yields a series of nested and interconnected loops:
Show diagram
The workflow loop is the meta-loop where we repeat tasks using different machinery in order to improve the machinery itself.
Applying this lens to the software development process as a whole yields a series of nested and interconnected loops:
Show diagram
The decision loop is where we define our intent, what we want the system to be. It generates tasks based on the gap between our intent and validated outcomes, sets their priorities and budgets, and tracks the resources each task actually used in order to better estimate future costs.
Applying this lens to the software development process as a whole yields a series of nested and interconnected loops:
Show diagram
The user loop is where we collect feedback from the people our software is ultimately meant to serve.
The edit loop
Closes on every edit.
Move every rule you can into a program
output transformation · idempotence · interlock
Instead of filling agent context with all of your rules and style guidance, any rule that can be expressed in a deterministic program should be.
Show animation
Another example: agents should be blocked from editing deprecated code unless you give explicit approval in a session. This avoids piling changes onto subsystems that you’re trying to phase out.
Show animation
A last example: keep large files and whole subsystems from growing past a limit. A check that fails when a file passes its line budget, or a subsystem passes its size, turns “this is getting too big” from a review comment into a signal that triggers an evaluation of how to split or refactor it.
Treat type checking and verification as feedback
feedback · semantic errors · full coverage
Unlike a formatting diff, a type error tells the agent that its code is fundamentally incorrect, so it’s worth giving the agent a chance to respond to it.
Show animation
Type checkers are an example of formal verification techniques already being used in everyday code. Rust takes this a step further by eliminating memory errors at compile-time.
Show animation
Newer languages like Bend extend formal verification to the correctness of the program’s behavior. Even when verification is not built into the language, using tools like Lean and TLA+ can help to create a bulletproof reference of desired behavior that agents can check an implementation against.
Relevant projects: postcard-serializable, which moves a serialization failure from runtime to compile time, and x0k-datum (vectors/)
Give the agent the system’s telemetry
feedback · observability · honest sensors
After static analysis, the agent’s richest feedback inside a session is the running system itself. Collect every instrumented process’s traces, logs and events in one place the agent can query, so when something fails it asks what happened instead of guessing from a stack trace or adding temporary print statements.
Show animation
x0k-timeline keeps spans, logs and events from every instrumented process on a machine in one local store that an agent queries with SQL over MCP or CLI.
Relevant project: x0k-timeline
Let the agent operate the UI
feedback · observation · motion · keyframes
Show animation
For UI work, compilation errors and traces say little about whether the screen looks right. Give the agent the same loop a frontend developer uses: change the code, look at the screen, act, look again. x0k-ui-control lets an agent observe and interact with a running app. It steps its clock one frame at a time, so animations can be checked frame by frame instead of from a single screenshot.
Relevant project: x0k-ui-control (vectors/)
The task loop
Closes when the checks that define done pass.
Make your guidance file a router
feed-forward · gain scheduling · context as noise
Show animation
Your top-level agent guidance file should work more like a router that tells agents where to find more specific guidance based on what’s relevant to their situation.
Further reading: pstack, poteto’s (Lauren Tan’s) plugin: one routing skill, /poteto-mode, over playbooks for each kind of task and one-rule principles they cite.
Prefer tests that see what users see
feedback · output measurement · cascade control
Show animation
Focus your time and attention on e2e / blackbox testing that exercises your entire system as a user would. If your system involves networking, use NixOS VM networks to simulate entire network topologies. Measure the performance properties you want, such as latency, memory and throughput under load, as well as correctness, so a change that slows the system fails like one that breaks it.
Make loops your default unit of work
controller · model predictive control · limits
Show animation
Instead of individual prompts, make loops (see Geoffrey Huntley’s ralph loop) your default unit of work. Loops extend the horizon of what can be accomplished autonomously and help make cost and outcomes more legible before you commit tokens.
Show animation
Make your issue tracker and roadmap directly accessible to agents and add as much relevant context as possible up front. Use this to plan a loop that will achieve the next most important outcome by breaking it down into verifiable steps with appropriate model choice and a cost estimate for each step.
Show animation
When it’s done, review and do a retro with your agent to surface follow-ups or potential process improvements.
The workflow loop
Closes when evals show that a change to the machinery helped: guidance, tools, libraries or models.
Build an improvement loop
adaptation · double-loop learning · iterative learning control
Show animation
First establish an improvement loop for agents in your codebase. Store agent trajectories and use them to write evals. Use the evals to validate that your workflow improvements are working.
In this loop, software engineering starts to look like machine learning research. Rather than writing output by hand, you shape the process that produces it, and the output itself may not be understood in detail. Guidance, tools, and model choice are the architecture and hyperparameters, evals are the validation set, and trajectories are the training logs. The familiar failure modes apply here too: an agent that edits its own tests is overfitting to the test set.
Give agents the right building blocks
actuator design · interfaces · libraries · tools
Show animation
Like people, agents tend to reach for the tool that’s close at hand in order to complete a task. Given the right primitives, it will compose them nicely, but if it doesn't find the tool it needs in the toolbox, it will tend to create another one. When trajectories show agents repeating the same workaround, fix the root cause: a narrower interface, a type that rules out the wrong state, or a CLI or MCP tool that turns ten steps into one.
Relevant projects: postcard-serializable and x0k-folio
Architect for layers of malleability
controllability · loop gain · damping
Show animation
Architect for layers of malleability: changing foundational code that’s security or performance critical should still have some friction, but you should be able to change your UI and much of the underlying logic while the system continues to run.
The decision loop
Closes when documented decisions verify.
Write decisions down and link them to code
reference · error signal · setpoint
Show animation
Rigorously document product decisions and link them to the code that implements them (you can use something like x0k-folio). This allows you to ask agents to survey where documented decisions are not yet (or incorrectly) implemented, then you can plan loops to close gaps.
Show animation
Include open questions in order to track what still needs your attention before implementation should proceed. Consider linking documented decisions with e2e tests that validate whether the decision has been verifiably implemented.
Relevant project: x0k-folio (IMPLEMENTATION.md; a decision with open questions)
The user loop
Closes when what shipped holds up for the people using it, by their feedback, their usage and what you observe.
Deploy continuously
sampling rate · fast correction
Show animation
Follow continuous deployment practices: releasing frequently forces you to build proper guardrails, optimize verification processes, and make sure you can respond to critical issues quickly.
Relevant project: x0k-release-metadata, which lets a self-updating program verify that its maintainers signed a release before installing it
Measure what people do, not only what they say
sensor fusion · observability · bias
Explicit feedback is the loudest signal in the user loop, but it only comes from the people who take the time to write in. Usage data shows what people actually do: the paths they take, where they stall, what they never touch. Observation can help explain why, whether that’s watching someone use the product or reading the sessions where it went wrong.
Show animation
All of these signals should be input to your decision-making process to help eliminate the bias of each one. In control terms, several independent sensors on the same output make the estimate harder to fool than any one of them alone.
Let users change it, and upstream what works
distributed control · user as controller
Show animation
Agents make it practical for the people using your software to change it themselves, on their own copy and for their own problems. Treat their changes as a signal: when several users patch the same gap, consider upstreaming the change.
Schedule an agent to triage
state estimation · filtering · disturbance
Show animation
Schedule an agent to triage bug reports, eliminate duplicates, link related issues, and even propose fixes proactively.
Conclusion
As tools and models improve, the structure that makes the most sense for your organization is bound to change, and practices that are useful today will become unnecessary. The only constant here is change, and so, to get a grip on things, we must study change itself: the art of steering. We will continue to build goal-directed systems with sensors and actuators. To steer them effectively, we must know what to measure, how to correct errors, and how to set the right invariants. This is what I mean by training your software: instead of writing and reviewing every change, you learn to steer an evolving system towards your goals.
Cybernetics, the art of steering, applies equally well to agentic engineering as it would to steering a company run entirely by agents. It extends beyond software and into the more physical areas of robotics, manufacturing, logistics, and even biology.
Finally, with this lens we can see that there is no one-size-fits-all solution to the problem of AI transformation. True value comes from being able to steer your systems towards your unique goals. If you’d like help adapting these ideas to your context, send an email to hello@lanespangler.com.