CONCEPT The opening word sets the trajectory
Format prefills (6.2) seed a syntax. Steering prefills seed a direction. Because Claude continues from your text, the first word or phrase biases everything after it — the tone, the stance, the voice. Start the assistant turn with a persona tag and the reply stays in that persona; start it with a decisive first word and the reply commits instead of hedging.
| You want | Prefill | What it nudges |
|---|---|---|
| Stay in a persona | [Sherlock]: | Response continues in that character's voice |
| A committed verdict | The answer is | Forces a direct claim, not "It depends…" |
| Continue a script/dialogue | Narrator: | Keeps the established turn-taking format |
| A specific opening stance | Yes — | Commits to an affirmative framing |
[Sherlock]: — the character is entered from
token one, so there's no slip into a neutral assistant voice at the start.CONCEPT Steering nudges, it doesn't override
A prefill biases the continuation; it does not silence Claude's judgment. Prefilling Yes —
strongly steers toward an affirmative, but on a question where "yes" is wrong or unsafe, the model can still
walk it back in the following sentence. Treat steering prefills as a strong nudge on direction,
not a hard lock — for a hard lock on shape you want format prefills (6.2) or stop sequences (6.4).
DIAGRAM Persona prefill keeps the voice from drifting
'Elementary — the clay is from Hampstead...'"] P -->|"no prefill"| DRIFT["Response may open neutrally:
'As an assistant, the boots suggest...'"] INCHAR --> STAY["Voice locked from token one"] DRIFT -.->|"needs stronger framing"| STAY classDef ok fill:#d4edda,stroke:#28a745,color:#155724; classDef gate fill:#ffe8cc,stroke:#ff9f40,color:#9a4a0a; class INCHAR ok; class STAY ok; class DRIFT gate;
CODE A persona-steering prefill
import anthropic client = anthropic.Anthropic() resp = client.messages.create( model="claude-opus-4-5", max_tokens=200, system="You are Sherlock Holmes. Deduce sharply and stay in character.", messages=[ {"role": "user", "content": "What do you make of the muddy boots?"}, {"role": "assistant", "content": "[Sherlock]:"}, # ← steer + lock the voice ], ) # The reply continues the character from the first token. reply = "[Sherlock]:" + resp.content[0].text # prepend prefill for the full line print(reply)
:, not a space. A prefill must not end
with trailing whitespace — "[Sherlock]: " would be rejected. Full rule in 6.5.TRADE-OFFS System-prompt persona vs. persona prefill
✅ System prompt (Cluster 2)
- Persists across the whole conversation
- Survives on all current models (no 400)
- Best for durable role & rules
✅ Persona prefill (this page)
- Locks the opening of a single reply
- Prevents a neutral-voice slip at the start
- But: last-turn only, legacy models only (6.5)
EXAM TRAPS
"Bot: "). → Prefills
cannot end in trailing whitespace; end on the last non-space character (6.5).PRACTICE
Q1 · How does a persona prefill differ from setting the persona in the system prompt?
The system prompt declares the role across the whole conversation but the reply can still
open in a neutral voice. A prefill like [Sherlock]: makes the specific reply begin in
character from the first token, eliminating the opening drift. On legacy models they're complementary.
Q2 · Does prefilling Yes — guarantee an affirmative answer?
No — it's a strong directional nudge, not a lock. Claude will usually continue affirmatively, but on a question where "yes" is wrong it can still qualify or reverse in the following text. Steering biases the trajectory; it doesn't override the model's judgment.
Q3 · Why is prefilling to bypass refusals a bad pattern today?
Modern models refuse appropriately, so it's unnecessary, and using prefill to override
safety behavior is discouraged. Clear prompting in the user turn achieves legitimate steering
without putting words in the model's mouth to sidestep guardrails.