If you retype code an AI wrote, are you actually learning anything – or just becoming a slow photocopier? That’s the question echoing across Hacker News and Lobsters right now, sparked by Ankur Sethi’s post arguing you should prevent cognitive debt by manually retyping LLM-generated code instead of copy-pasting it. It’s a small idea that compounds fast, and the community reaction has been split down the middle.
Here’s the short version of the answer, then the walkthrough.
The takeaway upfront
Retyping works – but not because typing is magic. It works because it forces you to slow down to reading speed, which forces comprehension. If you’re a beginner or working outside your comfort zone, retype. If you’re gluing together boilerplate you already understand, don’t bother – there’s a better protocol below (the Explanation Gate) with real numbers behind it.
Why cognitive debt is suddenly everyone’s problem
The phrase went mainstream after the MIT Media Lab’s June 2025 paper Your Brain on ChatGPT. Researchers tracked 54 participants across four months, split into ChatGPT, search-engine, and brain-only groups; when they switched groups in session four, the LLM-dependent participants showed reduced alpha and beta connectivity, and LLM users reported the lowest sense of ownership over their work and struggled to accurately quote what they’d written.
Worth flagging: only 18 participants completed the crucial final session that supports the strongest claims, and drawing sweeping conclusions from such a small sample risks overstating the findings. The vibe is real, the effect size is debatable.
Meanwhile the numbers on code quality tell their own story. GitClear analyzed 153 million lines of code and – as of their 2024 projection (compared to the pre-AI 2021 baseline) – found that code churn, lines reverted or updated within two weeks, was on track to double. Something’s clearly slipping.
Method A: Manual Retyping (the trending post)
Sethi’s approach is simple. Ask an LLM for code. Read it. Then type it into your editor character by character – no copy-paste, no accepting the completion. He says it feels like working through a textbook, that it might not be the most efficient way to work with an LLM, but he values comprehension over productivity and has been doing it for a few months.
The community pushback is sharp, though. One HN commenter argued retyping is inefficient for learning – like trying to retype calculus solutions where you didn’t come up with the approach and don’t know alternative solutions; you just move your fingers. On Lobsters, a developer raised something more practical: as of mid-2026, Zed’s Zeta2 autocompletes a few lines of predictable boilerplate so fast that you can type code nearly as quickly anyway – so if you’re going to type it, you might as well write it yourself from scratch.
Method B: The Explanation Gate (better data)
This one doesn’t have the viral post, but it has the study. Sreecharan Sankaranarayanan’s February 2026 research (arXiv:2602.20206) ran 78 participants through three conditions: manual coding, unrestricted AI, and AI with an Explanation Gate – a scaffolding intervention requiring participants to explain AI-generated code before integrating it. Both AI groups finished faster initially. Then researchers imposed a 30-minute AI-blackout maintenance task. The unrestricted AI group had a 77% failure rate. The Explanation Gate group had a 39% failure rate. The manual group performed steadily throughout.
That’s a 38-point drop from a single behavioral tweak. It also lines up with an Anthropic study cited by LeadDev (as of 2025): participants who scored well used AI to generate code and then asked follow-up questions or requested explanations of the logic – the cognitive relationship to the tool, not the tool itself, was what separated them.
Head-to-head
| Dimension | Manual Retyping | Explanation Gate |
|---|---|---|
| Evidence base | Anecdotal, blog + HN discussion | 78-participant controlled study (2026) |
| Time overhead | High – you retype every line | Medium – you write a short explanation once |
| Best for | Unfamiliar syntax, new frameworks | Familiar language, complex logic |
| Failure mode | Becomes mindless copying | Explanations become rubber-stamps |
| Works with autocomplete IDE? | No – defeats the point | Yes |
The walkthrough: a hybrid that actually works
Retyping alone is fragile. Explaining alone can devolve into hand-waving. Here’s a merged protocol that keeps the good parts of both – use it the next time you ask Claude or ChatGPT for a function.
Step 1 – Ask, but demand structure
Prompt the LLM for the code and a numbered explanation of each non-obvious line. Something like:
Write a Python function that debounces API calls with a 300ms delay.
After the code, list every line that isn't self-explanatory
and explain in one sentence why it's there.
The explanation isn’t for reading – it’s for checking your own explanation against later.
Step 2 – Close the LLM tab
Seriously, close it. Open a blank file in your editor.
Step 3 – Retype from memory, not from the screen
Try to reproduce the code without looking. You’ll fail. That’s the point – the gaps are exactly where you didn’t understand. This is the retyping method’s real mechanism: it’s a recall test disguised as a productivity ritual. The extra time spent (think minutes, not seconds, versus a copy-paste) is when your working memory actually encodes the pattern.
Step 4 – Open the LLM output, diff it against yours
Where you diverged, write a comment above that line explaining why the LLM’s version is what it is. In your own words. If you can’t, that’s your homework – go read the docs for that specific API before moving on.
Pro tip: Keep a text file called
debt.mdin every project. When you can’t explain a line, paste the snippet and the LLM’s explanation into that file. Once a week, re-read it without the explanations and see how much you can still reconstruct. That’s your actual learning signal – not your commit count.
Step 5 – Commit with intent in the message
Write the commit message before running the tests. Force yourself to articulate what the change does and why. If you can’t summarize it in one sentence, you don’t own the code yet.
Edge cases nobody’s talking about
Retyping unfamiliar syntax is worthless. If you’re a Python dev handed a Rust snippet with lifetimes and traits, retyping the borrow checker’s incantations character-by-character teaches you nothing. Your fingers move, your brain doesn’t. In this scenario, skip retyping and instead force yourself to write a plain-English translation of every block. That’s real comprehension work.
Modern IDE completions blur the whole exercise. If your editor autocompletes half your “retyped” line before you finish it, you’re back where you started. Turn off aggressive completions during learning sessions. Yes, it’s slower. That’s the entire mechanism.
Agentic tools break the retyping model entirely. When an agent modifies three files and updates the tests in one turn, there is nothing to retype without spending an hour reverting and redoing. For agentic workflows, retyping is dead – Explanation Gate is your only option. Ask the agent to output a change-log of decisions before applying anything, and gate merge on your ability to summarize each decision.
Teams can’t standardize on retyping. It’s an individual practice, not a workflow. Don’t try to mandate it in a PR template – it’ll be ignored or faked. Instead, mandate an “explain this diff” box that reviewers must fill in before approval.
FAQ
Is retyping really different from copy-pasting if I read the code first?
Yes. Reading skims; retyping forces line-by-line reckoning – and the minutes that takes are when working memory actually encodes the pattern. One is passive, the other is a recall test.
Do I have to do this for every line of AI code forever?
No – and that’s where the trending post gets misread. Retype code in domains you’re actively learning: a new framework, an unfamiliar language, an algorithm you’d struggle to reconstruct. For boring plumbing you’ve written a hundred times – CRUD endpoints, standard config files, formatting boilerplate – copy-paste is fine. The goal isn’t purity; it’s protecting the specific muscles you still want to have in two years. Cognitive debt is only debt if you’d wanted to be able to think about that thing later.
What if my employer expects LLM-speed output?
This is where the two methods split cleanly by context. At work: use Explanation Gate – write a two-sentence summary of what each AI-generated block does before you commit it. Fast enough that no one notices, rigorous enough that you’re not flying blind. Save retyping for side projects and things you’re actively trying to own long-term. The canary in the coal mine: if you can’t explain your own PR during review without re-opening the chat log, the debt is already there. Track how often that happens. If it’s more than once a week, the Explanation Gate isn’t optional anymore – it’s triage.
Your next move: pick one file you shipped last week that came mostly from an LLM. Open it, close everything else, and try to explain each function out loud to your rubber duck. Where you stumble, that’s the debt. Pay it down now while the code’s still fresh – before the reckoning arrives quietly, as Addy Osmani puts it, at the worst possible moment.