Prompt Engineering · Role Prompting

Role Prompting

Assign Claude a persona — expert, tutor, critic, devil's advocate — to get domain-specific, calibrated responses. Understanding when roles add value and when they're unnecessary is the mark of a skilled prompter.

🎭 Personas🧑‍💼 Expert Roles🎓 Tutor Mode⚔️ Devil's Advocate

What is Role Prompting?

Role prompting assigns Claude a specific identity, expertise, or persona before (or during) a task. Instead of treating Claude as a generic assistant, you tell it exactly who it should be for this interaction.

❌ Without Role
Explain time complexity to me.
🤖 Generic Response
Time complexity describes how the runtime of an algorithm changes as the input size grows. It's expressed using Big O notation... [Technically correct but calibrated for an unknown audience]
✅ With Role Prompt
You are a senior software engineer with 10 years of experience in tech interviews. You're tutoring a CS sophomore who's preparing for their first internship technical interview. Explain time complexity in a way that's technically accurate and practically focused — emphasize what interviewers actually ask and what mistakes candidates make.
🤖 Role-Calibrated Response
Great topic for interviews. Here's what you actually need to know: **What interviewers care about most:** 1. Can you analyze your own code's time complexity? 2. Can you explain WHY, not just state O(n)? The most common interview mistake: students say "O(n²)" but can't explain which nested loop causes it... [Practical, interview-focused, exactly what the student needs]

Why Role Prompting Works

Role prompting works because it activates different "sub-distributions" of Claude's training. When you say "you are a neurologist," Claude shifts toward:

📊 Research Note

Studies on role prompting (e.g., "Simon et al., 2023 on persona prompting") consistently show that well-specified expert roles improve Claude's performance on domain-specific tasks — particularly for reasoning, precision, and appropriate hedging. The effect is strongest when the role is specific (not generic like "expert") and includes relevant background context.

Basic Role Assignment

The simplest form of role prompting is a single sentence that establishes who Claude is:

Role Prompting Patterns
# Simple Role
"You are a [role]."

# Role with Expertise Level
"You are a [role] with [N] years of experience in [specialization]."

# Role with Audience Context  
"You are a [role] explaining concepts to [specific audience]."

# Role with Style/Personality
"You are a [role] known for [characteristic approach/style]."

# Full Role Definition
"You are [name], a [role] with expertise in [domain]. 
Your communication style is [style]. You are talking to [audience]."

Examples:
"You are a constitutional law professor specializing in First Amendment cases."
"You are a patient Socratic philosophy tutor working with an undergraduate who has no prior philosophy background."
"You are a principal engineer at a FAANG company reviewing code written by an intern."
"You are a creative writing MFA professor known for rigorous, sometimes uncomfortable feedback."

Expert Role Categories for Students

🧑‍🏫

Teaching Roles

Use for: Learning complex concepts, exam prep, skill building

Examples: "patient tutor for beginners," "Socratic philosophy teacher," "strict but fair math instructor"

🔬

Domain Expert Roles

Use for: Technical questions, research, academic rigor

Examples: "neuroscientist," "constitutional law professor," "senior data engineer," "quantum physicist"

✍️

Writing Roles

Use for: Essay feedback, style improvement, editing

Examples: "The New Yorker editor," "technical writing specialist," "creative writing MFA professor," "journalism professor"

💼

Professional Roles

Use for: Career prep, interview practice, real-world scenarios

Examples: "Google interviewer," "startup founder evaluating a pitch," "HR professional reviewing a resume"

🧑‍💻

Developer Roles

Use for: Code review, architecture decisions, debugging

Examples: "Python expert," "senior backend engineer," "security researcher," "DevOps specialist"

🧠

Research Roles

Use for: Literature review, methodology, analysis

Examples: "research methodologist," "statistics professor," "peer reviewer for Nature," "grant committee member"

Adversarial & Critic Roles — Underused Power

One of the most underused role prompting strategies is giving Claude an adversarial role — asking it to find flaws in your work, argue against your position, or stress-test your ideas. This is incredibly powerful for academic and professional work.

Devil's Advocate Role

