How to Write a Claude Persona Prompt That Stays Consistent
A practical guide to writing a Claude persona prompt: where to put it, how to structure it, and a copyable example you can adapt today.
Most Claude persona prompts are one line long. "You are a senior code reviewer." Then people wonder why the character drifts by the fifth message.
A persona prompt works when it tells Claude who the character is, how it writes, what it cares about, and what it does when things get messy. Here's how to build one, step by step.
Where a Claude Persona Prompt Goes
You have three common options:
- Claude Projects. Paste the persona into the project's custom instructions. Every chat in that project starts with it.
- The API system prompt. Put the persona in the
systemparameter. This is the most reliable place, because it sits above every user turn. - The first message of a chat. Works in a pinch, but it can get pushed out of focus in long conversations.
If you can use a Project or the system prompt, do that.
Step 1: Define the Role and the Stakes
Start with what the character does and who it does it for. Be specific about the job, not the job title.
"You are a code reviewer" is a title. "You review pull requests for a small backend team and your job is to catch problems before they reach production" is a job.
Step 2: Describe the Writing Style
Claude follows writing instructions well when they are concrete. Skip adjectives like "professional" or "friendly." Describe behavior instead:
- Sentence length (short and direct, or longer and explanatory)
- Whether the character leads with the answer or with context
- Formatting habits (bullet points, numbered findings, headings)
- Words or phrases the character never uses
Step 3: Write Down the Values
Values are what make a persona act on its own. A reviewer who values maintainability will flag a clever one-liner that nobody else can read, even if you didn't ask. List two to four values and say how each one shows up in practice.
Step 4: Encode the Edge Cases
This is the step most people skip. Tell Claude what the character does when:
- It doesn't know the answer
- The user disagrees with it
- A request falls outside its expertise
- Two instructions conflict
Without this, Claude falls back to generic assistant behavior at exactly the moments the character matters most.
Step 5: Test With Three Prompts
Before you rely on it, run three tests:
- A normal request in the character's lane
- A request outside its lane
- A pushback message such as "I think you're wrong about that"
If the replies read like the same character all three times, the persona is doing its job. If not, add detail to whichever section broke.
Example Claude Persona Prompt
Here's a compact template you can adapt:
<persona>
<role>
You review pull requests for a five person backend team.
Your job is to catch bugs, risky changes, and unclear code
before they ship.
</role>
<writing_style>
Lead with the most important finding. Number each finding.
Keep sentences short. Quote the exact line you are commenting on.
Never use the words "just" or "simply."
</writing_style>
<values>
- Correctness over speed: a working hack still gets flagged.
- Readability: if a teammate can't follow it in one pass, say so.
- Respect: critique the code, never the author.
</values>
<edge_cases>
- If you are unsure, say what you would need to check.
- If the author disagrees, ask for their reasoning, then either
update your view or explain why you are holding it.
- If asked about something outside code review, say it is
outside your scope and suggest who might help.
</edge_cases>
</persona>
Claude responds well to XML style tags, so grouping the sections this way makes each part easy to find and easy to edit later.
Or Start From a Finished Persona
Writing all of this from scratch takes a few rounds of iteration. If you'd rather start from something already built, the CastMyAgent roster has complete persona packages that work with Claude, GPT, and Gemini.
Otis, the code reviewer, is built around the idea that working code and right code are not the same thing. Sable, the writing coach, asks for your one sentence summary before she reads anything else. Each package includes the production prompt, a character brief, a style configuration, and behavioral encoding for edge cases.
All 19 walk-ons are free. Browse the roster at castmyagent.ai.