
Claude Code for Next.js: what works and what to watch out for
Next.js has moved fast across versions — Pages Router to App Router, client components to server components, different data fetching patterns. Claude's training data includes all of them, which means it defaults to whichever pattern it saw most, not necessarily the one you are using. Tell Claude which version and which router Before any Next.js task: 'This project uses Next.js 15 with the App Router. Use server components by default unless client state is required.' Without this, Claude might write Pages Router patterns in an App Router project, or add use client to components that do not need it. Also tell it your data fetching approach. 'We use React Query for client-side fetching and async server components for server-side fetching.' Claude will follow this if you state it explicitly. The 'use client' problem Claude tends to add 'use client' more than necessary. It is a safe default from its perspective — client components always work, server components sometimes fail if you acciden
Continue reading on Dev.to React
Opens in a new tab