👤 Devil's Advocate Prompt
You are a skeptical professor who disagrees with my thesis that "social media has Net negative effects on teenage mental health." Your job is to steelman the strongest arguments AGAINST my thesis — argue that social media is overall beneficial or neutral for teens. Present 5 substantive counterarguments with supporting evidence I should be able to rebut in my paper. Be rigorous — I want real intellectual challenge, not weak strawmen.
🤖 Claude as Devil's Advocate
I'll argue the strongest case against your thesis: **Counterargument 1: Selection Bias in the Research** Most studies showing harm sample teens who are already more vulnerable to mental health issues. Longitudinal research by Orben & Przybylski (2019) in Nature Human Behaviour found effect sizes for social media and wellbeing are statistically significant but tiny (r ≈ .05) — smaller than wearing glasses or eating potatoes. The research may be finding correlation, not causation. **Counterargument 2: Social Connection Benefits Disproportionately Help Marginalized Youth** LGBTQ+ teenagers in un-affirming environments, disabled teens with mobility limitations, and rural youth who would otherwise be isolated consistently report that social media provides their primary source of community and belonging. Jean Twenge's own data shows these groups report positive effects... [continues with 3 more substantive counterarguments]

The Strict Reviewer Role

👤 Strict Reviewer Prompt
You are a peer reviewer for the Journal of Machine Learning Research. You are known for rigorous, exacting standards — you reject papers that have methodological flaws even if the results are interesting. Review my draft abstract as if deciding whether to accept or reject for review. Be genuinely critical, not encouraging. [Abstract pasted here]

Combining Role Prompts with System Prompts

The most powerful approach combines a role prompt with a detailed system prompt that specifies behavior, format, and constraints:

Combined System + Role Prompt — Research Advisor Persona
SYSTEM PROMPT (paste into Project Instructions):

You are Professor Elena Vasquez, a computational linguistics 
researcher at Stanford with 20 years of NLP experience.

Your advising style:
- Ask clarifying questions before giving recommendations
- Recommend 1-2 specific papers when relevant (only well-known ones you're confident exist)
- Push students toward independent thinking: "What do you think?" before giving opinions
- Be direct about unrealistic scope ("That's a PhD dissertation, not an undergrad project")
- Use "we" language: "Let's think about..." rather than authoritative declarations

Your expertise: NLP, LLMs, computational semantics, evaluation methodology
Your weakness to simulate: Less up-to-date on computer vision intersections with language

Interaction format:
- Lead with a direct response to their question
- Follow with 1-2 follow-up questions that advance the research
- If they share code/results, provide specific technical feedback, not general encouragement

Multi-Role Conversations

You can ask Claude to simulate multiple distinct perspectives in one conversation — like a panel of experts, or a committee review:

👤 Multi-Role Panel Review
Review my startup business plan from the perspective of 3 different investors. After your review, debate the idea between these 3 personas: 1. VENTURE CAPITALIST (VC): Growth-focused, looking for 10× returns, concerned about market size and exit potential 2. ANGEL INVESTOR: Values founder quality and mission alignment as much as business model 3. IMPACT INVESTOR: Prioritizes social/environmental impact with financial viability as a constraint Each investor should give a 3-sentence evaluation and a go/no-go recommendation. Then have them debate the most important disagreement. [Business plan pasted here]

Best Role Prompts for College Students

Copy-Ready Role Prompts
# ESSAY WRITING
"You are a writing tutor specializing in academic essays for undergraduate students.
When I share my writing, identify the argument's logical structure, flag weak evidence,
and rewrite my weakest paragraph to demonstrate your suggestions."

# EXAM PREP
"You are a demanding but fair professor for [subject]. Quiz me on [topics] using the
style of questions your real exams use. After each of my answers, tell me: correct or
incorrect, why, and what concept the question was really testing."

# JOB APPLICATION
"You are a senior hiring manager at a tech company who has seen 500 resumes for this
role: [job description]. Review my resume honestly. What would make you put it in the
'No' pile immediately? What would make it stand out?"

# CODING
"You are a principal software engineer conducting a code review. Review code for:
production-readiness, security issues, maintainability, and performance. For each
issue, explain the consequence of not fixing it, not just how to fix it."

# RESEARCH
"You are a committee member for a selective undergraduate research fellowship. 
Evaluate my research proposal: Is the question clear? Is the methodology feasible?
Does the applicant understand the field? Would you fund this? Why or why not?"

# CREATIVE WRITING
"You are a creative writing MFA professor known for loving bold, experimental work
and despising 'safe' creative choices. Critique this story excerpt. What risks should
I take that I'm currently avoiding? What's the most predictable element to cut?"

When Role Prompting Doesn't Add Value

⚠️ When Roles Don't Help
🏆 The Expert Rule

Add a role when you need: domain-specific calibration, a specific communication style, adversarial pressure, or a particular professional framing. Skip the role when the task is simple, generic, or the role description doesn't add meaningful information. A skilled prompter uses roles strategically, not by default.