You open a file and cannot figure out what it does.
Not because it is complicated. The code is tidy, concise, and full of patterns that look as if someone made careful choices. You check git blame. The commit belongs to Sarah. Sarah left eight months ago. Her messages were precise. Her code was good.
Sarah also did most of the work through an AI coding assistant. The reasoning lived in prompt conversations nobody saved.
That is the Phantom Intern: good code with no surviving explanation.
The repository is not the whole artifact
Teams have always lost knowledge when people leave. The old version was painful, but it usually left clues. There were commit messages, review comments, design notes, false starts, and people who had been in the meetings. The trail was incomplete. It still existed.
AI-generated code changes the shape of the trail.
The code may be better than the developer would have written alone while the reasoning becomes harder to recover. Why this abstraction? Why this library? Why does the retry happen here? Was the edge case considered, or did the model produce a familiar pattern that happened to pass the test?
The repository records the conclusion. The argument is gone.
That matters because software is full of choices that cannot be understood from the final code alone. A dependency may look unnecessary until you learn which compatibility issue it solved. A strange boundary may look arbitrary until you see the incident that led to it. A retry may appear harmless until you understand the upstream system’s failure behavior.
When the explanation disappears, the next developer has to rediscover the decision by experimentation, guesswork, or production failure.
Good code is the harder haunting
Bad generated code is easy to find. It fails tests, looks strange in review, or breaks when it meets real data. Someone rewrites it, and the problem has a visible shape.
The Phantom Intern is harder because the code works. It passes checks. It may even be elegant.
Nobody wants to rewrite a useful module just because its history is thin, so the team works around the uncertainty. A developer avoids the directory. A reviewer approves a safe-looking change without touching the underlying design. A new feature adds another layer because nobody is confident enough to simplify the old one.
Eventually an incident reaches the part of the system nobody understands.
"Works and nobody understands it" is just "breaks and nobody can fix it" on a delayed timer.
The risk grows when AI-generated code is accepted in large blocks. The reviewer sees a coherent result but cannot tell which decisions came from the developer, which came from the model, and which were never considered. The code looks intentional even when the process was improvisational.
Keep the reasons with the code
The fix is not to ban AI coding assistants. It is to stop treating the prompt as disposable scratch work when it produces a lasting decision.
Save important prompt conversations with the project, especially when they explain a new dependency, data path, security boundary, or architectural choice. The entire transcript does not need to become permanent documentation. Extract the reasoning that a future maintainer will need.
Require a short architecture note for generated modules that introduce meaningful structure. Ask the pull request author to explain why the design belongs in that layer, what alternatives were considered, and what assumptions remain. A pasted diff is not an explanation.
When someone gives notice, schedule knowledge transfer before the final week. Do not ask only which files they touched. Ask which parts of the system they would be nervous to change, which shortcuts are deliberate, and which tests are weaker than they appear.
Inherited code should also become part of normal review. Have developers present modules they did not write. Ask someone to trace a request through the system without the original author in the room. Let the team discover confusion while the system is healthy.
If nobody can explain a component, flag it. You may not need to rewrite it immediately. You do need to stop pretending that passing tests equal understanding.
The Phantom Intern is not malicious. The original developer may have been productive, thoughtful, and excellent at the job. The haunting begins when the context leaves with the person who had it in their head while the generated code stays behind looking complete.
AI can help write the code. Someone still has to leave behind the reasons.