Claude Chat · Prompt Engineering

Prompt Engineering Hub

The complete landscape of prompting techniques — from beginner zero-shot to advanced chain-of-thought and XML structuring. Master these and you'll extract 10× more value from Claude.

🎯 Zero-Shot📸 Few-Shot🎭 Role🔗 Chain of Thought⚡ Advanced
🧠 What is Prompt Engineering?

Prompt engineering is the skill of communicating with AI models to get high-quality, reliable outputs. It's not about tricks or hacks — it's about understanding how language models process information and structuring your inputs to make the model's job as clear as possible. A well-engineered prompt is the difference between a mediocre output and a remarkable one.

The Prompting Techniques Landscape

These techniques range from simple to advanced. You don't need all of them for every task — understanding when to apply each is the real skill.

TechniqueDifficultyBest ForKey Concept
System PromptsBeginnerPersistent behavior shaping, custom personasSet Claude's role and rules before conversation begins
Zero-ShotBeginnerSimple, clear tasks Claude already knows wellDirect instruction with no examples
One-ShotBeginnerTasks needing specific format or styleOne example demonstrates the desired output
Few-ShotIntermediateClassification, consistent formatting, pattern tasksMultiple examples calibrate model behavior
Role PromptingIntermediateExpert knowledge, specific communication stylesAssign Claude a persona with defined expertise
Chain of ThoughtIntermediateMath, logic, multi-step reasoningAsk Claude to think step-by-step before answering
Extended ThinkingAdvancedComplex research analysis, hard problemsClaude's internal scratchpad for deep reasoning
XML StructuringAdvancedLong, complex prompts with multiple componentsTags organize prompt sections for better parsing
Prompt ChainingAdvancedMulti-step workflows, complex document processingOutput of one prompt becomes input to next
Meta-PromptingAdvancedCreating prompts for other tasksAsk Claude to write or improve prompts itself

The Anatomy of a Great Prompt

Great prompts share common structural elements. Not every prompt needs all of these, but understanding each component lets you add them strategically:

Prompt Anatomy Template
[ROLE / PERSONA]           — Who Claude should be in this response
[CONTEXT]                  — Background information Claude needs
[TASK]                     — Clear statement of what you want
[INPUT DATA]               — The specific content to work with
[REQUIREMENTS / CONSTRAINTS] — Rules, format, length, tone
[EXAMPLES]                 — Sample input→output pairs (few-shot)
[OUTPUT FORMAT]            — Exactly how you want the response structured

Example using all components:

You are an expert machine learning researcher with 10 years
of industry experience (ROLE).

I'm a junior data scientist preparing my first ML paper for
submission to NeurIPS (CONTEXT).

Review my abstract for technical accuracy and academic quality (TASK).

[Abstract pasted here] (INPUT)

Requirements: (CONSTRAINTS)
- Flag any technical inaccuracies
- Suggest more precise terminology where needed
- Rate clarity for non-expert reviewers (1-10)
- Keep feedback under 400 words

Format: bullet points organized by: Strengths | Issues | 
Revised Abstract (OUTPUT FORMAT)

The Prompting Mindset

🎯

Be Specific

Vague prompts get vague answers. The more specific your task description, the more targeted Claude's response. Replace "write something about X" with "write a 300-word introduction to X for a final-year student audience."

🔄

Iterate, Don't Restart

Treat prompting as a conversation, not a one-shot exchange. Your first prompt is a hypothesis. Refine based on output. The best prompt engineers get 80% of value through iteration, not perfect first-shot prompts.

🧪

Experiment Deliberately

Test different framings for the same task. Small changes — adding "think carefully," changing from "list" to "explain" — produce measurably different outputs. Build intuition through systematic experimentation.

📏

Right-Size Your Prompt

More context isn't always better. For simple tasks, concise prompts often outperform over-specified ones. For complex tasks, rich context is essential. Learn to judge what's necessary.

🏗️

Structure for Complexity

For complex prompts touching multiple topics, use visual structure: numbered sections, clear headers, XML tags. Helps Claude parse and respond to each component accurately.

Define Success Criteria

Tell Claude how you'll evaluate a good answer. "A good response will include X, address Y, and not include Z." This meta-instruction dramatically improves output quality.

Quick Reference: Prompting Patterns

The STAR Prompt Pattern (for complex tasks)

STAR Pattern
Situation:  I am [who you are] working on [what you're doing]
Task:       I need you to [specific request]
Action:     Approach this by [how to approach it]
Result:     The output should be [what good looks like]

Example:
Situation:  I'm a marketing student preparing for a case competition
Task:       Analyze this company's digital strategy [company info pasted]
Action:     Use the 4P marketing framework and SWOT analysis
Result:     A structured report with clear recommendations I can present in 5 minutes

The "Before You Respond" Pattern

Verification Pattern
Before you respond to my task below:
1. Restate the task in your own words to confirm you understand it
2. List any assumptions you're making
3. Ask me any clarifying questions you need
THEN proceed with the task.

Task: [your task here]

The "Critique First" Pattern

Critique Pattern — Great for High Stakes Work
Step 1: Generate [output]
Step 2: List the 3 main weaknesses of what you just wrote
Step 3: Write an improved version addressing those weaknesses
Step 4: Explain what changed and why it's better

Anthropic's Official Resources

📚 Official Learning Resources

Explore All Techniques

🎛️

System Prompts →

Shape Claude's core behavior and persona with system-level instructions.

🎯

Zero / Few-Shot →

Use examples (or not) to calibrate Claude's output format and style.

🎭

Role Prompting →

Assign expert personas to get domain-specific, calibrated responses.

🔗

Chain of Thought →

Unlock deep step-by-step reasoning for hard analytical problems.

Advanced Techniques →

XML tags, prompt chaining, meta-prompting, and output engineering.