Write effective prompts
Get better results from Claude Code
⏱ Est. ~7 min
01 · Read
The quality of Claude Code's output depends directly on the quality of your input. Vague prompts get vague results. Specific prompts get exactly what you want.
This isn't about learning a special language or syntax — it's about clear communication. The same skill that makes you good at explaining things to a coworker makes you good at prompting Claude Code.
Let's look at the difference between weak and strong prompts, and build a framework you can use every time.
💡 Picture thisImagine ordering at a restaurant. "Give me something good" could get you anything. "I'd like grilled salmon, medium, with roasted vegetables and the sauce on the side" gets you what you actually want. Prompts work the same way.
02 · Read
Here are real examples of weak vs. strong prompts:
Weak: "Make it look better" Strong: "Use a dark color scheme with blue accents, a sans-serif font, and a max width of 800px centered"
Weak: "Fix it" Strong: "The delete button doesn't work — clicking it does nothing. I expect it to remove the bookmark from the list and from localStorage"
Weak: "Add a feature" Strong: "Add a search bar above the bookmark list that filters in real time as the user types, matching against title and URL"
Weak: "Make it better" Strong: "The page loads slowly because every keypress re-renders all bookmarks. Only update the visible list, not the whole DOM"
Notice the pattern: strong prompts include what you want, where it goes, how it works, and context about what already exists.
Key points
- Vague prompts get vague results — specificity is everything
- Describe what you want, where it goes, how it behaves
- Add context about what exists or what's broken
- Strong prompts save iteration time — you get it right faster
03 · Quiz
Which is the better Claude Code prompt?
- Add a feature
- Add a search bar that filters the bookmark list as the user types and highlights matches
- Make it better
- Do something cool
04 · Checklist
Use this prompt-writing framework every time you ask Claude Code to do something. Check off each element when your prompt includes it.
- WHAT: I describe what to build or change
- WHERE: I mention which files or components
- HOW: I describe specific behavior or appearance
- CONTEXT: I explain what exists or what's broken
05 · Fill in the blank
The prompt framework is: WHAT you want, _____ it goes, HOW it works, CONTEXT.
06 · Read
Congratulations — you've finished Level 8.
Look at what you can now do with Claude Code: - Understand any codebase by asking Claude to explain it - Create new files and entire projects from descriptions - Edit existing code with precise, surgical changes - Build complete applications from a single detailed prompt - Communicate effectively using the WHAT-WHERE-HOW-CONTEXT framework
You went from not knowing what a terminal was to building real apps with an AI pair programmer. That's not a small thing.
The tools you've learned across all the levels — terminal, file system, git, JavaScript, npm, web servers, and now Claude Code — are exactly the tools professional engineers use every day. The difference is you have an AI assistant making you faster.
Key points
- Claude Code can understand, create, edit, and build
- Better prompts = better results (WHAT, WHERE, HOW, CONTEXT)
- Always review and test Claude's output
- You're the decision-maker — Claude is the accelerator
07 · Quiz
Consider this prompt: "Add validation to the email field in ContactForm.tsx, showing a red border and error message when the format is invalid." Which elements of the WHAT-WHERE-HOW-CONTEXT framework does it include?
- Only WHAT
- Only WHAT and WHERE
- WHAT, WHERE, HOW
- All four: WHAT, WHERE, HOW, CONTEXT
08 · Fill in the blank
The four elements of an effective prompt are: WHAT you want, WHERE it goes, _____ it works, CONTEXT about what exists.
Other lessons in this chapter
⚠ The full interactive experience needs JavaScript. Please enable it and reload.
※ This is an independent Traditional Chinese teaching project — not an official Anthropic product. Claude™ is a trademark of Anthropic, PBC.