CONCEPT The split: instructions live in system, data lives in the turn
The dividing line is simple. The system prompt holds the role and the
instructions — who Claude is and how it should behave, stable across the conversation. The
user turn holds the task and the data — the specific thing to do this
time and the content to do it on.
Put in system | Put in the user turn |
|---|---|
| Role / persona ("You are a legal analyst") | The specific question or command this turn |
| Standing rules & constraints ("always cite sources") | The document / code / record to operate on |
| Output-format policy that never changes | Per-request parameters (the target language, the file) |
| Stable background context | Retrieved RAG chunks, user-supplied text |
| Tone & voice guidance | Anything that changes call to call |
CONCEPT Why the split matters
- Caching. A stable
systemprefix can be cached; interleaving volatile data into it invalidates the cache on every call. - Authority & safety. Instructions in
systemcarry more standing weight than text buried in user data — keeping data in the user turn (ideally wrapped in tags, 2.5) reduces the chance that content is mistaken for instructions. - Clarity. Claude can tell the difference between "my job" and "the input" when they live in different channels, instead of one giant blended prompt.
- Reuse. One frozen system prompt serves thousands of different user inputs (this is exactly the template pattern in 2.5).
DIAGRAM Routing content to the right channel
(instructions, stable, cacheable)"] Q -->|"no: this question, this document, RAG chunk"| USR["🔵 user turn
(task + data, per-request)"] USR --> WRAP["Wrap untrusted data in tags
(<document>…</document>) — 2.5"] classDef sys fill:#d4edda,stroke:#28a745,color:#155724; classDef usr fill:#e7f0fd,stroke:#4a90d9,color:#1a3d6d; class SYS sys; class USR,WRAP usr;
CODE BAD → GOOD: instructions vs. data
The BAD version jams the role, the rules, and the data into one blended string with volatile content in
system. The GOOD version separates the stable instructions from the per-request data.
# BAD — everything blended; volatile doc & timestamp in system client.messages.create( model="claude-opus-4-8", max_tokens=1024, system=f"You are a contract analyst. It is {now}. " f"Summarize this contract: {contract_text}", # data in system → no caching messages=[{"role": "user", "content": "go"}], ) # GOOD — stable instructions in system, per-request data in the user turn client.messages.create( model="claude-opus-4-8", max_tokens=1024, system=( "You are a contract analyst. Summarize contracts in 5 bullet points, " "flag any auto-renewal clause, and cite the section for each point." ), messages=[{"role": "user", "content": ( "<contract>\n" + contract_text + "\n</contract>" # data, tagged, in the turn )}], )
TRADE-OFFS Overloading system vs. keeping it lean
✅ Lean, stable system prompt
- Cacheable prefix → cheaper, faster
- Clear instruction-vs-data boundary
- One system prompt reused across many inputs
⚠️ Everything crammed into system
- Volatile content breaks the cache every call
- Data can be misread as instructions
- Hard to reuse; hard to reason about
EXAM TRAPS
system. → Those are
data — they belong in the user turn. System is for the stable role and instructions.datetime.now(), a UUID, or a session ID into the
system prompt. → It's volatile, so it breaks prompt caching and belongs in the user turn.system,
which carries standing authority.PRACTICE
Q1 · A RAG-retrieved document chunk — system or user turn?
User turn. It's per-request data. Put the role and the "how to use retrieved context"
rules in system; put the retrieved chunk (tagged) in the user message.
Q2 · Give the one-line heuristic for the split.
If it's the same on every request → system (instructions). If it
changes per request → user turn (data). "How to behave" vs. "what to do now, on this."
Q3 · Name two problems with putting volatile data in the system prompt.
(1) It breaks prompt caching — the stable prefix changes every call. (2) It blurs instructions and data, making it easier for injected content to be treated as a command.