Product Launch3 min read

AI Agents Now Act While They Are Still Writing Their Code

By , Senior AI ConsultantPublished

Framer's design agent now runs the program it is writing as the words arrive, which turns a request like replacing an old brand color across a whole site into one job instead of hundreds of steps.

Framer's design agent now runs the code it writes while the model is still producing it. Instead of waiting for a finished program, Framer runs each complete statement as it arrives, so edits show up on the page while later lines are still being written.

One program replaces a long list of steps

Most AI agents work like a careful assistant who asks permission after every move. The model decides on one action, the tool does it, and the model is called again to decide the next. Every call makes the model read the whole conversation again, and that re-reading is billed as input tokens, the pieces of text a model reads and writes.

For small jobs that is fine. For "change this on every page" it is slow and expensive, because the job is a hundred nearly identical steps. Framer's new design lets the agent write a short program with a loop and an if-statement and hand it over once. It reads the document, decides, changes and publishes inside that one program. Framer measures 39% fewer repeated input tokens per message with no measured drop in quality.

Here is what that could mean for a shop owner. Suppose she runs a site with 300 product pages and moves her free-shipping threshold from $50 to $75. The agent can write one loop that looks through every page, rewrites the ones that mention $50 and leaves the others alone. The old method could mean up to 300 separate edits, each with its own round trip.

Running code before it is finished

The loop has a catch. A long program takes a while to write, and you would stare at a blank screen until it was done. Framer's answer works the way a video starts playing before the whole file has downloaded. As the code arrives, it is cut into complete statements, and each one runs as soon as it is whole. Comments the model writes, such as a note that it is now building buttons, turn into progress messages.

This also changes what a failure costs. The agent is told to check its assumptions at the top of the program. If a check fails, for example the page it was told to edit does not exist, the run stops and the rest of the writing is cancelled. The error comes back with an explanation, so the next attempt fixes the wrong assumption instead of repeating it. If the program had to be finished before it ran, the model would already have written, and been paid for, all the code that never mattered.

One limit follows from this. Edits that already happened stay in the document when a run is cancelled, so a stopped program can leave a job half done. That is why the check should come first, and it is a good habit when you give an agent a big request yourself: say what has to be true before it starts.

None of the parts is new, and that is the point

Letting a model write code instead of calling tools one at a time was already a known idea. In late 2025, Anthropic described it, and it reported cutting a workflow from 150,000 tokens to 2,000. A research paper in April 2026 showed that code can run while the model generates it, using Python. Framer believed it was first, found the paper while writing up its own work, and said so.

Three separate groups reaching the same design suggests it follows from how the costs work: the model's reading and writing is billed, and each round trip repeats the reading. Any tool where an agent edits a large pile of similar things will probably move this way. Spreadsheets, accounting software, product catalogs and ad accounts are all full of the "change this everywhere" requests that suit a loop.

The same route is also open to assistants that Framer does not make. Outside agents such as Claude Code can send Framer one program that runs inside the design file.

So when you ask an agent for something, ask for the whole job, not the first piece of it. Say what must be true before it starts, such as "only if the old color is actually used", and let it run.

Share this

STAY INFORMED

Get AI intelligence like this delivered to your inbox.

Free forever · Unsubscribe anytime


You May Also Find Valuable