How to Write Effective Prompts

Learn the fundamental techniques for writing prompts that get precise and useful answers from Claude. Context, role, format, and iteration: the practical guide.

Knowing how to write a good prompt is the most important skill when working with AI. You don't need to be an engineer: just a few practical rules to transform mediocre answers into excellent ones.

2026-04-22 8 min Dario Santocanale
#claude#prompt#prompt-engineering#beginner#techniques

---

Why prompts make a difference

Claude is a very capable model, but it responds to what you ask — not what you mean. A vague prompt produces vague answers. A precise prompt produces precise answers.

Think of the prompt as a briefing you'd give to a very talented colleague who knows nothing about your context. The more information you give, the better they'll work.

---

The perfect prompt structure

An effective prompt has (all or part of) these 4 elements:

1. Context

Who you are, what the situation is, what the purpose is.
❌ "Write a LinkedIn post"
✅ "I'm a freelance digital marketing consultant. I want to post on LinkedIn to attract clients in the US retail sector. My tone of voice is professional but direct, not overly formal."

Context doesn't need to be repeated with every message: Claude remembers it throughout the conversation.

2. Task

Exactly what you want. Use specific action verbs.

Effective verbs: write, summarize, analyze, list, compare, correct, translate, explain, transform, evaluate

❌ "Tell me something about this text"
✅ "Summarize this text in 5 bullet points highlighting only the key information for a business decision-maker"

3. Output format

How you want Claude to structure the response.

Common options:

  • Numbered or bullet list
  • Comparison table
  • Continuous text, paragraphs
  • H2/H3 headings (for long content)
  • Code only, no explanations
  • Answer in maximum N words/lines
  • JSON / XML / CSV (for technical output)

✅ "Respond with a 3-column table: Pros, Cons, Need to Know"

4. Constraints

Limits, exclusions, tone, target audience.
✅ "Use language suitable for non-technical readers. Don't use acronyms without explaining them. Maximum 300 words."

---

The "Role" technique (Role Prompting)

One of the most powerful techniques: assign Claude a specific role before making your request.

You are an expert copywriter with 15 years of experience in B2B communication.
Your style is: direct, benefit-oriented, no clichés.

Then make your request normally. Claude will adapt the style, vocabulary, and perspective to the assigned role.

Useful role examples:
RoleWhen to use it
"You are a senior Python developer"Code review, debugging
"You are a lawyer specializing in US employment law"Contract drafts, legal FAQs
"You are an editor at a business newspaper"Article editing, journalistic style
"You are a high school math teacher"Simple explanations, practical examples
"You are a marketing consultant focused on SMBs"Marketing strategies, competitor analysis
Note: Claude is not a substitute for a professional. The role improves response quality but doesn't replace real expert consultation for important decisions.

---

Chain of Thought: ask Claude to reason step by step

For complex problems (math, logic, multi-step analysis), add this phrase to your prompt:

Think step by step before giving me the final answer.

This simple addition significantly improves accuracy on problems that require multiple logical steps.

Example:
❌ "What's the unit price if I buy 47 items at $3.20 each with a 12% discount and 8% sales tax?"
✅ "Calculate the total cost of the following operation, thinking step by step: 47 items at $3.20, 12% discount, 8% sales tax. Show me each step."

---

Few-shot prompting: show examples

If you want output in a very specific format, the most effective way is to show an example (or two) before making the real request.

Write product descriptions in the following style.

Example:
Product: Handcrafted leather bag
Description: Every stitch tells hours of silent work. Vegetable-tanned 
leather from Tuscany, organic cotton lining. It's not just a bag — 
it's a piece that lasts decades.

Now write the description for:
Product: Restored vintage 1960s wristwatch

Claude understands the pattern from the example and replicates it.

---

Iteration: the professional's secret

There's no perfect prompt on the first try. The real workflow is:

  1. First prompt — describe the task with essential context
  2. Read the response — evaluate what works and what doesn't
  3. Iterate — ask for specific corrections without rewriting everything

Useful iteration commands:

Too long — cut it in half while keeping the key points.
The tone is too formal — make it more conversational.
Add a concrete example for point 3.
Remove the obvious parts and get straight to the point.
Now rewrite it as if it were being read by a startup CEO.

Claude remembers all previous context, so each iteration request refines the response without losing the thread.

---

Common mistakes to avoid

MistakeExampleHow to fix it
Too vague"Help me with my website"Specify the exact problem, technology used, what you've already tried
Too many requests at once"Write a post, translate it, and give me 5 variants"One task per prompt, then iterate
No format specified(absence)Add "respond with bullets / table / max 200 words"
Expecting absolute truthRecent facts/newsUse Claude for reasoning, not as a source of recent news

---

Prompt templates to save

Copy these templates and adapt them to your needs:

For text analysis:
Analyze the following text and:
1. Summarize it in maximum 3 sentences
2. List the 3 key points
3. Identify any gaps or weaknesses in the argument

Text: [paste here]
For professional writing:
You are an expert copywriter in B2B communication.
Write [content type] for [target audience].
Tone: [formal/informal/direct/technical].
Length: [indication].
Goal: [what it should make the reader do or think].

Topic: [describe]
For code debugging / review:
You are a senior [language] developer. 
Examine the following code and:
1. Identify any bugs or issues
2. Suggest readability/performance improvements
3. Explain each proposed change

[code]

---

Up next →1-4-limiti-claude