The Basics of Good Prompting: Clear Instructions, Context, Examples
The Basics of Good Prompting: Clear Instructions, Context, Examples
~7 Min. Lesezeit Zuletzt aktualisiert am August 8, 2026
An "instruction" to Claude is often called a prompt. How good the answer turns out largely depends on how well the prompt is written - whether in Claude.ai or in Claude Code. This chapter shows you the key principles that will accompany you throughout the rest of this series.
Principle 1: clear, specific instructions
The more specific the instruction, the more targeted the answer. "Make this better" leaves a lot of room for interpretation; "Shorten this paragraph to three sentences and keep the formal tone" leaves almost no doubt. That applies to text just as much as to code: "Improve the function" is vague, "Change the function calculateSum so it handles an empty list without throwing an error" is precise.
Principle 2: give context
Claude knows neither your situation nor your history unless you tell it. Instead of "Write me an email", "Write a short, friendly email to a customer asking about a delayed delivery - we expect the goods in three days" provides all the information needed for a fitting answer. In Claude Code, giving context often means naming relevant files or error messages: "In utils.py, the function parse_date throws an error on an empty string - here's the exact error message: ...".
Principle 3: give concrete examples
An example often says more than a long description. If you want a specific output format, show it: "Format each result like this: Name - Price - Stock, for example Apple - $0.89 - 42." This drastically reduces follow-up questions and misunderstandings, because the desired result no longer needs to be interpreted, only matched.
Good vs. bad prompts compared
A few side-by-side comparisons that make the principle tangible:
- Bad: "Fix the bug." — Better: "Nothing happens when clicking the Save button on the contact page, but a success message should appear. Take a look at
ContactForm.jsx." - Bad: "Make the website better." — Better: "The mobile navigation overlaps with the logo below 400px width. Fix that without changing the desktop layout."
- Bad: "Write tests." — Better: "Write tests for the function
validateEmailinvalidators.js, including edge cases like an empty string and a missing @ sign."
Working iteratively instead of demanding everything at once
A prompt doesn't have to be perfect on the first try. Especially for larger tasks, it's often more effective to work in small steps: ask for a rough version first, look at the result, then adjust in a targeted way ("This looks good, but shorten paragraph two" or "Use the same error handling as the neighbouring function instead"). That's not a sign of a bad first prompt - it's the normal, efficient way of working.
Tipp: A simple rule of thumb: if you'd be comfortable giving a colleague the exact same task in a chat message, with no follow-up questions needed, the prompt is probably clear enough. If you're missing a detail yourself (which format, which file), Claude's prompt is probably missing it too.
With these basics in hand, the next block looks at how Claude Code actually acts on these instructions: which tools it uses to read, change, and run code - and how you stay in control the whole time.