System Prompts in Claude
Before you type a single word, Claude may already have received a set of standing instructions. These are called system prompts. This guide explains what they are, how Claude's own apps use them, how developers write their own, and how to keep them safe and effective.
Think about a new employee on the first morning of a job. Before any customer walks in, the manager hands over a short briefing: who you are in this role, how we speak to customers, what we can and cannot promise, and where to find today’s information. When customers arrive, the employee already knows how to behave. The customers never see that briefing, but they feel its effect in every conversation. A system prompt is that briefing for Claude. It is a set of standing instructions given before the conversation begins, and it shapes how Claude behaves throughout. Understanding it helps you understand why Claude sometimes behaves differently in different products, and how to build your own assistant with a consistent personality and clear rules.
1What Is a System Prompt?
A system prompt is a set of instructions given to Claude at the start, before the actual conversation.
When you talk to Claude, you send messages, and Claude replies. But in many products, there is also a hidden layer of instructions that is placed at the start of every conversation. This is the system prompt. It does not come from the person chatting. It comes from whoever set up the product. It tells Claude things such as what role to play, what tone to use, what rules to follow, and what background information to keep in mind.
The system prompt and the messages from the user work together. The system prompt is like the stage setting and the actor’s briefing. The user’s messages are the lines of the play that unfold on that stage. The same actor, Claude, can perform very differently depending on the briefing it received, which is one reason Claude can power a friendly study buddy in one app and a formal legal research assistant in another.
Imagine an actor who can play many parts. Before the curtain rises, the director whispers the role: “Tonight you are a patient teacher, speak gently, and never give out the answer straight away.” The audience never hears the whisper, but they see its effect on every line. The system prompt is the director’s whisper.
flowchart TD
A["System prompt: role, rules, background"] --> D["Claude reads everything together"]
B["Earlier messages in the conversation"] --> D
C["The user's latest message"] --> D
D --> E["Claude writes the reply"]
Anthropic’s prompt engineering documentation has a page on giving Claude a role with a system prompt, and its release notes publish the system prompts used in Claude’s own apps. Details change, so those pages are the best places to confirm current information.
2Key Terms You Need First
A few simple words appear again and again in this topic. Here they are in plain English.
System prompt
Standing instructions given to Claude before a conversation begins, usually set by the person or company running the product.
User message
What the person using the product types during the conversation.
Role prompting
Giving Claude a role, such as “a careful financial analyst”, so its answers take on that focus and style.
Persona
A character or personality style that Claude adopts, such as a friendly tutor or a formal advisor.
Constraint
A rule that limits what Claude should do, such as “only discuss topics about our products”.
Operator
The company or developer who builds a product on Claude and writes its system prompt.
API
The programming interface that developers use to build Claude into their own software.
Prompt leak
When a system prompt’s contents are revealed to users, whether the author wanted that or not.
3System Prompts in Claude’s Own Apps
The Claude chat apps use a system prompt too, and Anthropic publishes it.
Anthropic’s release notes explain that Claude’s web interface and mobile apps use a system prompt to give Claude up-to-date information at the start of every conversation, such as the current date. The prompt also encourages certain behaviors, for example always providing code snippets in a clear, formatted way. Anthropic says this prompt is updated periodically as it improves Claude’s responses.
Anthropic has also made a point of publishing these app system prompts, in a release notes section of its documentation, along with a log of changes. This was a notable move toward transparency, because it lets anyone see what instructions shape Claude’s behavior in the apps. The release notes make an important clarification: these system prompt updates apply to the Claude apps and do not apply to the Claude API.
Current information
Provides things Claude cannot know on its own, such as today’s date.
Helpful habits
Encourages useful behavior, such as presenting code in a readable format.
Product guidance
Helps Claude know about the product it is running in and where to find official documentation.
Quick adjustments
Lets Anthropic tweak behavior between model updates without retraining.
The app system prompts do not apply to the API. A developer calling Claude through the API starts without Anthropic’s app instructions, and writes their own system prompt to shape behavior.
4Why System Prompts Matter
They give an assistant a consistent character and clear boundaries.
Without a system prompt, Claude is a general assistant that responds to each message as best it can. That is fine for open-ended chat. But a business or a developer usually wants something more specific: an assistant that always sounds like the brand, stays on topic, uses the right format, and knows the right background. A system prompt provides that consistency, so the assistant behaves the same way for every user, without anyone having to repeat instructions.
Consistent role and tone
A learning app can make Claude a patient, encouraging tutor every time. A legal tool can make it a careful, formal reviewer.
Clear boundaries
A customer helper can be told to stay on the topic of the company’s products, and to say so politely when a question is outside its area.
Background knowledge
The prompt can include policies, product facts, or style rules that Claude should use in its answers.
Output format
It can require answers in a certain structure, such as short paragraphs, a table, or labeled sections, so other software can use the results.
5Role Prompting: The Most Powerful Use
Giving Claude a clear role is the best-known way to use a system prompt.
Anthropic’s documentation says that when using Claude, you can improve its performance by using the system parameter to give it a role. It calls this technique role prompting, and describes it as the most powerful way to use system prompts with Claude. The right role, it says, can turn Claude from a general assistant into a virtual domain expert. The documentation lists benefits: improved accuracy in complex areas such as legal analysis or financial modeling, a tailored tone, such as a CFO’s brevity or a copywriter’s flair, and improved focus, because the role keeps Claude within the bounds of your task.
| Without a role | With a role |
|---|---|
| General, balanced answers that may skip specialist concerns | Answers that look for the issues a specialist would care about |
| A neutral tone | A tone matched to the role, such as brisk and numbers-focused or warm and patient |
| May drift to many topics | Stays closer to the job described |
A simple role, in plain words
“You are a patient mathematics tutor for high-school students. Explain ideas step by step, use everyday examples, and ask one short question at the end to check understanding.”
A more focused role
“You are a careful contract reviewer. Read the contract provided, list any clauses that create financial risk, and explain each in plain language.”
Anthropic’s prompting guide notes that setting a role in the system prompt focuses Claude’s behavior and tone, and that even a single sentence makes a difference. Start simple, and add detail where you see a need.
6What a Good System Prompt Contains
Strong system prompts tend to cover a handful of clear ingredients.
The role
Who Claude is in this product, and what job it does, in a sentence or two.
The audience and goal
Who it is talking to and what a good outcome looks like, such as beginners who need simple explanations.
Tone and style
How it should sound: friendly, formal, concise, or detailed.
Rules and boundaries
What it should always do, what it should never do, and what to do when a request is out of scope.
Background information
Policies, facts, or definitions Claude should rely on, kept accurate and up to date.
Output format
The shape of the answer, such as length limits or required sections.
What to do when unsure
Instructions for uncertainty, such as saying “I am not sure” and suggesting where to get a definite answer.
Anthropic’s prompting guidance recommends separating different kinds of content with consistent, descriptive tags, such as one for instructions and another for background, so Claude does not mix them up. This works well in system prompts that have several parts.
7System Prompt vs User Message: What Goes Where?
Deciding where an instruction belongs makes prompts cleaner and easier to maintain.
One practical question for builders is whether an instruction belongs in the system prompt or in the user’s message. Anthropic’s earlier guidance put it simply: use the system parameter to set Claude’s role, and put the rest, such as task-specific instructions, in the user turn. A helpful way to think about it is that the system prompt holds what stays the same in every conversation, and the user message holds what changes each time.
| Content | Best home | Why |
|---|---|---|
| Role and persona | System prompt | It stays the same in every conversation |
| Permanent rules and boundaries | System prompt | They should apply to every user |
| Standing background such as policies | System prompt | Used repeatedly, and easy to update in one place |
| The specific question or task | User message | It changes each time |
| The document to analyze this time | User message | It differs with each request |
| Examples tied to one particular task | User message, or the system prompt if used everywhere | Depends on whether they are reused |
flowchart TD
A["An instruction"] --> B{"Is it the same in every conversation?"}
B -- "Yes" --> C["Put it in the system prompt"]
B -- "No, it changes each time" --> D["Put it in the user message"]
Prompting advice changes as models improve. Treat this as a starting rule, and check the current prompting best practices page in the documentation.
8Writing Clear Instructions
A system prompt is read again and again, so every sentence should earn its place.
Be specific
“Keep answers under 120 words” is clearer than “be brief”.
Say what to do, not only what to avoid
Positive instructions are easier to follow than long lists of prohibitions.
Give reasons
“Avoid jargon because our users are beginners” helps Claude handle situations you did not foresee.
Keep it organized
Group related instructions and use clear labels, so nothing is buried.
Avoid contradictions
If two instructions pull in opposite directions, Claude has to guess which matters more. State priorities clearly.
Include examples when style matters
A sample of an ideal answer often communicates more than a paragraph of description.
Do not overdo personality
For practical assistants, a clear professional role usually works better than an elaborate character backstory.
Keep it as short as the job allows
Long, rambling prompts bury the important rules and use more of the context window.
9Building Your Own: A Step-by-Step Approach
A good system prompt is built through testing, not guessing.
Define what success looks like
Write down what a good answer is, and a few examples of questions it must handle well, including difficult ones.
Write a first draft
Start with a role, the audience, tone, key rules, and format. Even a rough draft is fine.
Test with realistic questions
Try it on typical questions, awkward ones, and attempts to push it off topic. The Claude Console has tools for trying prompts and evaluating results.
Find the failures
Note where answers go wrong: wrong tone, off-topic replies, missing details, or broken format.
Adjust one thing at a time
Change a single instruction, and test again. This shows which change helped.
Keep a record
Save versions and notes about why each change was made, so you can roll back or learn from them.
Keep testing after launch
Watch real conversations, collect failures, and improve the prompt over time. Models and needs change.
Anthropic’s documentation mentions prompting tools in the Claude Console, such as a prompt generator for a first draft and an evaluation tool for testing, which can help you get started.
10System Prompts and Safety
A system prompt shapes Claude’s behavior, but it works within limits.
A system prompt can set a role, a tone, and rules. It cannot make Claude drop its core principles. Claude is built to follow reasonable instructions from the people who set up a product, while still declining requests that would cause serious harm, deceive users in damaging ways, or break its basic guidelines. A system prompt telling Claude to ignore its safety behavior will not work, and it is not a good design goal.
Shape role, tone, and focus
Define the job, the style, and the topics Claude should cover.
Restrict scope
Keep Claude on the product’s subject, and politely decline unrelated requests.
Override safety behavior
Instructions that ask Claude to act harmfully or deceive users in damaging ways are not followed.
Guarantee perfect obedience
Claude may still occasionally miss or misread an instruction, so testing matters.
If a mistake would be serious, add checks outside the prompt, such as human review, input and output filtering, and limits on what connected tools may do.
11Keeping Secrets Out of System Prompts
Assume a determined user could find out what your system prompt says.
System prompts are not a safe vault. Users sometimes try to trick an assistant into revealing its instructions, which is called prompt leaking. Anthropic’s documentation includes a page on reducing prompt leak, among its guidance for strengthening guardrails. The safest approach is to assume that anything in the system prompt could eventually be seen, and to avoid putting anything there that would cause harm if it were exposed.
Never include passwords or keys
Access keys, tokens, and credentials do not belong in a prompt. Keep them in secure systems.
Avoid private business details
Do not place sensitive internal information in the prompt unless you accept the risk that it might be revealed.
Do not rely on “never reveal this”
A request to keep instructions secret may reduce leaks, but it is not a guarantee.
Protect real data with real controls
Use access controls and secure storage for anything that must stay private.
A good test is whether you would be comfortable if your system prompt were published. If not, move the sensitive part elsewhere.
12Cousins of the System Prompt in the Claude Apps
Everyday users have their own ways of giving Claude standing instructions.
You do not have to be a developer to benefit from the same idea. Claude’s apps offer ways for ordinary users to set standing instructions, which work much like a personal system prompt. These are not literally the same thing as the developer’s system prompt, but they play a similar role.
| Feature | Who sets it | What it does |
|---|---|---|
| Anthropic’s app system prompt | Anthropic | Gives Claude basics such as the date and helpful habits in its own apps |
| Profile preferences | You | Standing notes about you that apply across your chats |
| Project instructions | You or your team | Instructions that apply to every chat in one project |
| Styles | You | Shape how replies are written and formatted |
| Developer system prompt | The developer | Defines the role and rules of an app built with the API |
| Project instruction file in Claude Code | The engineering team | Standing notes about a software project, read at the start of every session |
flowchart TD
A["Anthropic's own instructions in its apps"] --> E["Claude's behavior in a conversation"]
B["Your profile preferences and styles"] --> E
C["Project instructions"] --> E
D["Your messages"] --> E
Writing clear, specific, well-organized instructions helps in all of these places. Learning to write a good system prompt makes you better at writing profile preferences and project instructions too.
13A Worked Example: A Study Helper
Let us follow an imagined developer named Sana as she builds a study helper for school students.
She defines success
Sana decides that a good answer is clear, encouraging, and does not simply hand over homework answers. She lists twenty sample student questions, including tricky ones.
She writes a first draft
“You are a friendly study helper for students aged 12 to 16. Explain ideas step by step with everyday examples. When a student asks for a homework answer, guide them with hints and questions first.”
She tests and finds a problem
In testing, the helper gives full answers when students insist. She adds a clear rule about when it may reveal an answer, with a short reason.
She sets boundaries
She adds instructions to stay on school subjects, to use gentle, age-appropriate language, and to suggest talking to a teacher or parent for anything serious or personal.
She keeps secrets out
She checks that the prompt contains no keys or private details, and keeps her access credentials in secure settings.
She launches carefully and keeps learning
She starts with a small group, reviews real conversations, saves each version of the prompt with notes, and improves it over time.
Sana followed the full recipe: define success, draft, test, adjust one thing at a time, protect secrets, and keep improving. The system prompt became a living piece of the product, not a one-time guess.
14Mistakes to Avoid
Most system prompt problems come from a few avoidable habits.
Problem
Writing a very long system prompt that tries to cover every imaginable situation.
Why It’s Harmful
Important rules are buried, contradictions creep in, and the prompt uses up space that could hold the conversation.
Correct Approach
Keep it focused. Add rules only when testing shows a real need.
Problem
Giving vague instructions such as “be helpful and professional”.
Why It’s Harmful
Claude already tries to be helpful. Vague words give it nothing specific to follow, so the behavior stays generic.
Correct Approach
Describe the exact behavior wanted, with numbers, formats, and examples.
Problem
Putting passwords, keys, or confidential data inside the prompt.
Why It’s Harmful
System prompts can leak, and anything inside could be exposed.
Correct Approach
Keep secrets in secure systems, and write prompts you would be comfortable seeing published.
Problem
Changing the prompt without testing, or changing many things at once.
Why It’s Harmful
You cannot tell what helped or hurt, and you may break behavior that used to work.
Correct Approach
Test against a fixed set of examples, change one thing at a time, and keep versions.
Problem
Relying on the system prompt as the only safety measure.
Why It’s Harmful
Prompts can be misread or tricked, and serious risks need more than instructions.
Correct Approach
Add human review, filtering, and technical limits for anything high stakes.
Problem
Instructing the assistant to hide that it is an AI, or to mislead users in ways that harm them.
Why It’s Harmful
It damages trust, can cause real harm, and is not something Claude will follow when it works against users’ basic interests.
Correct Approach
Be honest with users, and shape the assistant’s role without deceiving the people who depend on it.
15Advantages and Trade-offs
System prompts are a simple, powerful tool with limits.
Advantages
- Gives an assistant a consistent role, tone, and boundaries
- Easy to write and change, with no retraining needed
- Lets one model serve many different products and needs
- Saves users from repeating instructions every time
- Keeps standing rules and background in one place
Disadvantages / Trade-offs
- Not a guarantee, since Claude can occasionally miss or misread instructions
- Can leak, so it is a poor place for secrets
- Long prompts use context window space and can bury key rules
- Needs testing and maintenance as models and needs change
- Cannot override Claude’s safety principles
16Best Practices at a Glance
A checklist to keep beside you while you write.
Start with a clear role
Even one sentence helps, and you can add detail as testing shows a need.
Put stable things in the system prompt
Role, rules, and standing background go in the system prompt, while the changing task goes in the user message.
Be specific and organized
Use clear labels, concrete limits, and examples where style matters.
Explain your reasons
A short reason helps Claude handle cases you did not foresee.
Test before and after launch
Use realistic and tricky questions, change one thing at a time, and keep versions.
Keep secrets out
Write as if the prompt could be read by anyone.
Add safeguards outside the prompt
Use human review and technical limits for important outputs.
Stay honest with users
Shape the role without deceiving the people who use your product.
17Frequently Asked Questions
Quick answers to the questions beginners ask most often.
A set of standing instructions given to Claude before a conversation begins, usually written by whoever builds or runs the product. It shapes the role, tone, rules, and background that Claude uses.
Yes. Anthropic’s release notes explain that the web and mobile apps use a system prompt to provide information such as the current date and to encourage helpful behaviors, and Anthropic publishes these prompts and logs their changes.
No. Anthropic states that the system prompt updates for its apps do not apply to the API. Developers write their own system prompts.
Giving Claude a role in the system prompt, such as a careful analyst or a patient tutor. Anthropic describes it as the most powerful way to use system prompts, improving focus, tone, and, in complex areas, accuracy.
Stable things such as role, rules, and standing background belong in the system prompt. The specific question, document, or task that changes each time belongs in the user message.
As short as the job allows. Start simple, and add rules only when testing shows they are needed. Long, rambling prompts bury important rules.
No. A system prompt can shape role, tone, and scope, but it cannot override Claude’s core principles and safety behavior.
Not normally, but they may try to trick the assistant into revealing it. Assume it could leak, and keep passwords and confidential details out of it.
Test it on realistic and tricky questions, compare against your definition of a good answer, change one thing at a time, and keep monitoring real conversations after launch.
Yes. Profile preferences, project instructions, and styles in the Claude apps work like personal standing instructions, and the same advice about clarity and specificity applies.
They help when the prompt has several kinds of content. Anthropic’s guidance recommends consistent, descriptive tags to keep instructions, background, and inputs from being mixed up.
In Anthropic’s prompting best practices and role prompting pages, the Console prompting tools, the guidance on strengthening guardrails, and the system prompt release notes.
18Summary and Key Takeaways
A system prompt is a set of standing instructions that Claude receives before a conversation begins, shaping its role, tone, rules, and background. Anthropic’s own apps use one, publish it, and log its changes, but those updates do not apply to the API, where developers write their own. Role prompting is the best-known use, and Anthropic says even a single sentence can focus Claude’s behavior. A good system prompt is specific, organized, and short enough to stay clear, holds the things that stay the same in every conversation, and is built by testing and adjusting one change at a time. It cannot override Claude’s safety principles, it can leak, so it is no place for secrets, and it should be backed by other safeguards where mistakes would be serious. Everyday users can use the same idea through preferences, project instructions, and styles.
Key Takeaways
- A system prompt is a standing briefing — instructions given before the conversation that shape Claude’s role, tone, rules, and background.
- Claude’s apps use one, and Anthropic publishes it — those app prompts provide basics like the date and helpful habits, and they do not apply to the API.
- Role prompting is powerful — even one sentence can focus Claude’s behavior, and clear roles improve tone, focus, and accuracy in specialist areas.
- Put stable things in the system prompt — role, rules, and standing background go there, and the changing task goes in the user message.
- Write clearly and test often — be specific, organize with labels, give reasons, change one thing at a time, and keep monitoring after launch.
- Prompts can leak, so keep secrets out — never put passwords, keys, or confidential data in a system prompt.
- It works within Claude’s safety limits — it cannot override core principles, so add human review and technical safeguards for serious risks, and stay honest with users.