Why LLMs can't really build software
TL;DR Highlight
LLMs write code well but can't keep mental models, so they stall on non-trivial software work.
Who Should Read
A developer who handed work to an AI coding agent and got stuck in failing-test and delete-and-restart loops.
Core Mechanics
- Good engineers run a loop
- They build a mental model of the requirements, then write code.
- They build a mental model of what the code actually does, find the differences, and update the code or the requirements.
- What sets effective engineers apart is keeping those mental models clear.
- LLMs write code but can't hold the model
- They are good at writing code, fixing it when told the problem, running tests, and adding logging.
- But they cannot maintain clear mental models.
- The same confusion patterns repeat
- They assume the code they wrote works.
- When tests fail, they guess whether to fix the code or the tests.
- When frustrated, they delete everything and start over.
- Three structural weaknesses
- They are bad at finding omitted context.
- They show strong recency bias in the context window.
- They hallucinate details that shouldn't be there.
- Improvement needs a change in how models are built
- The author says models must be built and optimized differently.
- He notes work is being done on adding memory.
- For now, beyond a certain complexity, they can't actually understand what is going on.
- Useful, but the human drives
- They generate code fast and are excellent at synthesizing requirements and docs, and can one-shot simple tasks.
- For non-trivial work they can't keep enough accurate context to iterate to a working solution.
- The engineer is responsible for clear requirements and for verifying the code does what it claims.
Community Reactions
- TDD with Sonnet 3.7 worked fine, one user says
- Using Cline with Sonnet 3.7 doing TDD on Rails, the model wrote tests first and worked in small chunks.
- It reasoned well about failures and fixed the right place, about as well as or better than a junior engineer.
- Red-Green-Refactor wording helps, one commenter suggests
- State in the prompt whether you're in RED, GREEN, or REFACTOR.
- This gives the LLM the TDD mental model so it is less confused about fixing code vs. tests.
- Small chunks work better, per user experience
- Giving an existing modal as a style example and handing over small tasks one by one worked much better.
- Another commenter says that if you hold the theory and let the LLM type, code writing gets about 10x faster.
- A two-hour GPT-5 failure as a counterexample
- Asked about a wgpu runtime error, GPT-5 kept giving plausible, confident fixes that didn't work.
- The commenter found the cause themselves in 10 minutes: a buffer format mismatch with the render pass.
- Name the model, one commenter argues
- Mixing results from models like Opus 4 and 4o muddies the debate.
- Many people judge all of AI from weaker models, they say.
How to Apply
- Add TDD phases to the agent prompt
- Today, add RED, GREEN, REFACTOR rules to your coding agent's system prompt.
- On test failure, make it state the phase and justify whether the code or the test is wrong.
- Hand over small tasks
- Don't delegate a whole feature; request one change at a time.
- Attach existing reference code and review each chunk yourself.
- Require a summary before delete-and-restart
- Before the agent wipes code and starts over, make it write the gap between requirements and actual behavior.
- Forbid full deletion without that explanation.
- Own requirements and verification
- Fix the requirements doc yourself and pin it at the front of the context.
- Merge agent output only after running it and the tests.
Try It
# Paste into the system prompt of a coding agent like Claude Code or Cursor (prompt version of the article + comment ideas)
You work in TDD. Always declare the current phase first.
- RED: the test should fail. Do not touch the code.
- GREEN: write only the minimal code to make the failing test pass.
- REFACTOR: improve the code without breaking tests.
Rules:
1. Before writing code, summarize the requirements in one paragraph and write the tests first.
2. When a test fails, write the following before fixing anything:
- The behavior the requirements expect
- The behavior the code actually has
- The difference, and whether the code or the test is wrong, with reasons
3. No delete-and-restart. If truly needed, write the difference explanation first and ask my permission.
4. Make one small change at a time and show the run output.
Requirements: {{requirements}}
Existing code to reference: {{file path}}Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques