cd /news/artificial-intelligence/how-i-build-production-ai-apps-on-cl… · home topics artificial-intelligence article
[ARTICLE · art-30317] src=dev.to ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

How I Build Production AI Apps on Cloudflare with Claude Code

A developer outlines principles for building production AI applications on Cloudflare using Claude Code, emphasizing simplicity, treating AI models as engineering teams, and leveraging Cloudflare's edge stack including Workers, Durable Objects, D1, and KV. The approach focuses on earning complexity over time, enforcing fundamentals like idempotency and observability, and maintaining intentional coding practices rather than relying on 'vibe coding'.

read2 min views2 publishedJun 17, 2026

AI makes it trivial to generate a working demo. Making something that survives real traffic is a different skill. Here's how I approach it — the principles from a talk I gave recently, with the full video at the end.

Start simple — and earn the complexity

Gall's Law: a complex system that works invariably evolved from a simple system that worked. AI tools make it tempting to scaffold a sprawling architecture on day one. Resist it. Ship the simplest thing that solves the problem, then let real constraints pull you toward complexity — not the other way around.

Treat the model like an engineering team you manage

Working well with Claude Code is less about clever prompts and more about setup. The pieces that actually move the needle:

CLAUDE.md — standing context and conventions for the project

Skills (SKILL.md) — reusable folders of know-how, not one-off prompts MCP servers — give the model real tools and data instead of guesses

Subagents and plan mode — break work down, and review the plan before any code gets written

You're the CTO of a small team. Prompt engineering isn't planning.

Build at the edge

My default stack, and the reasoning behind each piece:

Workers — stateless compute and routing, running close to the user

Durable Objects — one per stateful entity (a chat room, a document), each with its own SQLite for strongly-consistent state

D1 — relational, cross-entity queries: the things a single Durable

Object shouldn't own

KV — read-heavy config and cache

The distinction that matters: a Durable Object owns one entity's state; D1 owns the relationships across entities. Get that boundary right and most of the architecture falls into place.

Don't skip the fundamentals

AI will happily write code that works in the demo and falls over in production. The details you have to enforce yourself:

Idempotency on anything that mutates

Kill N+1 queries; index what you actually query

Observability from day one — at the edge, slow is expensive

Semantic HTML and accessibility on the front end

The throughline

Stay aware of everything you build. "Vibe coding" skips the awareness; intentional coding keeps it. AI is leverage on top of judgment — not a replacement for it.

Full talk (~59 minutes, chapters in the description):

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @cloudflare 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-i-build-producti…] indexed:0 read:2min 2026-06-17 ·