Prompting Claude Effectively
The Foundations course covered prompt engineering broadly. This module goes deeper — specifically into techniques that work especially well with Claude's architecture and training. Some of these are Claude-specific. All of them will produce noticeably better results than generic prompting advice.
Why Claude responds differently than other models
Claude's Constitutional AI training creates some behaviors that affect how you should prompt it. Understanding these makes you significantly more effective.
Claude is trained to be direct. It won't pad responses with unnecessary affirmations or filler. If you ask a yes/no question, it will often give you a direct yes or no rather than a paragraph of hedging. This is a feature — lean into it by asking direct questions.
Claude will push back. If you ask Claude to do something it finds problematic, or if your reasoning has a flaw it notices, it will say so rather than quietly complying. Don't fight this — engage with it. Claude's pushback is often pointing at something genuinely worth considering.
Claude respects context length. Unlike models that effectively ignore content beyond a certain point in long prompts, Claude is trained to reason across its full context window. You can put critical instructions at the beginning or end and they'll stick — but you can also put supporting context in the middle knowing it won't get lost.
XML tags — Claude's native structure
This is the single most underused Claude-specific technique. Claude is trained on structured data and responds significantly better when you use XML tags to organize complex prompts. This isn't a workaround or a trick — it's how Claude's training was structured, and using it explicitly unlocks noticeably better results.
The improvement isn't subtle. Claude processes the structured version more cleanly, separates the different types of information correctly, and produces a more focused output. Use XML tags whenever your prompt has distinct sections — context, instructions, examples, constraints, or output requirements.
Common XML tag patterns that work well with Claude
System prompts — the invisible layer
In Claude.ai, the system prompt runs silently in the background of every conversation. In Projects (covered next module), you set it once and it persists. Understanding how to write effective system prompts transforms Claude from a generic assistant into a specialized tool tuned to your specific needs.
What a great system prompt contains
Role and identity: Who Claude is in this context. Not just "you are a helpful assistant" — be specific. "You are a direct, technically rigorous code reviewer specializing in Python and security vulnerabilities."
Behavioral rules: What Claude should always do and never do. "Always suggest a test case for any code you write. Never suggest a solution without explaining the tradeoff it makes."
Context: What Claude needs to know about the situation, user, or domain. "The user is a junior developer who understands syntax but may not know design patterns. Explain concepts at that level."
Output format: How responses should be structured. "Respond with: 1) A direct answer, 2) The reasoning behind it, 3) One potential downside to consider."
Tone: How Claude should communicate. "Be direct and technical. Skip the pleasantries. If the code is bad, say so."
A complete example system prompt
Working with Claude's honesty training
Claude is specifically trained to avoid sycophancy — agreeing with you just because you seem to want agreement. This is actually a powerful feature you can exploit deliberately.
Asking Claude to steelman and critique
One of Claude's most valuable capabilities is rigorous adversarial analysis. Ask it to find the strongest argument against your own position, to play devil's advocate, or to identify every flaw in your plan. Because Claude is trained to be honest rather than agreeable, this produces genuinely useful pushback rather than token "on the other hand" statements.
Calibrating Claude's confidence
Claude is designed to express appropriate uncertainty. If you want it to commit to a position rather than hedge, tell it explicitly: "Give me your best answer and commit to it — I understand it might be wrong, I need a concrete recommendation." Conversely, if you want it to surface its uncertainty explicitly, ask: "Walk me through how confident you are in each part of this answer."
Handling Claude's refusals effectively
Claude will decline some requests. The least effective response is trying to trick or pressure it. The most effective response is understanding why it's declining and addressing that directly.
When Claude declines, try these approaches in order:
Add context that addresses the underlying concern. If Claude declines to explain how a security vulnerability works, explaining that you're a security researcher testing your own system often resolves it.
Reframe the request around your actual goal. Sometimes the way you asked for something triggers caution that your actual goal doesn't warrant. Ask for the underlying thing you need rather than the specific framing that got declined.
Ask Claude what it would need to help. Literally ask: "What information would I need to provide for you to help me with this?" This often surfaces the specific concern Claude has, which you can then address directly.
Don't try to trick it. Claude's safety training is specifically designed to recognize manipulation attempts, and triggering that recognition makes it more cautious, not less. Honest engagement — providing real context about who you are and why you need something — is consistently more effective than clever workarounds.
Long conversation management
Claude's 200K context window is large but not infinite, and performance can vary across very long conversations. Here's how to manage long sessions effectively.
Front-loading critical context
Put the most important instructions and context at the beginning of your conversation or system prompt. Claude's attention is strongest at the start and end of its context. Mid-conversation instructions will be followed, but critical behavioral rules belong at the top.
Periodic context refreshes
In very long conversations, periodically summarize what's been decided or established: "To confirm what we've agreed so far: X, Y, and Z. Now let's continue with..." This keeps Claude anchored to your key decisions without requiring it to re-process the full conversation history.
Starting fresh vs. continuing
Know when to start a new conversation. If a conversation has gone off track, accumulated confusion, or grown so long that responses feel less coherent, starting fresh with a well-structured prompt is almost always better than trying to rescue a deteriorating thread.
Claude-specific power techniques
The "think before you answer" instruction
Adding "think through this carefully before giving your final answer" or "before responding, consider..." measurably improves accuracy on complex tasks. This prompts Claude to reason explicitly rather than pattern-match to the most immediate response. For hard problems, this single addition can dramatically improve output quality.
Iterative refinement with specific feedback
Claude responds exceptionally well to specific feedback on its outputs. Not "make this better" but "the third paragraph is too abstract — give me a concrete example. The tone in the conclusion shifts from confident to hedging — fix that." The more specific your feedback, the better the revision.
Multi-perspective analysis
Ask Claude to analyze something from multiple explicitly named perspectives in sequence. "Analyze this policy proposal from the perspective of: 1) a small business owner, 2) a civil liberties advocate, 3) a fiscal conservative, 4) an implementation specialist." Claude handles this structured multi-perspective analysis better than most models because its training emphasizes balance and nuance across different viewpoints.
Treat Claude as a collaborator, not a query engine. Share your actual goals, not just the task. Explain why you're doing something. Give it permission to push back. Ask follow-up questions. The quality ceiling on what Claude can help you accomplish rises dramatically when it understands the full picture of what you're trying to achieve.