IN THE AGE OF AI
English · 한국어
AI writes the code. People write the guarantees.
We learned to write code for people. Now we write it for AI.
On an older car, you opened the hood and saw the parts. You could see a worn belt or an oil leak, and you fixed it with a wrench.
Open the hood of a modern car and you see a plastic cover. You can't tell what's wrong by looking. But plug a scan tool into the diagnostic port under the dashboard, and the fault comes up as a code, such as "P0303: cylinder 3 misfire." Nobody built the car carelessly. Mechanics now plug in the scan tool before they look, so cars are built for the scan tool to read.
The same thing is happening to code. Of the code merged into your repository today, how many lines did you read one by one? When you tell an AI "fix this bug," the one who finds the related code and reads it first is the AI, not you. This book starts there. When you hand a task to an AI, the AI reads your code before you do.
Dirty Code is about writing code that this reader, the AI, can read and change well. It is also about what people should do instead, once they stop reading code line by line.
Mechanics call the fault codes on a scan tool DTCs: Diagnostic Trouble Codes.
In this book, DTC stands for Dirty Code.
- What does code look like when AI can read it and change it well?
Names, where code lives, duplication, comments, error messages, folder structure, and prompts. (Part II) - If people no longer read the code, how do they guarantee quality?
They split the work, decide what must never break, and design how to check it. (Part III) - Is it true, and how far does it go?
We build the same feature in two shapes, ask AI to change both, and compare the numbers. We also cover the moments when people still have to read the code. (Part IV)
This book does not cover how to use AI tools, model rankings, or the future of jobs.
Chapters are posted here as drafts while the book is being written. A linked title is a draft you can read now. Most experiments were run on 2026-11-22 and 23, with Claude Code and with Codex CLI, OpenAI's coding agent, and each of Chapters 1 to 18 gives its counts in its Evidence section. Where part of an experiment hasn't been run, such as Chapter 1's count of a person's reads, the chapter says so.
Preface. To Clean Code: we learned to write code for people · draft
Part I. The reader of your code has changed
- "My way used to be faster": the day developers stopped reading code · draft
- AI doesn't remember the code it read yesterday · draft
- What carries over from Clean Code, and what changes · draft
Part II. Code for the scan tool
- AI guesses what a function does from its name · draft
- Keep what changes together on one screen · draft
- When a copy is safer than a shared function · draft
- Comments say why: AI tidies up numbers it can't explain · draft
- Every hop through a function is a chance for AI to get lost · draft
- Install a diagnostic port: errors and logs for AI to read · draft
- The map AI navigates by: folder names and an index file · draft
- Prompts are code that AI reads · draft
Part III. People install the warning lights
- Where to cut: hand off work in pieces you can check · draft
- People decide what must never break when things run at once · draft
- How to check code without reading a line of it · draft
- How to have AI inspect the code AI wrote · draft
Part IV. Is it true, and how far does it go?
- The experiment: one feature, two engine bays · draft
- When the GPS is wrong: the moments people must read code · draft
- Can we skip the code and have AI write machine code directly? · draft
Closing. AI writes the code. People write the guarantees. · draft
- Scene: a situation everyone has been in
- Claim: one sentence
- Why: derived from "AI has no memory, so it reads your code for the first time, every time"
- Code: a concrete example, usually the version for people next to the version for AI
- Prompt: what AI opened and changed when given the same task
- Evidence: an experiment or a case from real work
- What people do: something you can do tomorrow
- Where it breaks: the cases where the claim does not hold
- We build the same feature in two shapes. The behavior and the tests are identical. Only the shape of the code differs.
- We send the same request to a fresh session at least ten times.
- Success is judged by tests the AI never sees.
- Every result is recorded with its date and model name, because the numbers change when the model changes.
The experiment plan is in experiments/ (in Korean for now).
Robert C. Martin's Clean Code set the standard for code that people read. Today's AI learned to code from code that people wrote, so for now clean code is easy for AI to read too. But as code gets arranged for what is most effective and efficient for an AI reader, it will look less and less like clean code. This book calls that code dirty code. Where its advice differs from Clean Code's, the book says so. Some things, like names and tests, matter even more.
- November 2026: the outline and experiment plan are set, and writing has begun. The English draft of the whole book is posted: the preface, 18 chapters, and the closing. A Korean draft of every chapter is posted too, linked from the Korean front page.
- November 22, 2026: part of the experiments were run with Claude Code (E3 to E7, E9, E10, E12, and E14 to E16, some in a smaller form than designed). Each chapter says what was run, with which models, and how it differed from the design.
- November 22 and 23, 2026: the rest were run with Codex CLI and the model gpt-6.2-sol: the ten sessions of E1, E2, E8, E11, E13, the parts of E3, E5, E12, and E15 that were left over, and the 400 sessions of the combined experiment in Chapter 16. Next are the combined experiment on a second model, with Claude Code, and Chapter 1's count of a person's reads.
- The manuscript was written in English first. The Korean draft is rewritten for Korean readers from the English one.
New chapters will appear in this repository. Turn on Watch to hear about them. A Star tells the author how many readers are waiting.
Wooyong Lee spent more than five years catching fraud and money laundering at Korean crypto exchanges, including Bithumb and Digital X. No one can read every transaction an exchange handles in a day, so he wrote rules that read them and flagged what looked wrong. Today he builds AI agents in Seoul, and AI writes much of the code he works with. Dirty Code takes the same approach to code.
© 2026 Wooyong Lee. All rights reserved. Please credit the source when quoting.
