Capturing intent
Pre-generation
At the time of writing (Nov 2026), engineers have been doing a few things to increase the likelihood of coding agents capturing a human's intent accurately. I've split them into two categories: pre-generation and post-generation, that is, before the agent generates anything and after it has generated something.
Pre-generation is about narrowing the guess before the agent makes it.
The biggest one is writing the spec first. Anthropic's Claude Code best practices suggest having the agent interview you until it could write the spec, saving it to a SPEC.md file, then building from it in a fresh session so the build starts with "a written definition of done." GitHub's Spec Kit turns that into a process it calls Spec-Driven Development, where a specification is carried through planning and implementation.
Then there's the context the agent can't get from the code. AGENTS.md is an open format, basically a README for agents, where you put build steps, test commands, and conventions. The site says it's used by over 60k open-source projects. Claude Code has its own version, CLAUDE.md, plus skills for team procedures, like how you cut a release.
And keep tasks small. In my experience, the smaller the ask, the less room there is for a wrong guess.
Post-generation
Post-generation is about checking the guess after it's made.
Anthropic's advice here is blunt: give the agent a check it can run that comes back pass or fail, like a test file, a build's exit code, or a linter. Without one, as the guide puts it, "that makes you the test suite."
Tests, type checkers, and CI are the deterministic layer. The same Claude Code guide splits instructions into two kinds: non-deterministic ones the model reads and decides what to do with, like your prompt or CLAUDE.md, and deterministic ones the tooling enforces every time, like hooks, tests, typechecks, and CI.
Then there's review. An AI reviewer in a fresh session reviews the diff without having seen the conversation that produced it. And at the end, a person approves the merge. Anthropic even warns that "All tests pass" on its own tells you very little, so ask for the evidence.
There's an experimental branch of post-generation tactics that's emerging: proof languages like Bend. In Bend, you write the rules your app must never break in a LAWS.bend file, and whenever the code is edited, the compiler demands a mathematical proof that those laws still hold. If the AI's change breaks a law, it gets blocked. The way I see it, though, a proof only shows the code keeps the rule, not that you picked the right rule, so you still have to speak the language. But for the sake of brevity, I'll digress.
Notice what both lists have in common. You can't write a good spec if you don't know what the code should do, and you can't judge a test, a lint rule, or a diff in a language you don't speak.
Post-generation is where DSA earns its keep. It's how you read the diff and know whether the message arrived intact.