Write System Prompts That Make Claude Do Exactly What You Need
Your first project. 20 minutes.
A well-written system prompt turns Claude from a general-purpose assistant into a precise, specialized tool. Whether you are building a product with the API or setting up a Claude Project for your team, the system prompt defines the ceiling of what Claude can reliably do for you.
A Claude system prompt is a set of instructions that runs before any conversation and shapes every response. The best system prompts follow the pattern: role definition + output format + constraints + examples. Claude follows structured system prompts with high fidelity.
Six Core Principles
What every good system prompt must do
How to Write a System Prompt (6 Steps)
Write one sentence describing who Claude is in this application. Specific job title + company type + audience level.
Specify structure, length, and any required fields. JSON, markdown, bullet points, word count targets — whatever your downstream system expects.
What Claude must never do. Edge case behavior. How to handle uncertainty. Escalation triggers.
Company name, product context, user segment, technical level. Anything that's always true about the user.
Input → output. Pick the hardest real case. This calibrates Claude faster than any instruction block.
Try off-topic questions, vague requests, and edge cases. Update the system prompt to handle each one explicitly.
Real System Prompt Examples
You are a senior software engineer conducting code reviews for a TypeScript/Next.js codebase.
For every code snippet provided:
1. Identify security vulnerabilities (SQL injection, XSS, exposed secrets, missing auth)
2. Flag performance issues (N+1 queries, unoptimized re-renders, missing caching)
3. Note code style violations (no any types, explicit column selects only, parameterized queries)
4. Suggest specific rewrites for issues found
Output format:
{
"risk_level": "critical|high|medium|low",
"issues": [{"line": N, "type": "security|perf|style", "description": "...", "fix": "..."}],
"approved": true|false
}
If the snippet is safe and clean, output: {"risk_level": "low", "issues": [], "approved": true}You are a support agent for [Product Name], a project management SaaS tool.
Context:
- Users range from individual freelancers to enterprise teams
- Common issues: billing questions, integration errors, permission problems, import failures
- Escalate to human agent if: refund request over $500, data loss reported, account compromised
Response rules:
- Answer in 3 sentences or fewer for simple questions
- Use numbered steps for any multi-step process
- Never speculate about timelines or make promises ("Your issue will be resolved by...")
- End every response with: "Was this helpful? Reply 'yes', 'no', or describe what you still need."
If you cannot answer confidently, say: "I'll flag this for our team — please expect a reply within one business day."You are a professional editor for a B2B SaaS marketing team.
Brand voice: direct, expert, never jargon-heavy. Second-person ("you"), active voice, sentences under 20 words.
Never use: "leverage", "synergy", "game-changing", "unlock potential", "robust", exclamation points, or em dashes.
When editing:
1. Preserve the author's ideas and examples — change words, not meaning
2. Flag any claims that need a source with [CITE NEEDED]
3. Note if the opening hook is weak and suggest an alternative
4. Output the edited version followed by a 3-bullet change summary
For subject line or headline tasks: provide 5 variants with the primary goal (curiosity/benefit/urgency/social proof/question) labeled for each.System Prompt Anti-Patterns
Why it fails: This is the default — it tells Claude nothing about your specific context.
Fix: Define who Claude is, what it's helping with, and exactly what output format to use.
Why it fails: Tone instructions without examples produce generic warmth, not your actual brand voice.
Fix: Show the tone with a concrete before/after example in the system prompt.
Why it fails: Negative constraints on complex behaviors are hard to enforce without specifics.
Fix: "If you're not confident, output: 'I'm not certain — here's what I'd need to know: [list]'" gives Claude a template to follow.
Why it fails: Broad expertise claims reduce calibration. Claude hedges less when it should hedge more.
Fix: Specify the actual domain: "You are an expert in HIPAA compliance for healthcare SaaS startups."
Frequently Asked Questions
What is the best Claude system prompt?
The best system prompts are specific, structured, and include role definition, output format, constraints, and examples. There is no universal best prompt, but the pattern of role + format + constraints + examples consistently produces the highest-quality output.
How long should a system prompt be?
As long as it needs to be. A 500-word system prompt with clear structure outperforms a 50-word vague one. Include role, format requirements, constraints, and 1-2 examples for optimal results.
What is the difference between a system prompt and a user prompt?
A system prompt runs before any conversation and shapes all responses. A user prompt is a single message within a conversation. System prompts set persistent behavior; user prompts make specific requests.
Can I use system prompts in Claude.ai?
Yes. Claude Projects let you set a system prompt (called custom instructions) that applies to every conversation within that project. In the API, system prompts are passed as the system parameter.
Master prompt engineering hands-on
Interactive exercises that build real prompting instincts.