◈AI Codex
Foundation Models & LLMsHow It Works

How to write a system prompt that actually works

In brief

A system prompt is the standing brief Claude reads before every message. Here is how to write one for current Claude models: four questions to answer, a short template, the mistakes that make it worse, and how to fix it when the output is off.

6 min read··System Prompt

Contents

♡Sign in to save

Short answer

A good system prompt answers four things in plain sentences: who Claude is here, who it is talking to, what a good answer looks like, and the few rules it must follow. Give the reason behind each rule. Say what to do rather than what to avoid. Keep it to roughly 200 to 400 words, and fix it one change at a time by testing on real questions.

Last checked: November 20, 2026, against Anthropic's prompting best practices for the current models (Fable 5.2, Opus 5.5, Sonnet 5.5 and Haiku 5.5).

The same advice applies whether you are filling in a Project's instructions in the Claude app or setting the system field on the API.

Start with four questions

  1. Who is Claude in this context? One sentence is enough. "You help our support team draft replies to customers of a payroll product" gives Claude more to work with than "You are a helpful assistant."
  2. Who is it talking to? A new hire, a lawyer, a customer who is already annoyed. The audience decides vocabulary, length and how much to explain.
  3. What does a good answer look like? Length, structure, and tone. If you have one answer you liked, describe what made it good, or include it as an example.
  4. What are the hard rules? The handful of things that must always or never happen. Keep this list short. Every rule you add competes with the others.

The template

Copy this into the system prompt and fill it in. Delete any line you don't need.

Role: what Claude is doing here, in one sentence.

Audience: who reads the answers and what they already know.

Tone: two or three words, plus one sentence on what to avoid.

Always: the few things every answer must do, each with a short reason.

Never: the few things that would cause real harm, each with a short reason.

Context: facts Claude needs and can't guess: your product, your policies, your terms.

Format: how long, what structure, and whether to use headings or lists.

Filled in: a customer support assistant

Copy this and swap in your own product and policies:

<policies>
[paste refund policy, payroll cut-off times, escalation rules]
</policies>

<help_articles>
[paste the 10 to 20 articles customers ask about most]
</help_articles>

You draft replies to customers of Brightpay, a payroll app for small businesses. A support agent reads every draft and sends it, so write something they can send with light edits.

Customers are business owners, often stressed because payroll is due. Most aren't technical. Be warm and direct, and get to the answer in the first sentence. Avoid jargon and long apologies.

Always:
- Answer from the help articles and policies above. If they don't cover the question, say so and suggest the agent escalate, because a wrong payroll answer can cost the customer money.
- Give steps as a short numbered list when there are more than two.
- End with one line asking if that solved it.

Never:
- Promise refunds, credits or deadlines. Only the billing team can approve those, so say the agent will check.
- Ask for full bank or tax ID numbers. We never need them in email.

Format: plain text, under 150 words, no headings.

Want one for a different job? Try the system prompt builder.

Most working system prompts land between 200 and 400 words. Longer is fine when the extra words are context Claude needs, such as a policy or a product list. Put long reference material near the top, wrapped in tags like <policy> or <product_list>, and keep the instructions after it. On the API, a long system prompt that you send over and over is a good fit for prompt caching.

The mistakes everyone makes

Rules with no reason. "Never use bullet points" is followed stiffly and inconsistently. "Answers are pasted into customer emails, so write in short paragraphs, not bullet points" is followed well, and Claude applies the reason to cases you didn't list.

Shouting. CAPITALS, "CRITICAL" and "you MUST" were common in prompts written for older models. Current models follow the system prompt closely, so that kind of emphasis tends to overcorrect: a tool gets used when it shouldn't, or a rule crowds out common sense. Write rules in a normal voice. If you are reusing an old prompt, this is the first thing to tone down.

Saying what not to do. "Don't be too formal" leaves Claude guessing what you do want. "Write the way a colleague would in a quick Slack message" tells it.

Expecting it to infer "do more". Current models do what the prompt asks, quite literally. If you want Claude to make the change rather than suggest it, or to cover every case rather than the main one, say so.

One prompt for every job. A prompt that tries to cover support replies, sales emails and internal docs ends up vague about all three. Use a separate Project or a separate system prompt for each job.

How to iterate

Test the prompt on five to ten real questions, including a couple of awkward ones. When an answer is off, work out which kind of problem it is and change one thing:

  • Wrong tone: add a sentence on audience, or paste in an example of the tone you want.
  • Wrong facts: the information is missing. Add it under Context, or attach the document.
  • Wrong format: describe the format positively, and keep the formatting of the prompt itself close to what you want back. A prompt full of headings and bullets tends to get headings and bullets.
  • Wrong scope: it answers questions it shouldn't, or refuses ones it should take. Say plainly what is in scope and what to do with everything else.

Change one line, rerun the same questions, and compare. Changing several things at once makes it hard to tell what helped.

Quick answers

What should a system prompt include? Who Claude is in this context, who it's talking to, what a good answer looks like, and the few hard rules, each with a short reason. Add any facts Claude can't guess, like your product or policies.

How long should a system prompt be? Usually 200 to 400 words of instructions. It can be longer when the extra length is reference material Claude needs, such as a policy, placed near the top in tags.

Should I use capitals or "MUST" in a system prompt? No. Current Claude models follow the system prompt closely, so shouting tends to overcorrect. Write rules in a normal voice and give the reason.

Is a Project's instructions box the same as a system prompt? Yes, in practice. The same advice applies to Project instructions in the Claude app and the system field on the API.

Further reading

Official training on this: Building with the Claude API (67 lessons · 9 hr) on Claude Academy, free.

Related tools

Weekly brief

For people actually using Claude at work.

Each week: one thing Claude can do in your work that most people haven't figured out yet — plus the failure modes to avoid. No tutorials. No hype.

No spam. Unsubscribe anytime.

What to read next

Picked for where you are now

All articles →