Prompt Basics
Summary — Key Takeaways from This Lesson
- Structuring a prompt with 5 elements — role, context, task, constraints, and output format — improves accuracy.
- Vague questions get vague answers. The more specific you are, the closer Claude gets to what you expect.
- Simply specifying the output format ("as bullet points," "as a table," "within 300 characters") changes the quality of the response.
- Few-shot examples are one of the most effective techniques. Hand Claude a sample and say "in this format."
- If a response falls short, just follow up with "revise the … part." The conversational format is Claude's strength.
目次 (9)
What Is a Prompt?
A prompt is the entire input text you pass to Claude. Whether it's a simple question or hundreds of lines of system instructions, it's all called a "prompt." Claude reads the prompt to decide what to answer and how. In other words, the quality of the prompt determines the quality of the answer.
The 5 Principles of a Good Prompt
1. Assign a Role
Telling Claude "what perspective to answer from" changes the tone and depth of expertise in its response.
You are a copywriter with 10 years of marketing experience. Please improve the following product description.
When you assign a role, Claude builds its answer based on how that kind of expert would think.
2. Provide Context and Purpose
Simply writing "why it's needed" and "who will read it" dramatically improves the accuracy of the response.
Please write a 400-character explanation of climate change that is easy to understand for middle school students doing a summer research project.
3. Specify the Output Format
Be explicit about "what form you want the answer in."
- "Summarize in 5 bullet points"
- "In Markdown table format"
- "Within 400 characters, starting with the conclusion"
- "List key: value pairs in JSON format"
4. Add Constraints
Writing "what you don't want" and "conditions to follow" keeps the response from going out of scope.
Please do not use technical jargon. Also, do not mention any competitor names.
5. Use Examples (Few-Shot) to Convey Format
Providing 1–3 sample outputs and saying "in this format" allows Claude to accurately follow the structure. This is especially powerful for producing fixed-format outputs, data transformations, and maintaining a consistent writing style.
Please write product information in the following format.
Example: [Product Name] Smart Scale Pro [Features] Automatically syncs daily weight and body fat to the app [Price] ¥9,800 (tax included) Fill in the information for "Wireless Earphones X1" using the format above.
Combining Them Dramatically Improves Accuracy
Let's look at an example that uses all 5 principles together.
[Role] You are a Customer Success representative for a SaaS company.
[Context] I want to write a reply email to an existing user who is considering canceling. [Task] Please include empathy for the following complaints, a proposed solution, and information about a retention incentive. [Constraints] Within 200 characters. Use natural language so it doesn't sound like a form letter. [Output Format] Write the subject line and body separately. Complaint: "The dashboard is complicated and hard to use"
With this level of instruction, Claude understands "who, why, and what" before composing its answer. At first you might feel it's "too long," but the quality of the response changes dramatically.
How to Refine a Response You're Not Happy With
A conversation with Claude isn't "send and forget." If the response doesn't meet your expectations, simply follow up with a correction instruction.
- "Make it shorter — within 100 characters"
- "Back up the third point with specific numbers"
- "Make the overall tone a little more casual"
- "Give me 3 alternative approaches"
Because Claude retains the conversation context, you don't need to paste the entire previous response again. A short instruction like "please do … to the … in the previous response" is all it takes.