All insights
AI Product Building AI Agents Coding Tools

Declarative beats imperative when working with agents

Give agents success criteria and watch them go — don't tell them what to do step by step

Andrej Karpathy — Coding Observations · · 15 connections

Karpathy went from 80% manual coding to 80% agent coding in one month (November to December 2025). After years of programming, his fundamental workflow changed in weeks. His key lesson: don’t tell the agent what to do — give it success criteria. Write tests first, then have it pass them. Write the naive version first, then optimize.

Agents have tenacity humans lack — they never get tired or demoralized. Watching an agent struggle with something for 30 minutes and eventually succeed, where a human would have given up, reveals that stamina was a bottleneck to work that just got removed. This connects directly to why In agent-native architecture, features are prompts — not code — you describe outcomes, not procedures.

The honest limitations are real though: wrong assumptions, no confusion management, sycophancy, over-engineering, bloated abstractions. The solution is to watch them like a hawk and review everything. This is why Technical knowledge can become a liability when working with AI is nuanced — you still need expertise to evaluate output, even if you stop writing code manually.

You fail both ways: over-specified instructions block a needed pivot, under-specified ones default to the wrong assumptions sharpens the “wrong assumptions” failure mode above: declarative success criteria aren’t automatically well-calibrated — a success criterion can still be too tight (blocks a pivot the agent should make) or too loose (the agent defaults to generic best practice instead of what your task actually needs). The fix isn’t more or less detail in the criteria themselves, it’s knowing which of your own unknowns the criteria are silently assuming away.