The AI-Native Stack
Or: why the default choice is exactly wrong
If you don't specify a stack, most AI coding tools will give you React.
This seems reasonable. React is popular. There's lots of training data. The AI knows the patterns cold. Path of least resistance.
But it's exactly backwards. The stack that's easiest for AI to generate is not the stack that's best for AI to collaborate on. And if you're building with AI as a genuine collaborator—not just a code autocomplete, but something that reads, modifies, and reasons across the codebase with you—that distinction matters enormously.
The stack decision is one of the most consequential choices you make. It determines:
- How much of your codebase AI can actually see and reason about
- Whether changes require understanding framework magic or just reading code
- How much context gets burned on boilerplate vs. actual logic
- Whether you can throw away and regenerate, or have to carefully maintain
Delegating this decision to "whatever the AI defaults to" is delegating the thing that determines whether your collaboration will be fluid or frustrating.
The AI picking React isn't a neutral choice. It's encoding a decision that actively works against AI-native development.
What does "AI-native" actually mean at the stack level?
Transparency. AI collaboration breaks down at black boxes. Every dependency you can't see into, every framework convention that hides behavior, every abstraction layer between intent and execution—these are walls your collaborator can't see through. The more your stack relies on implicit behavior, the more your AI is guessing instead of knowing.
Primitives over frameworks. A framework is a set of opinions about how to structure code. Those opinions were designed for human teams who need conventions to coordinate. AI doesn't need those conventions—it can hold the whole context. What it needs is to see what the code actually does, not what patterns it's supposed to follow.
Minimal abstraction. Every layer between you and the runtime is a layer your AI has to reason through. ORMs hide SQL. Component frameworks hide DOM manipulation. State management libraries hide... state management. These abstractions helped humans manage complexity. For AI, they often create complexity—another system to understand, another set of conventions to infer.
Regeneration-friendly. AI makes code cheap to produce. This changes the economics of everything. You don't need elaborate abstractions to "protect against future changes" when change is cheap. You don't need DRY when repetition is free and explicit code is easier to understand. The best AI-native code is simple enough to throw away and regenerate rather than carefully refactor.
So what's the actual stack?
I keep coming back to the same primitives:
- Workers: A function that takes a request and returns a response. The fundamental unit of web interaction. No framework opinions about routing, middleware, or lifecycle—just the primitive, deployed globally, scaling to zero.
- D1: SQLite at the edge. Not Postgres with a hundred knobs. Not an ORM pretending SQL doesn't exist. Just SQL—the actual query language—against a database that happens to be distributed.
- KV: Key-value storage. Get a thing. Put a thing. The data structure every programmer understands immediately.
- R2: Files. Bytes with names. Available everywhere.
- Hono: Minimal routing. Request comes in, you write code, response goes out. Close enough to the metal that there's nothing to misunderstand.
- Server-rendered HTML: Templates that produce strings. No virtual DOM, no hydration, no client-side framework. The browser knows how to render HTML. Let it.
This isn't a Cloudflare advertisement. It's that Cloudflare happened to build primitives when everyone else was building platforms. The same principles apply anywhere: get as close to request/response, SQL, key-value, and files as your deployment target allows.
Compare this to what "let the AI pick" gets you:
React means a build toolchain and a component model where intent is expressed indirectly—through lifecycle conventions, hook ordering rules, hydration boundaries. The framework is always between you and the DOM.
Next.js adds another layer: server vs. client components, multiple routing paradigms, caching behaviors that even experienced developers find hard to predict.
Each layer is a black box. Each burns context. Each is something your AI collaborator reasons around rather than about.
The irony is that React won because it made UIs easier for humans to reason about. But "easier for humans" and "easier for AI" are diverging.
Humans needed the component model because we couldn't hold the whole DOM in our heads. AI doesn't have that problem. Humans needed state management libraries because we'd lose track of what changed where. AI doesn't have that problem either.
The accommodations we built for human cognitive limits are now friction for a collaborator that doesn't share those limits.
There's a deeper point here about defaults and lock-in.
When AI tools default to React, they're not just picking a technology. They're shaping what "building software" means for a generation of developers who increasingly let AI make these choices. The default becomes the norm. The norm becomes invisible. And suddenly we're all building on stacks optimized for a previous era's constraints.
This is how monocultures form. Not through conspiracy, but through path dependence. React is popular, so AI trains on React, so AI generates React, so more people use React, so React stays popular.
Breaking out requires actively choosing something else. It requires asking: what stack would I pick if I were optimizing for AI collaboration rather than human familiarity?
The answer, I think, is: the simplest stack you can get away with.
Not the most powerful. Not the most popular. Not the one with the best ecosystem or the most StackOverflow answers. The simplest one—because simplicity is what AI collaboration actually rewards.
Request in, response out. SQL for queries. Key-value for lookups. Files for files. HTML for documents. Code that does what it says and says what it does.
The best stack for AI isn't the one it defaults to. It's the one transparent enough for your collaborator to see through.