Put the hardware in the loop. An AI coding agent working on a connected product should be able to run its change on the real device while it works, then read back the device log, the app's screens and the measurements from the run.
Connected products have always been built by working directly with real hardware and real phones, so our coding agents should be able to do the same. An agent learns the effect of its change by running it on hardware: on the device, with the app and, ideally, the cloud.
Why Hardware? The Hardware Knows the Truth
The device holds the answers. Run the change on it and the product reports its timing, its current draw and every line of its log.
Many of the mistakes Claude makes with hardware in the loop only appeared once the change ran on the device.
A real device runs the whole sequence: the startup, the exact moment the radio comes up, the flash controller busy with a write in flight. All of it is recorded in the device log and on the instruments.
Timing, current draw, and the device's behavior when the power drops halfway through a write to flash only show up on a running device, where an instrument reads them off the product. Cut the power at the wrong microsecond and the device comes back with a half-written page in flash.
Take a sensor fresh out of the box. The firmware sends a reading when the value changes, the app subscribes once pairing completes, so the app shows an empty panel until something in the room moves. Two correct pieces, one broken flow: unboxing the sensor and seeing its first reading in the app. The flow they add up to only runs on the device.
The flow they add up to only runs on the device.
Why in the Loop? The Agent Gets It While It's Hot
The answer is worth most while the agent still has the whole change in its context: the line it moved, the reason, and the result it expected. If it reads the device's answer at that moment, the fix is a small edit.
When the answer comes back in minutes, the work moves in minutes. The agent flashes the build, runs the flow with the app and the cloud, reads the step that failed, changes the code and runs the flow again.
What an agent can take on is set by what can be checked. With the product answering while the work happens, an agent can take on changes that reach across the whole product. A new cloud sync interval means a new wake-up schedule on the device and a new waiting screen in the app: one change in three places, validated by a single run of the flow.
What an agent can take on is set by what can be checked.
The Agent That Writes the Code Now Runs the Hardware
An agent runs the same flow a hundred times, with the same steps and the same checks on the hundredth run as on the first. So the flows can run around the clock, with every result logged.
The agent also drives the hardware itself. Flashing an image, power cycling a device, tapping through the app on a phone, waiting for the cloud to catch up: all of it is software work, the kind agents handle well. So the agent can run the hardware whenever it needs to test or validate its work.
The agent also reads the instruments. Current draw, the run time of a piece of code, the memory left with the radio up: each one arrives as a number. The agent changes the code, runs it again, and watches the number move.
How Groundrun Puts the Hardware in the Loop
Groundrun puts the whole product in your coding agent's loop: your devices, your app on a phone, and your test cloud.
The devices you ship and the phone are cabled to a small computer that flashes the firmware and drives the app. Together they make a rig, built around your product and operated by the agents themselves, so each flow runs the way it would for a person using your product.
The agents start a run with Groundrun's command-line tool, then read the device log, the app's screens and the measurements from inside the same coding session where they write the change.
The rig also measures the product while a flow runs, current draw included. So an agent can work on battery life and performance in the same loop as the code.
The agent writing the change is also the one that ran it on the product.
See how Groundrun puts your product on the rig and lets the agents run it, on the platform overview.