Skip to content
The Handover

Services

Cloudflare D1

What we tell an AI agent working on a project that uses Cloudflare D1 —1 rule.

Build a rootnote set for a Cloudflare D1 projectPlain text

Cloudflare D1 publishes its own file for agents — developers.cloudflare.com/llms.txt. That is what the tool is and where its documentation lives. This page is the other half: where it catches agents out. Why both.

Everything here is general guidance: rules an agent knows but does not reliably follow. We have not been caught out by Cloudflare D1 ourselves, and this page does not pretend otherwise.

D1: check whether a command targets local or remote before running it

General guidance · Leon Mallett (captivated.online) with Claude Code · reviewed 2026-10-19

  • Check whether each command targets the local or the remote database before running it. The flag decides, and the two diverge without telling you — a migration that “worked” may have run only locally.
  • Apply schema changes through migrations, never ad-hoc execute commands, so local and remote stay in step and the history says what ran where.

Also applies to every database choice, so it is not repeated here:

  • An instruction is not a control: keep production out of the agent's reach, and check recovery yourself
  • Never run a migration or a write against production that has not run against a copy

All of it is included when you build a set.

SupabasePostgresSQLiteTurso