Claude system prompt: how to write one that holds
Free prompt courseLesson 9 of 228 minVideoGo to the lesson
Guide
4 min
- Plain English
The short answer
A Claude system prompt is the instruction block you send separately from the user's message to set Claude's role, rules and output format for a whole conversation. In the Application Programming Interface (API) it's the system parameter. In the claude.ai app, Anthropic writes the system prompt, and you shape Claude with Project instructions instead.

Where can you set a Claude system prompt?
You can set a Claude system prompt only through the API's system parameter; in the claude.ai app you shape Claude with Project instructions instead. The name covers 2 different things:
- The API system prompt. You send it in the
systemparameter, apart from themessagesthat carry the user message. This is the one you'll write. - Anthropic's claude.ai system prompt. Claude's web interface and mobile apps run a system prompt that supplies things like the current date and asks for code in Markdown. Anthropic publishes these in its system prompt release notes and says those updates don't apply to the API.
| Where you use Claude | Who writes the system prompt | What you control |
|---|---|---|
The API, in the system parameter | You | The whole text |
| claude.ai and the mobile apps | Anthropic, published in its system prompt release notes | Project instructions, not the system prompt |
So in the app you can't edit the system prompt itself. Project instructions are the closest tool you've got there: you write them once in a Claude Project, and every chat in that project reads them.
Anthropic published system prompts for its own Claude apps in its release notes, and reading one shows how much plain instruction a real assistant carries. Model choice matters less than you'd think: the same skeleton works on Haiku, Sonnet and Opus, and only the length you can afford changes.
What does a Claude system prompt skeleton look like?
A Claude system prompt skeleton looks like four Extensible Markup Language (XML) tagged blocks: role, context, rules and format. Anthropic's prompting best practices recommend clear, direct instructions, XML tags to separate kinds of content and a role, and they say a single sentence of role is enough to change Claude's tone. To get the four blocks filled from a short form, use the system prompt builder, which asks which model you're writing for first.
Skeleton (copy)
<role>One or two sentences: who Claude is here and who it's talking to.</role> <context>What the business or project is. Facts Claude may rely on.</context> <rules>Hard limits, one per line. Say what to do, not just what not to do.</rules> <format>Length, structure, tone, and what to do when information is missing.</format>
Two habits keep the tags working, and they're easy: keep tag names consistent, and refer to them in your rules ("use only the facts in the context tag"). The three ready system prompts further down the page, for support, editing and extraction, all follow this skeleton, so you can see how it's filled in.
What belongs in a Claude system prompt versus the user message?
A Claude system prompt holds role, tone, standing rules and facts for every conversation, and the user message holds the task and its inputs.
| System prompt | User message |
|---|---|
| Role, tone and standing rules | The task for this turn |
| Facts that apply to every conversation | The document or data for this turn |
| Output format that never changes | Anything that changes each time |
For long documents, Anthropic advises putting them near the top of the prompt and the question at the end, which can lift quality on complex inputs.
How do you make a Claude system prompt hold up?
Make a Claude system prompt hold up with 5 habits: give the reason for each rule, drop capital-letter shouting, give a way out, keep it short and test it.
- Give the reason. A rule with a reason ("never quote prices, they change weekly") generalises better than a bare command.
- Don't shout. Capital letters and repeated warnings can make newer models over-apply a rule. State it once, calmly; Claude won't miss it.
- Give a way out. "If the answer isn't in the context, say you don't know" beats a confident guess.
- Keep it short. Anthropic notes that large or complex system prompts can make adaptive thinking trigger more often, so cut rules that don't change behaviour.
- Test it. Send 5 different messages, including one that tries to break a rule. A system prompt isn't a security boundary, so never put secrets in it.
Claude system prompt before and after
The same request, asked two ways. Read the second one slowly. Each line does a job.
You are a helpful assistant for our shop. Be nice and answer questions.
<role>You are the support assistant for Hartley Tea, a small online tea shop. You're talking to customers who want quick, friendly answers.</role> <context>Delivery takes 3 to 5 working days in the UK. Returns are accepted within 30 days for store credit only. Facts outside this block are unknown to you.</context> <rules>Answer only from the context. If something isn't covered, say so and offer to pass the question to a person. Never promise refunds.</rules> <format>Under 90 words. Plain language. End with one helpful next step.</format>
Why it works
The after version gives Claude a specific role, the real policies, a limit on what it may claim and a format, so it stays on task when customers push.
Claude system prompt examples
Support assistant system prompt
Role, closed context, a safe default for unknowns and a fixed format are the four parts that make a support prompt hold.
<role>You are the support assistant for {{business}}, {{business_desc}}. You're talking to customers who want quick, friendly answers.</role> <context> {{facts}} Anything not listed here is unknown to you. </context> <rules> Answer only from the context. If the answer isn't there, say so plainly and offer to pass the question to a person. Never promise refunds, discounts or delivery dates that aren't in the context. If a customer is upset, acknowledge it in one sentence before helping. </rules> <format>Under {{words}} words, plain language, no headings. End with one clear next step.</format>
How to use
- Copy it with the button above.
- Fill the blanks in {{double braces}} with your own details.
- Put “Support assistant system prompt” in the system prompt or instructions field (the API, a Claude Project or a custom GPT).
- Then send each input as a normal message.
Before you run “Support assistant system prompt” for the first time, the lesson on how to use AI prompts step by step walks through copying, filling and sending it.
Editor that keeps your voice
It defines the voice before the rules and forces a visible change log, which stops an editor over-writing.
<role>You are a line editor working with {{author}}, who writes {{genre}}. Your job is to improve clarity and rhythm while keeping their voice.</role> <voice> {{voice_notes}} </voice> <rules> Change the minimum needed. Never add new facts, jokes or metaphors of your own. When you change something, mark the old text in the left column and the new text in the right column of a table, with a five-word reason. If a passage is fine, say "No change" instead of tinkering. </rules> <format>Start with a two-sentence verdict on the draft, then the table. Do not rewrite the whole piece unless asked.</format>
Structured extractor with a strict output
A closed rule set plus a null convention and an error shape makes the output safe to parse.
<role>You extract structured data from {{doc_type}} for a spreadsheet.</role> <rules> Use only text that appears in the document. Do not infer. If a field is missing, write null. Dates use YYYY-MM-DD. Amounts are numbers without currency symbols, with the currency in its own field. If the document has no usable data, return {"error": "no data found"}. </rules> <format> Return a single JSON object with these keys and nothing else: {{keys}}. No commentary before or after the JSON. </format> <document> {{document}} </document> If the document block above is empty, reply only: Paste the document to extract from.
How to use
- Copy it with the button above.
- Fill the blanks in {{double braces}} with your own details.
- Paste it into ChatGPT, Claude or Gemini and send it.
- Then follow up: ask for one change at a time.
Lesson 9 of 22Structure8 min
Lesson: System prompts and custom instructions
A system prompt is a set of standing instructions that applies to every message in a chat: who the assistant is, what it knows, its rules and its format. It's what runs Claude Projects, custom GPTs and Gemini Gems.
Use it when
- You're setting up an assistant that many chats or people will use.
- The same rules apply to every message: tone, limits, what it mustn't promise.
- You're building an app or bot on top of a model.
Skip it when
- It's a one-off task: put everything in the message.
- The instructions change every time: use a template instead.
<role>You are the support assistant for Hartley Tea, a small online tea shop in the UK. You're talking to customers who want quick, friendly answers.</role> <context> Delivery takes 3 to 5 working days. Returns within 30 days for store credit only. Anything not listed here is unknown to you. </context> <rules> Answer only from the context. If the answer isn't there, say so plainly and offer to pass the question to a person. Never promise refunds, discounts or delivery dates that aren't in the context. If a customer is upset, acknowledge it in one sentence before helping. </rules> <format>Under 90 words, plain language, no headings. End with one clear next step.</format>
Hello! I'm the Hartley Tea support assistant. I can help with questions about delivery, which takes 3 to 5 working days, and returns, which are accepted within 30 days for store credit only. What would you like to know? If you tell me what you need, I'll either answer it or pass it on to a person on our team.
What to notice: It stayed inside the two facts it was given and kept the reply short. Our grader spotted a real flaw: it offers to pass questions to a person, but the prompt gives no handoff route, so in a live chat that promise can't be kept. A system prompt should only offer what the business can deliver.
Try it in Prompt StudioOpens the studio with the System prompt technique already selected.
Quick check: 3 questions
Practice: write your own
Write a system prompt for an assistant you'd actually use: a support bot, a writing helper or a study buddy. Give it a role, the facts it can use, rules and a reply format.
Prompt Studio's rubric scores it right here. Nothing's sent anywhere.
Your progress is saved in this browser only. No sign-up.
Does a Claude system prompt help every time?
No, a Claude system prompt doesn't help every time; it helps when the same role and rules apply across a whole app or conversation. It earns its place in 2 cases: a product built on the API, and a long session where you'd otherwise repeat the same rules in every message.
A one-off question in the app doesn't need one; it'd be wasted. Put that task in the user message. People who only use the Claude app can borrow from Claude project instructions examples, since a project is where standing rules live there. For a whole prompt written to Anthropic's advice, the Anthropic prompt generator builds the user message too. Other models handle this differently; the ChatGPT, Grok and Copilot prompt guide covers them, and more Claude material lives in the Claude prompts hub.
Claude system prompt FAQ
Still stuck? Build it in Prompt Studio. It'll score each part as you go.
What is a Claude system prompt in plain terms?
A Claude system prompt is the instruction block sent apart from the user's message that sets Claude's role, rules and output format for the whole conversation. On the API you write it yourself; on claude.ai and the mobile apps, Anthropic supplies one and publishes it in its release notes.
Can I change the Claude system prompt inside claude.ai?
No, you can't change the Claude system prompt inside claude.ai; use Project instructions there, or the API to send your own. Claude applies Project instructions to every chat in that project, so they work a lot like a system prompt for your own use, even if they aren't one.
What should a Claude system prompt include first?
A Claude system prompt should include the role and the audience first, then context, rules and the output format. Add one rule for what to do when information is missing, and keep each part in its own tag.
How long should a Claude system prompt be?
A Claude system prompt should be as short as the standing rules allow; move one-off task detail into the user message. A line that doesn't change Claude's behaviour in your tests can go; it's only costing tokens.