AI performs dramatically better in systems with explicit boundaries and low cognitive load.

One thing I started noticing while building software with AI coding agents is that the quality of generated code depends not only on the model itself, but heavily on the structure of the codebase.

Tweaking prompts alone is not a silver bullet either. Sharper instructions can help at the margins, but when ownership, dependencies, and side effects are implicit, the model still has to guess—and no prompt fully substitutes for an architecture it can navigate.

The same AI model can feel surprisingly smart in one project and almost unusable in another.

Why?

Because AI struggles less with complexity itself and more with unclear architecture.

When you're building software with AI, especially in a fast iterative or “vibe-coding” workflow, a huge amount of code gets generated very quickly. At some point, it becomes impossible to manually inspect and polish every single file without losing most of the speed advantage AI gives you.

But there is still a problem:

  • you must keep ownership of the system
  • you must be able to debug it
  • you must understand what happens when something breaks in production

And this becomes extremely difficult in systems with weak boundaries and low readability.

In practice, AI starts struggling in codebases with:

  • giant files
  • hidden dependencies
  • mixed responsibilities
  • unclear module ownership
  • implicit side effects

Humans can eventually learn these patterns over time.

AI repeatedly loses context. In practice it also works from partial views of the repository—so the bar for readability becomes local clarity: can you change one area safely without needing the whole system in memory at once?

One of the most interesting things is that unreadable architecture now hurts twice:

  • humans struggle to maintain it
  • AI produces worse results inside it

This creates a feedback loop where architectural chaos generates even more chaos.

I think this is why architecture is becoming less about “clean code aesthetics” and more about communication design.

Not only communication between developers.

But communication between humans and AI systems as well.

And this may become one of the most important software engineering shifts of the AI era.