Prevent Cognitive Debt: Retype LLM Code Manually

Original: Prevent cognitive debt by manually retyping LLM-generated code

Why This Matters

Highlights a developer-driven countertrend to fully autonomous AI coding workflows amid rising concerns over code comprehension and quality.

Developer Ankur Sethi shares a workflow to combat cognitive debt from AI coding assistants: instead of letting LLMs write files directly, he prompts them to display code in chat, then manually types every line himself, trading 10x speed gains for 2x gains but retaining full code comprehension.

Ankur Sethi, a self-described experienced developer, writes in his personal blog that despite the productivity appeal of LLM coding assistants, allowing them to autonomously edit project files creates significant cognitive debt — a loss of understanding of one's own codebase.

His solution: configure agent instruction files across his personal projects to prohibit the LLM from creating, editing, moving, or deleting files. Instead, the assistant outputs all proposed code and commands into the chat window, and Sethi types every line manually.

The tradeoff is explicit. He estimates he works roughly 2x faster than without LLMs, compared to the potential 10x speedup available to developers who allow full autonomous edits. In exchange, he gains a deeper mental model of the code, better hallucination detection, and a spatial awareness of where functionality lives in the codebase.

Sethi draws a parallel to advice he received as a teenager learning to code: never copy-paste — always type examples by hand. He notes that manual entry forces him to slow down, spot design flaws, and refactor or comment code to suit his own style. He explicitly states this approach is for personal projects only, where process and enjoyment matter more than raw output speed.

Source

ankursethi.com — Read original →