- Published on
Staying Sharp When AI Writes Most of Your Code
- Authors

- Name
- DeepHorus
A new concept called "cognitive debt" is emerging as engineers increasingly rely on artificial intelligence to write code. The term, popularized by a 2025 MIT Media Lab preprint titled "Your Brain on ChatGPT," describes the creeping loss of comprehension that occurs when developers accept AI suggestions without fully understanding them. While technical debt costs time in future fixes, cognitive debt erodes the very engineering judgment needed to recognize problems. The preprintās EEG study found that writers using ChatGPT showed the weakest brain connectivity among three groups, with many unable to quote from their own essays, though the study has faced methodological criticisms.
Engineer and content creator Hadi, who shared two contrasting debugging stories on his YouTube channel, illustrates cognitive debt in practice. In the first story, AI saved him from himself: Claude Code identified a mismatched Sentry auth token by decoding Base64 JSON, then spotted a false upload success by flagging an improbably fast transfer over a slow ADSL line. The AI reasoned through chunked upload failures, suggested configuration changes, and produced a clean Markdown handover for the DevOps team. Hadi estimates the AI made him roughly twice as fast that afternoon, though his typical productivity boost is more modest at 1.2 to 1.5 times.
The second story, from the same month on the same codebase, shows the opposite outcome. When Hadi relied on the AI without critical oversight, it misinterpreted error logs and led him down a painful two-hour debugging rabbit hole. The root cause turned out to be a simple version mismatch that the AI failed to recognize because it lacked context about the deployment pipeline. This stark contrast highlights that cognitive debt accrues not from using AI, but from using it passively.
The MIT preprint, while not definitive, sparked important conversations about how AI affects learning. Critics note the small sample size and controlled writing tasks, yet the term cognitive debt resonated broadly because it names a familiar anxiety. Engineers worry that rapid code generation may stunt their ability to architect systems from scratch. The debt shows up when on-call engineers cannot reason about code they supposedly built, or when they lose the skill to write code they only review.
Hadi emphasizes that the solution is not abandoning AI, but adopting deliberate habits. These include questioning AI outputs, manually replicating logic, and maintaining spaced practice on unassisted coding. He suggests treating AI assistance like training wheelsāuseful for speed, but dangerous if never removed. Teams should pair AI tools with code review practices that require engineers to explain why a suggestion works, not just that it passes tests.
Looking ahead, cognitive debt will likely become a key metric in software engineering education and performance reviews. Just as teams measure technical debt in their backlogs, they may begin tracking engineersā self-reported comprehension across AI-assisted tasks. The goal is to preserve the human ability to judge code quality, security, and architectureāskills that accelerate as AI handles increasingly routine work. In a future where machines write most code, protecting human judgment may be the engineerās most valuable investment.