Skip to content
Day 61: new resources are added every day. See what's new

Free guide

How to Prompt Claude Code

The prompt patterns that get clean, correct changes from Claude Code, with examples for every kind of task

Short answer

A free guide to prompting Claude Code in 2026: the anatomy of a good coding prompt, context with files and CLAUDE.md, plan first, constraints, definition of done, prompts for features, bug fixes, refactors, tests, reviews, and explanations, follow-up and correction prompts, effort levels, and common mistakes. For general tips, see our 20 Claude Code Tips guide.

Updated

Built with love by Shushant Lakhyani. Building bestproductivityresources.com

The guide

Every section is a compact, self-contained card. Tap the link icon to share one section.

01

Why prompting matters

Claude Code can read your project, edit files, and run commands. A clear prompt tells it what to change, what not to touch, and how to prove the change works. For setup and general habits, see our 20 Claude Code Tips guide.

Vague prompts get big, surprising diffs. Clear prompts get small, correct ones.

02

The anatomy of a good prompt

Task
What to build, fix, or change
Context
Relevant files with @, errors, and links
Constraints
Style, libraries, and what not to change
Done means
Tests pass, behavior works, output looks right
Process
Plan first, ask questions, or go ahead
03

Give the right context

  • Mention exact files with @
  • Paste the full error message
  • Share screenshots for UI work
  • Keep project rules in CLAUDE.md, so you do not repeat them
04

Plan before changing

Read @src/checkout and @tests/checkout. Propose a plan to add discount codes, listing files to change and risks. Do not edit anything yet.

Use plan mode for bigger changes, then approve the plan.

05

Feature prompts

Add a dark mode toggle to the settings page. Use the existing theme hook in @src/theme.ts, store the choice in local storage, and match the current toggle styles. Done means the toggle works, the choice persists after reload, and existing tests pass.

06

Bug fix prompts

Users see a blank page after login on Safari. Here is the console error: [error]. Find the root cause, explain it in two sentences, fix only that, and add a test that would have caught it.

07

Refactor prompts

Refactor @src/utils/date.ts into smaller functions without changing behavior. Keep the public API the same, and run the tests before and after.

08

Test prompts

Write tests for @src/cart.ts covering empty carts, discounts, and rounding. Follow the patterns in @tests/order.test.ts. Do not change the source code.

09

Review and explain prompts

  • “Review my changes for bugs, security issues, and missing tests.”
  • “Explain how authentication works in this project, with file references.”
  • “What could break if I upgrade this library?”
10

Correct course

  • Press Esc to stop as soon as it goes the wrong way
  • Say exactly what was wrong and what to do instead
  • Rewind to an earlier point when needed
  • Ask it to keep a change smaller

Undo the changes to the API layer. Only change the UI component, and keep the existing props.

11

Match effort to the task

  • Lower effort for simple edits and questions
  • Higher effort for tricky bugs and architecture
  • Start a fresh session with /clear for new tasks
12

Common mistakes

  • “Make it better” with no definition
  • Asking for many unrelated changes at once
  • No way to check the result
  • Letting it change files you did not mention

The golden rule

Do not tell Claude Code what to feel. Tell it what to change, what to leave alone, and how you will know it worked.

  • Task
  • Context
  • Constraints
  • Done means
  • Plan
  • Correct
  • Effort

Rewrite your next request with task, context, constraints, and done means, and compare the diff.

Share this guide

Frequently asked questions

What does “How to Prompt Claude Code” cover?
It has 12 sections, starting with “Why prompting matters”, “The anatomy of a good prompt”, “Give the right context” and “Plan before changing”, plus 8 more sections.
How long does it take to read?
About 2 minutes. Every section is a short, self-contained card, so you can jump straight to the part you need.
Is this guide free?
Yes. The full guide is free to read on this page, with no sign-up.
When was this guide last updated?
It was last updated in October 2026.

Read next

More free guides, no signup.

Free Notion database

1,100+ ways people are making money online

Real online businesses, creators and projects, broken down by how they make money: apps, online stores, AI tools and more. Free on Gumroad.

Get the free database

Free Notion database

399+ ways to make money online

Hundreds of online income methods in one place, so you can compare options and pick one to try. Free on Gumroad.

Get the free list

For research and ideas only. Results vary and nothing here is a promise of income. See our Disclaimer.

Weekly newsletter

Everything new, every Monday.

One short email every Monday with everything shipped that week: new free tools and websites, new guides, new free browser tools and what's new in my free Gumroad libraries, plus how the site is growing. Free, and you can unsubscribe anytime.

Join the newsletter

You sign up on Gumroad, which stores your email to send the newsletter. See our Privacy Policy.