1The Core Distinction
Two concepts control AI output quality. Prompt engineering controls how you ask. Context engineering controls what information you give the AI to work with. Most people spend all their time on the first and ignore the second — but the second matters more.
| Dimension | Prompt Engineering | Context Engineering |
|---|---|---|
| Focus | User-facing text (how you ask) | System-oriented data (what you provide) |
| Nature | Transient, single-turn | Persistent, memory-managed |
| Method | Trial-and-error iteration | Deterministic, structured pipelines |
| Input | A single text instruction | An organized information payload |
| Analogy | Writing a clear email subject line | Attaching the right documents to the email |
Three rules for applying both: front-load relevant information instead of asking the model to guess from nothing; constrain the scope by being explicit about which sources are authoritative; persist and refine by reusing a conversation with accumulated context for one workstream.
Good outcomes depend at least as much on context as on the wording of a single prompt. Stop optimizing your prompt. Start optimizing your context.
When the AI gives a wrong or weak answer, ask "Did I give it the right information?" before "Did I phrase my question correctly?" Context problems cause most AI failures.
2Better Prompts in Practice
A vague prompt forces the AI to guess, and every guess introduces error. The fix isn't better writing — it's more specificity.
HR
❌ Before: "Summarize this."
Vague. For whom? How long? What format?
✅ After: "Summarize this interview transcript as 5 bullet points for the hiring manager. Focus on the candidate's strengths and any concerns raised."
Marketing
❌ Before: "What's late?"
Late compared to what? Which campaign?
✅ After: "Which social posts for this launch campaign are more than 2 days past their scheduled date? Show as a table: platform, scheduled date, days late. Sort by days late descending."
More examples — HR, Industrial Engineering, and Legal
HR
✅ "Write a job description for a Senior Account Manager on the customer success team. Requirements: 5+ years in B2B account management, CRM experience, track record of client retention. Use our standard format: summary, responsibilities, requirements, benefits. Tone: professional but warm."
Industrial Engineering
❌ Before: "Check the downtime report."
Which line? Which shift? What counts as downtime?
✅ After: "Which production lines in this week's downtime report exceeded 30 minutes of unplanned downtime? Show as a table: line, date, duration, stated cause. Sort by duration descending."
Legal
✅ "Review this NDA for missing standard clauses. Check for: definition of confidential information, term length, return-of-materials, governing law. List each missing or weak clause with a one-line note on the risk it creates."
Every vague word in your prompt forces a guess. A prompt with five vague elements has roughly a 3% chance of producing exactly what you want. Five specific elements produce accurate results nearly every time.
3Five Prompting Patterns That Cover 90% of Your Work
You don't need dozens of techniques — five patterns cover almost everything you'll do in Claude.
| Pattern | What It Is | When to Use It |
|---|---|---|
| 1. Zero-Shot | Ask once with clear instructions, no examples | Simple, well-defined tasks with an obvious format |
| 2. Few-Shot | Provide 1–3 examples before asking the model to continue the pattern | Transforming notes, classifying items, consistent formatting |
| 3. Role Prompting | Explicitly assign the AI a role to align tone and depth | When you need a specific expertise level or style |
| 4. Chain-of-Thought | Ask the model to reason step by step before answering | Analysis, safety-relevant decisions, complex tradeoffs |
| 5. Interview-Style | Ask the model to ask YOU clarifying questions first | When you're unsure what you need, or the task is ambiguous |
Pattern 2 example (Few-Shot)
Convert these raw notes from our campaign retro into formatted action items: Input: "landing page load time hurt conversions, need dev to fix before next launch" Output: Action Item: Fix landing page load time before next launch. Owner: [Your Name]. Source: Campaign retro. Due: Before next launch. Input: "email open rates dropped, subject lines felt generic" Output: Action Item: A/B test more specific email subject lines. Owner: [Your Name]. Source: Campaign retro. Due: Next email send. Now convert this: Input: "paid social spend ran over budget, no one was watching the daily caps"
Pattern 4 example — Chain-of-Thought
I need to decide whether to escalate a vendor contract renewal that is 30 days from expiring. Walk me through the decision step by step: (1) What is the current expiration date? (2) When does a renewal decision need to be made? (3) What is the cost of renewing vs. switching? (4) What is the risk of letting it auto-renew? (5) Based on these factors, recommend escalate or hold.
Pattern 5 example — Interview-Style
I need to write a business case for a new employee onboarding tool. Before you draft anything, ask me 5 clarifying questions about the problem, the audience, the budget, and the timeline.
Start with Role Prompting ("You are a senior recruiter..."), add Few-Shot examples, then request Chain-of-Thought reasoning. Stacking patterns produces the highest-quality outputs.
4Context Engineering in Practice
A model is only as smart as its context. Without it, AI systems hallucinate — they invent facts. Engineered context fixes this.
| Role | Bad Context | Good Context |
|---|---|---|
| HR | Paste 40 résumés and ask "help me screen these" | Paste job requirements first, then 3 résumés at a time: "Score each 1–5 on relevant experience, years, leadership indicators. Show as a table." |
| Industrial Engineering | Paste an entire month of maintenance logs and ask "what's wrong with the line" | Extract just this week's entries: "Which failure codes appear more than twice? List code, frequency, and affected line." |
| Legal | Paste a 40-page merger agreement and ask "are there any risks?" | Extract just Indemnification and Termination: "Which clauses deviate from our standard template? List clause number, deviation, risk level." |
| Marketing | Ask "how did the campaign do?" with no data attached | Paste the campaign CSV filtered to last 30 days: "Which channels underperformed target CPA? Show channel, target, actual, gap." |
| Context Quality | What Happens |
|---|---|
| No context | AI guesses. High hallucination rate. Output is useless. |
| Partial context | AI gets some things right and invents others — dangerous because it looks plausible. |
| Full, structured context | AI delivers accurate, grounded answers. Minimal hallucination. |
It produces output that looks correct but contains invented details. Always verify AI output against source data when you suspect your context was incomplete.
5Managing Your Context Window
Every conversation has a limit. As it grows, the AI may forget earlier instructions or mix up old and new tasks. Knowing when to keep going vs. start fresh is a daily skill.
Reuse the same conversation when
- Same workstream — same document, decision, or meeting prep
- Earlier turns are still relevant ("we agreed high risk means X")
- The conversation isn't yet noisy or mixing multiple projects
Start fresh when
- The topic has genuinely changed
- The thread is long and messy with dead ends
- The AI starts reusing outdated assumptions from 20 turns ago
The summarize-and-reset technique
Ask: "Summarize the key decisions and constraints from this conversation in 5 bullet points." Copy that summary, start a new conversation, and paste it into a CONTEXT block at the top of your first new prompt:
CONTEXT (from previous conversation): - Decision 1: [AI-generated bullet] - Decision 2: [AI-generated bullet] - Decision 3: [AI-generated bullet] TASK: [Your new question or request]
If the AI references something from 20 turns ago that's no longer relevant, your context window is contaminated. Start fresh and carry over only what matters.
6Putting It All Together
Great AI Output = Clear Prompt + Right Context + Appropriate Pattern. This is one complete, production-ready prompt combining context, role, task, format, and constraints:
CONTEXT: [Paste relevant data here — e.g., this week's applicant tracking system update] ROLE: You are a senior HR coordinator writing a weekly hiring pipeline update. TASK: Based on the pipeline data above, draft a weekly status update for the hiring manager. FORMAT: - Group by: Offers Extended, In Interview, New Applicants, Stalled - Include candidate name, role, and one-line status for each item - Add a "Decisions Needed" section at the bottom - Keep total length under 1 page CONSTRAINTS: - Only include candidates with activity in the last 7 days - Flag anyone stalled in one stage for more than 10 days - Do not include candidates already rejected
| Section | What It Controls | Without It |
|---|---|---|
| CONTEXT | The data and ground truth to reason from | AI invents facts or gives generic answers |
| ROLE | Tone, depth, vocabulary, expertise level | AI defaults to a generic style |
| TASK | The core instruction and deliverable | AI misinterprets what you want |
| FORMAT | Structure, length, grouping, layout | AI picks its own format — you reformat later |
| CONSTRAINTS | What to exclude, flag, or follow | AI includes irrelevant content, misses edge cases |
Simple tasks need only TASK and FORMAT. Use CONTEXT, ROLE, and CONSTRAINTS when the task is complex, when accuracy matters, or when the output will be shared with others.
Verification
Related Resources
- claude.ai — Start a conversation and apply these patterns
- Claude documentation — Official documentation
- Claude support — Help articles and answers to common questions
Lesson complete
You now know the two levers that control AI output quality, five patterns that cover 90% of your work, and a formula for any complex request.