System, User & Assistant Roles
- The three roles every AI conversation is built from — and what each one is for
- Why the system prompt is the single highest-leverage place to steer behavior
- How the same idea appears in chat apps, Claude Code, and the API
- A common trap: burying rules in a user turn instead of the system message
Every AI conversation is built from messages, and each message has a role. Understanding the three roles explains how to steer the model — and why some instructions stick while others don't.
The three roles
- Top-level setup for the whole conversation: who the model should be, the rules, the output format. Set once, applies to every turn that follows.
- Your questions and inputs, one turn at a time. Keep these focused on the actual task; don't re-paste the standing rules every turn.
- The model's responses. You can also put words in the assistant's mouth as few-shot examples (see /docs/prompting/few-shot) — the model treats them as prior turns and continues in that style.
Why the system prompt is your most powerful lever
The system message frames everything that follows. It's where you set the model's role, standards, tone, and hard rules — and the model weights it heavily. If you want consistent behavior across a whole conversation (or app), put it here, not buried in a user turn.
Same idea, three surfaces:
| Surface | What plays the system-prompt role |
|---|---|
| Chat apps (Claude.ai, ChatGPT, Gemini) | Your account custom instructions |
| Claude Code | CLAUDE.md at the project root |
| The API | The system parameter on the request (first call) |
A worked before/after
The most common mistake is putting the standing rules into every user turn instead of the system message. Watch what changes.
Before — rules jammed into a user turn, repeated every time:
Rules in the user turn (fragile)
user: You are a precise financial analyst. Always show your assumptions. Never invent numbers. Now: summarize this 10-K. [10-K text]
After — rules hoisted to the system message, user turns stay clean:
Rules in the system message (durable)
system: You are a precise financial analyst. Always show your assumptions. Never invent numbers. Cite the section of the filing for each claim. user: Summarize this 10-K. [10-K text] user: Now flag the risks.
The "after" version keeps behavior stable across turns, halves the tokens you resend each turn, and makes the app easier to change — you edit the standing brief in one place.
Putting words in the assistant's mouth
An underused move: you can prepend an assistant turn as a few-shot example or a format primer, and the model will continue in that style. This is how templates and rubrics get enforced without a big prompt.
Prime the assistant to follow a format
system: You are a code reviewer. Return only the sections below. user: Review this pull request. [diff] assistant: ## Summary - ## Risks - ## Suggested changes -
The model treats your seeded assistant turn as a prior response and completes into the same shape.
Common mistakes
- Rules in every user turn — put standing rules once in the system message; use user turns for the actual task.
- Contradicting yourself across turns — a later, explicit user instruction can override a vague system one. Be consistent.
- Treating the assistant role as read-only — you can seed it to prime format, tone, or a few-shot pattern.
- Overloading the system prompt with facts that change — put volatile facts (docs, data, current state) into the user turn or retrieval context, not the system message.
Check yourself
Check yourself
0/4- Three roles: system sets the brief, user asks per-turn, assistant replies (or is seeded).
- The system prompt is the highest-leverage lever — put standing rules there once.
- Chat custom instructions, CLAUDE.md, and the API `system` field are the same idea on three surfaces.
- Volatile facts belong in user turns or retrieval, not the system message.