What Makes Claude Different
Claude is built by Anthropic with a focus on helpfulness, harmlessness, and honesty. In practice, this means Claude is particularly good at following complex instructions precisely, refusing unsafe requests gracefully, and acknowledging uncertainty instead of fabricating answers.
Claude 4.6 comes in two variants: Opus (most capable, best for complex reasoning) and Sonnet (faster, cheaper, best for most production tasks). For prompt engineering practice, start with Sonnet — it is fast enough for iteration and capable enough for nearly all tasks.
XML Tags for Structured Prompts
Claude responds exceptionally well to XML-tagged sections in prompts. Use tags like <instructions>, <context>, <examples>, and <output_format> to clearly separate different parts of your prompt.
XML tags work better than markdown headers or plain text separators because they create unambiguous boundaries. The model can clearly distinguish between your instructions and the data you want it to process.
This is especially important when your prompt includes user-provided content that might contain instructions of its own. XML tags help Claude understand that content inside <user_input> tags is data to process, not instructions to follow.
Prompt:
<role>Senior technical writer creating API docs.</role> <context> REST API: POST /api/v1/users Auth: Bearer token Rate limit: 100/min </context> <instructions> Write docs including: description, headers, request body, response codes, example. </instructions> <output_format>Markdown with JSON code blocks</output_format>
Output:
Claude produces cleanly structured API docs with all sections, proper markdown formatting, realistic JSON examples, and accurate HTTP status codes — following the XML structure exactly.
System Prompts and Prefilling
When using the Claude API, you can set a system prompt that establishes persistent behavior for the entire conversation. The system prompt is the right place for role definitions, output format rules, and behavioral constraints.
Keep system prompts focused. A good system prompt is 100-300 words covering: who the assistant is, what it should do, what it should not do, and the expected output format.
Prefilling is a Claude-specific technique where you start the assistant response with specific text. For example, if you want JSON output, you can prefill the response with an opening curly brace. This forces the model to continue in JSON format without any preamble.
Extended Thinking
Claude supports extended thinking mode where it reasons through complex problems in a thinking block before producing its final answer. This is like chain-of-thought but built into the model architecture.
Extended thinking is most useful for: complex math and logic, code debugging where the model needs to trace execution, multi-step analysis where intermediate reasoning improves the final answer, and tasks where you want to see the reasoning process.
To use extended thinking effectively, give Claude problems that genuinely require multi-step reasoning. Simple factual questions do not benefit — they just increase response time and cost.
Claude-Specific Best Practices
Be direct with Claude. Unlike some models that respond better to politeness, Claude responds best to clear, direct instructions. "Summarize this in 3 bullet points" works better than "Could you please kindly summarize this?"
Use Claude for tasks requiring careful reasoning. Claude is particularly strong at: analyzing arguments and finding logical flaws, following complex multi-part instructions precisely, maintaining consistent persona over long conversations, and refusing to make up information it does not know.
When Claude says it cannot do something, it usually means it. Rather than trying to trick it, rephrase your request to explain what you actually need and why. Claude responds well to honest context about your use case.