claudecodeguide.dev

How to Prompt Claude Code (It's Not What You Think)

The biggest mistake? Treating Claude Code like ChatGPT. Good prompts are specific, bounded, and lean on CLAUDE.md — not clever wording.

Forget Everything You Know About Prompting

If you've been crafting elaborate ChatGPT prompts with "act as a senior engineer" and "think step by step" — stop. Claude Code doesn't work that way.

Here's the thing most people miss: with Claude Code, your CLAUDE.md file does 80% of the prompting work. The actual prompt you type? It just needs to be specific about what you want done right now. No persona. No chain-of-thought instructions. Just the task.

ChatGPT brain vs Claude Code brain

The Three Rules of Good Prompts

Rule 1: Be specific about the outcome.

Not "improve the dashboard" but "add a bar chart showing monthly revenue to the analytics dashboard using recharts." Claude Code needs a concrete target, not a vague direction.

Rule 2: Reference existing code.

"Make the settings page work like the profile page" is worth more than a paragraph explaining your preferred layout. Claude Code can read your codebase — use that.

Rule 3: Set boundaries.

"Add error handling to the checkout flow. Don't change the payment provider integration." Telling Claude Code what NOT to touch is often more valuable than explaining what to do.

The "Spec Dump" Mistake

I see this constantly. Someone pastes an entire PRD — 2,000 words of requirements, acceptance criteria, edge cases — into a single prompt.

What happens? Claude Code tries to do everything at once. It misses details. It makes contradictory choices. It burns through your context window.

Instead: break it down.

Spec dump vs iterative prompting

Prompt Patterns That Work

The fix prompt: "The checkout page returns 500 when the cart is empty. Fix it." Clear problem, testable outcome.

The add prompt: "Add pagination to the /api/posts endpoint. 20 items per page, cursor-based." Specific feature with concrete parameters.

The refactor prompt: "Extract the validation logic from UserForm into a shared useValidation hook. Keep the same tests passing." Clear scope with a safety constraint.

The investigate prompt: "Why does the search take 3 seconds on pages with 100+ results? Don't fix it yet, just explain." Separating investigation from action prevents premature changes.

What Makes a Bad Prompt

Too vague: "Make it better." Better how? Faster? Prettier? More accessible?

Too broad: "Build the entire user management system." Break it into pieces.

Too prescriptive: "Create a file called utils/auth.ts, export a function called validateToken that takes a string parameter named token and returns..." You're writing the code at that point. Just tell Claude Code what you need, not how to type it.

Redundant with CLAUDE.md: "Use TypeScript, follow our ESLint rules, use Tailwind for styling." If it's in your CLAUDE.md, you don't need to repeat it. That's the whole point.

The Prompt Quality Checklist

Before you hit Enter, quick gut check:

  • Does it describe what you want, not how to do it?
  • Is it scoped to one logical task?
  • Does it reference existing code or patterns when relevant?
  • Are the boundaries clear (what to change, what not to change)?
  • Is it something CLAUDE.md doesn't already cover?

If yes to all five, you've got a good prompt. Ship it.

Stay in the loop

New guides, templates, and tips. No spam. Unsubscribe anytime.

On this page