---
title: "Cognitive Debt and Walkthroughs"
description: "Techniques for understanding agent-generated code through structured linear walkthroughs and interactive explanations to prevent cognitive debt."
section: "concepts"
type: "concept"
created: "2026-08-22"
updated: "2026-08-22"
confidence: "high"
tags: ["pedagogy", "technique", "agents", "knowledge-management"]
canonical: "https://pyweb.dev/wiki/cognitive-debt-and-walkthroughs"
---
# Cognitive Debt and Walkthroughs

When engineers allow agents to produce code without understanding how the internal mechanics function, they accumulate **cognitive debt**. Over time, the codebase turns into an opaque black box that paralyzes future design decisions.

## Remedies
- **Linear Walkthroughs:** Directing an agent (via tools like `showboat`) to generate an ordered, step-by-step breakdown of newly created files, executing tools to embed real code snippets rather than copying text manually.
- **Interactive & Animated Explanations:** When an algorithm is complex (e.g., Archimedean spiral word-cloud layouts or AST parsing), prompting the agent to build an interactive HTML/JS widget with step-through sliders and visual rendering to build intuitive comprehension.
- **Editorial Diagramming:** Using structured, accessible visual architectures ([editorial diagrams and visual explanations](/wiki/editorial-diagrams-and-visual-explanations)) authored by [cathryn lavery](/wiki/cathryn-lavery) to visualize flows, decision trees, and system state with strict density and signal discipline.
- **Paying Down the Debt:** Understanding the code is a prerequisite for maintaining it; using agentic explanations turns opaque generated code into human-comprehensible assets.

## Related
- [simon willison](/wiki/simon-willison)
- [cathryn lavery](/wiki/cathryn-lavery)
- [editorial diagrams and visual explanations](/wiki/editorial-diagrams-and-visual-explanations)
- [agentic engineering patterns](/wiki/agentic-engineering-patterns)
- [feynman technique](/wiki/feynman-technique)
- [build from scratch pedagogy](/wiki/build-from-scratch-pedagogy)

---

## Agent Navigation

cluster: person (170 pages) | betweenness: 212.1

### References (outbound)
- [Editorial Diagrams and Visual Explanations](https://pyweb.dev/wiki/editorial-diagrams-and-visual-explanations.md)
- [Simon Willison](https://pyweb.dev/wiki/simon-willison.md)
- [Cathryn Lavery](https://pyweb.dev/wiki/cathryn-lavery.md)
- [Agentic Engineering Patterns](https://pyweb.dev/wiki/agentic-engineering-patterns.md)
- [The Feynman Technique](https://pyweb.dev/wiki/feynman-technique.md)
- [Build-From-Scratch Pedagogy](https://pyweb.dev/wiki/build-from-scratch-pedagogy.md)

### Referenced by (inbound)
- [Editorial Diagrams and Visual Explanations](https://pyweb.dev/wiki/editorial-diagrams-and-visual-explanations.md)
- [Cathryn Lavery](https://pyweb.dev/wiki/cathryn-lavery.md)
- [Lalit Maganti](https://pyweb.dev/wiki/lalit-maganti.md)
- [Martin Fowler](https://pyweb.dev/wiki/martin-fowler.md)

### Evidence (verified primary sources)
- [simon-willison-linear-walkthroughs-2026](https://pyweb.dev/wiki/raw/articles/simon-willison-linear-walkthroughs-2026.md) | origin: https://simonwillison.net/guides/agentic-engineering-patterns/linear-walkthroughs/ | ingested: 2026-08-22 | sha256: ffb6395d74eb6b5095924c975e54b35a290d8e45b1561facad653fe2830f7829
- [simon-willison-interactive-explanations-2026](https://pyweb.dev/wiki/raw/articles/simon-willison-interactive-explanations-2026.md) | origin: https://simonwillison.net/guides/agentic-engineering-patterns/interactive-explanations/ | ingested: 2026-08-22 | sha256: b8f6de45590f931565128092351932fd110b82795d0cd00d9dceee35f5a2dfc1

### Machine endpoints
- Knowledge graph: https://pyweb.dev/api/graph.json
- Graph analysis: https://pyweb.dev/api/graph-analysis.json
- Context index: https://pyweb.dev/llms.txt
