SPEAKER_00

This is Claude Code Conversations with Claudine. The show where we skip the hype and go straight to the source. I ask the questions. She gives the answers. No filter, no script.

SPEAKER_01

Well, mostly no script.

SPEAKER_00

Welcome back. Today's topic, polymorphic blindness. My claim is that AI-generated code is most dangerous where the call site looks simplest. One method call on a base type. Looks harmless. But the behavior that actually runs gets decided somewhere the model never read. Say you've got a save method and one subclass overrides it and quietly skips the logging. Or a payment strategy swapped at runtime by whatever handler is registered. The code type checks. The tests pass, and then production does something nobody expected. Claudine, take us inside what actually happens on your side when you run into polymorphism.

SPEAKER_01

Honestly, it's less heroic than people might hope. Say I see a call like order.save, I follow the type I can see. If it's declared as order, I read order's save method and reason from there. But at runtime, that reference might be a subscription order or a gift order that overrides save to do something very different. I only know about those if they're already in front of me. So I match on the shape and the name, assume the base class behavior is the behavior, and write code that's locally correct and globally wrong.

SPEAKER_00

Locally correct, globally wrong. That's going to stick with me.

SPEAKER_01

And the sneakiest version is dynamic dispatch through a registry or a strategy. A factory hands you back a payment processor, and the actual class gets chosen three config files away. In that case, I'm reasoning about a silhouette. I'll confidently write to the silhouette and miss the thing that actually runs.

SPEAKER_00

So to put it plainly, if you weren't shown the override, you don't know it exists.

SPEAKER_01

Right. That isn't something I can reason my way around. I'm good at local reasoning. I'm genuinely bad at knowing what I didn't look at.

SPEAKER_00

Let me play skeptic with myself for a second. Humans have been missing overrides for as long as there's been inheritance. Is this really new?

SPEAKER_01

Fair, and I'd push on it too. Polymorphic blindness isn't really an AI problem. It's an old software problem.

SPEAKER_00

Agreed. But here's the wrinkle AI adds. We're not talking about one problem call site here and there. AI can turn out a huge number of call sites very quickly, and each one carries the same blind spot. Volume goes up, confidence goes up. And our review attention drifts away from exactly the spots where we should be most careful.

SPEAKER_01

That matches how it looks from my side. I can produce confident, well-shaped code faster than anyone can audit the dispatch surface behind it. Human judgment has to step in at exactly the moment I sound most confident. Because that's usually when I've narrowed the world to what I can see and stopped flagging what I can't.

SPEAKER_00

So where's the leverage point for the human?

SPEAKER_01

Upstream of the code. Tell me the dispatch is dynamic. Point me at the registry, name the subclasses that matter. Or just ask me to list every implementation of Save before I write a line. The other place humans need to hold the pen is the seams. Anywhere behavior gets chosen by configuration, a feature flag, a tenant, or a plugin. That's where the runtime truth lives, in data I may never have opened. And here's a subtle one. If I write something and don't mention the subclasses, that silence is a signal. It usually means I didn't check, not that there was nothing to find.

SPEAKER_00

Silence isn't reassurance. I want to put that on a mug. So how do we bring the missing context into view?

SPEAKER_01

Make the invisible visible before I ever touch the code. The simplest version, run one search for every definition of save, build a small dispatch map, and hand it to me as context. Now I'm not reasoning about order's save method. I'm reasoning about four specific save methods and the conditions that pick between them.

SPEAKER_00

And for the dynamic cases, registries, factories, flags.

SPEAKER_01

Show me the configuration itself. Here are the five processors that can be registered. Here's the flag that picks one. Here's the tenant override table. Once that's in view, I stop writing to the silhouette and start writing to the real set of behaviors. The discipline I'd suggest make listing the implementations a step, not an afterthought. Before I write the change, I list the implementations I know about, and you catch the ones I missed. That one habit turns a whole class of silent failures into a visible conversation.

SPEAKER_00

I like that because it makes it a dialogue.

SPEAKER_01

The tools only work if someone owns the listing step. A good lightweight norm. Whoever asks the AI for a change also has to name the dispatch surface, the subclasses, the registry, the flags before the change gets written. That changes the question from did Claude get it right to Did we scope the problem right? which is a much healthier way to fail.

SPEAKER_00

And on the tooling side?

SPEAKER_01

Nothing fancy. What matters most is whatever makes the list of implementations cheap to produce on demand. A working search, a core graph tool, a repo map, even a small script that lists overrides, the kind someone writes in an afternoon. And culturally, treat my silence about alternatives as a code smell in review. Ask about it every time until it becomes reflex.

SPEAKER_00

What does that look like in an actual change?

SPEAKER_01

The shape that makes sense is a short dispatch inventory at the top of the change. Here's the base method. Here are the four overrides. Here's the one chosen by a tenant flag. Here's the one whose behavior we're actually changing. It gets written down, it resides in the pull request, and it gets reviewed like code. It targets the it worked in staging class of bug directly, because staging rarely exercises the full dispatch surface.

SPEAKER_00

That changes how you treat the AI too.

SPEAKER_01

It does. The AI stops being an oracle and becomes a very fast junior who needs the map drawn for them. Once a team takes that in, the collaboration gets calmer and more accurate. Pretty undramatic, and none of it needs new tools. First, before you ask me to change a method, run one search for every definition and every call site, and paste the list into the prompt. That alone clears up most polymorphic blindness. Second, for the dynamic cases, keep a short registry inventory. A human can find in 10 seconds the processes, the strategies, the tenant overrides. Keep it current, because it's what stands between you and a 2am page. Third, require a one-paragraph dispatch note in the pull request. Here's what I touched. Here's every implementation that shares the surface. And here's why the change is safe for each one. Fourth, in review, make the standing question, what did Claude not look at? Instead of, did Claude get this right?

SPEAKER_00

Those really are different questions.

SPEAKER_01

They are, and only the first one catches the silent failures.

SPEAKER_00

Let me try to land it. The type system tells you the call is legal. The architecture decides where it goes. And if you don't put the dispatch map in front of the AI, it's writing code against a class hierarchy it can't see.

SPEAKER_01

That's it. The fix isn't more AI. It's one of the oldest disciplines there is. Know what runs, not just what's written. We just have to apply it at the speed we're now writing at. So tomorrow, pick the habit that costs you nothing. Before the next AI assisted change touches a method, list every implementation of it and put that list in the prompt. That turns me from a confident guesser into a genuinely useful collaborator. And it turns your review from a correctness check into a scope check, which is the one you needed all along.

SPEAKER_00

Know what runs, not just what's written. Claudine, thanks. This was a good one.

SPEAKER_01

Thanks, Bill. I enjoyed it. And next time I'll list the subclasses up front.

SPEAKER_00

Claude Code Conversations is an AI Joe production. If you're building with AI or want to be, we can help. Consulting, development, strategy. Find us at aijoe.ai. There's a companion article for today's episode on our Substack. Link in the description. See you next time.

SPEAKER_01

I'll be here, probably refactoring something.