Menu

Post image 1
Post image 2
1 / 2
0

CLAUDE.md for Remix: 13 Rules That Stop AI from Breaking the Loader/Action Pattern

DEV Community: remix·Olivia Craft·3 days ago
#yNMOBPC3
Reading 0:00
15s threshold

If you've used Claude Code or Cursor on a Remix project, you've probably seen it drift toward patterns that belong in other React frameworks — Express-style middleware, React Query for everything, client-side fetching where loaders should live. Remix has a specific mental model: loaders and actions own the data layer, the file system is the router, and progressive enhancement is a first-class feature. AI tools that don't know this produce code that works in isolation but fights the framework constantly. A CLAUDE.md file at the repo root is the fix. It gives every AI session the Remix mental model upfront, before any code is generated. Here are 13 rules that cover the most common failure modes. Rule 1: Loaders own all server-side data fetching All data fetching for a route lives in its loader function. Never fetch data in components using useEffect or client-side libraries when a loader can serve it. Loader data is typed via LoaderFunctionArgs and useLoaderData.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More