What Is a System Prompt?

A system prompt is a set of instructions you give Claude before the conversation starts. It defines who Claude is, how it should behave, what it should focus on, and what it should avoid — for the entire interaction. Think of it as the difference between hiring a general contractor and hiring a specialist. Without a system prompt, Claude is a general assistant. With one, Claude becomes exactly what your application needs.

Where It Lives in the Request

The system prompt is passed as a top-level system field — separate from the messages array:
This separation is intentional. The system field is architecturally distinct from the conversation, it is processed before any user message and persists across every turn.

What a System Prompt Can Do

Define a Role

The most common use case. Give Claude a specific identity and expertise:

Control Tone and Style

Shape how Claude communicates:

Limit Scope

Prevent Claude from going off-topic:

Control Output Format

Make Claude return structured, predictable output:

Set Length Constraints

Control how much Claude writes:

Real Test Results

The same user message — “What is a webhook?” — was sent with two different system prompts. The results show how dramatically the system prompt shapes the response. Fintech assistant system prompt:
Response:
“A webhook is a way for one system to automatically notify another system when a specific event happens, by sending an HTTP POST request to a URL you provide. For example, a payment processor might send a webhook to your server the moment a transaction is completed, so you don’t have to constantly poll for updates. Think of it as a push notification for your server.”
Pirate system prompt:
Response:
“Arrr, gather ‘round me hearties, and I’ll tell ye about this here webhook! A webhook be like a messenger pirate that automatically sails from one ship to another when somethin’ important happens!”
Same question. Same model. Entirely different responses. The system prompt is the only variable.

Writing Effective System Prompts

Be Specific About the Role

Vague roles produce vague behavior. The more specific you are, the more predictable Claude’s responses become.

Include Examples of Good Responses

Claude follows examples well. If you want a specific response format, show it:

Specify What NOT to Do

Negative instructions are as important as positive ones:

Test With Edge Cases

After writing a system prompt, test it with questions it was not designed for. How Claude handles out-of-scope questions reveals whether your scope instructions are working correctly.

Token Considerations

The system prompt counts as input tokens on every request: For high-volume applications, keep your system prompt as concise as possible. Every token in the system prompt is paid for on every single request.
Test your system prompt at its minimum viable length. Start with the shortest version that produces the behavior you want, then add detail only where the output breaks down.

What System Prompts Cannot Do

System prompts shape behavior — they do not override Claude’s core values.
  • Claude will not produce harmful content regardless of system prompt instructions
  • Claude will not impersonate real individuals in ways that could cause harm
  • Claude will not bypass its safety guidelines based on system prompt framing
A system prompt that attempts to instruct Claude to act against its guidelines will not produce the intended behavior. Design your system prompts around what Claude can do — not around trying to change what it will not do.

System Prompts Across Multi-turn Conversations

The system prompt persists across every turn in a conversation automatically — you do not need to repeat it in each message. It is processed once at the top level and applies to the entire interaction.
Claude applies the system prompt to every turn including the third message, without you having to include it again.

Further Reading

System Prompt API Reference

Interactive playground for testing system prompts

Multi-turn Conversation

How system prompts persist across conversation turns

Tool Use

Combine system prompts with tools for focused AI agents

Tokens

How system prompt length affects input token costs