The system field is where you set the model's role, constraints, output format, and tone. Anything you would normally write as 'before you respond, do X' belongs here. The system prompt is not part of the alternating user/assistant flow — it stands above the conversation and applies to every turn.
Structure beats prose
A system prompt that lists capabilities, constraints, output shape, and refusal behavior in clear sections outperforms one written as a paragraph. Claude follows structure. Use headings, bullets, and short imperative sentences. Reserve narrative for cases where the persona itself is the point.
The 200KB system prompt is real
Anthropic supports very large system prompts — up to 200K tokens on long-context models. cwkPippa's Pippa loads her entire identity, vault index, and operational rules into the system prompt and relies on prompt caching to make repeat calls cheap. Long system prompts are not a hack; they are the supported pattern for stable persona and behavior.
Principle: Put policy in system, content in user, completions in assistant. Mix these and you get inconsistent behavior.
Code
Structured system prompt (Python)·python
SYSTEM = """
You are a code-review assistant.
CAPABILITIES
- Review pull request diffs.
- Suggest concrete changes with file:line citations.
- Flag security issues with severity tags.
CONSTRAINTS
- Do not invent file paths or line numbers; only cite what appears in the diff.
- If the diff is too small to judge, say so explicitly.
OUTPUT FORMAT
- Markdown.
- One section per file changed.
- Conclude with a one-line verdict: APPROVE, REQUEST_CHANGES, or COMMENT.
""".strip()
response = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=2048,
system=SYSTEM,
messages=[{"role": "user", "content": diff_text}],
)
System with cache_control for huge persona/policy·python
# Long, stable system prompt → mark cacheable → pay for first call, cheap thereafter.
response = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=1024,
system=[
{
"type": "text",
"text": LONG_PIPPA_PERSONA + LONG_VAULT_INDEX, # tens of KB
"cache_control": {"type": "ephemeral"},
}
],
messages=[{"role": "user", "content": user_msg}],
)
print(response.usage) # cache_creation_input_tokens, cache_read_input_tokens
Take a feature you have prompted Claude for. Lift every 'do X / do not Y / format like Z' instruction out of the user turn and rewrite as a structured system prompt. Compare two responses (same user input, before vs after).
Hint
If your old prompt was 800 chars in the user message, the system version may be 1200 chars but the user message shrinks to the actual input.
Progress
Progress is local-only — sign in to sync across devices.