Source

Make All Your Tokens (and Your Brainwork) Count: Agentic loop coding works until it fulfills a goal. Here's an agentic way to iterate on your goals to find the right one.

Open the source

Andrew Ng teaches how to build product specs that drive agentic coding loops for quick 0-to-1 applications. His organizing principle is that AI tokens are cheap and human tokens are gold, so he argues for writing a quick, imperfect spec, letting the agent build, reacting to the result, and iterating, while making the agent record key human decisions so they are never lost.

- Agentic coding loops have an agent keep working until it satisfies a condition such as a product spec, and writing that spec or eval is a key place to inject human knowledge. - For large, complex systems, he says it is worth architecting carefully up front to avoid hard-to-change bad decisions. - For 0-to-1 prototypes, he prefers writing a quick inferior spec, seeing what the agent builds, examining its assumptions, and refining the spec iteratively rather than treating the spec as a waterfall gate. - Early code is cheap, so it is fine to throw away the codebase and restart; what is learned from testing is more valuable. - He has the agent record key decisions in a file like SPEC.md, because forgetting human instructions wastes the most valuable tokens. - When fixing a problem, he tells the agent to also update the spec and test plan so future stopping criteria check that the problem does not recur.

Based on Andrew Ng's public content. Not affiliated with or endorsed by Andrew Ng.

Supports these rules

Quotes from this video

“I encourage you to put the coding agent to work, maybe even earlier than might feel comfortable, see what it comes up with, and use that as a starting point.”

“Instead of "spec drive development" becoming a new waterfall process where writing a spec is a gate to further progress, this allows me to more iteratively”

“Thinking through such questions in advance helps to avoid being stuck with a bad decision that is hard to change.”

“when I make key decisions, I often steer the agent to remember that decision somewhere, say in a SPEC.md file.”

“often I tell the agent not only to fix it but also to update the spec (and perhaps the test plan), so the agent’s stopping criteria in the future require checking that this problem does not occur again.”

Topics