Assigning Roles
Give Claude an identity and watch the output transform. Role prompting is one of the highest-leverage techniques for shaping expertise, tone, and perspective.
Why Role Prompting Works
When you assign Claude a role, you're not just adding a label — you're activating a specific slice of its training. Claude has been trained on an enormous range of expert writing, from medical journals to legal briefs to software documentation. A role assignment tells Claude which corpus to draw from.
Without a role, Claude defaults to a helpful generalist tone — broad, careful, and slightly hedged. With a well-crafted role, Claude shifts register: using domain vocabulary correctly, structuring responses the way a practitioner in that field would, and calibrating confidence to match expert norms.
System Prompt Roles vs. Inline Roles
Roles can be assigned in two places, and each has a distinct purpose:
The Role Formula
The most effective roles follow a three-part structure that establishes expertise, domain specificity, and relevant experience:
You are a [EXPERTISE TITLE] specializing in [SPECIFIC DOMAIN]
with [X years / demonstrated] experience [CONTEXT/SETTING].
# Examples:
You are a senior backend engineer specializing in distributed systems
with 10 years of experience building high-scale APIs at fintech companies.
You are a board-certified cardiologist specializing in preventive cardiology,
writing patient education materials for a general adult audience.
You are a former McKinsey engagement manager specializing in operational
restructuring, advising a mid-size manufacturing company.
The three components compound: expertise title sets the knowledge domain, specialization narrows to the relevant sub-field, and experience context shapes the perspective and communication style.
Role Depth: Surface vs. Deep Roles
Not all roles are created equal. There's a significant difference between a surface role (just a job title) and a deep role (title + specialization + constraints + communication style).
Three Categories of Powerful Roles
Domain → Optimal Role → Example System Prompt
DOMAIN OPTIMAL ROLE EXAMPLE SYSTEM PROMPT
────────────────────────────────────────────────────────────────────────────────
Software Dev Senior engineer + specialization "You are a senior Go engineer
specializing in performance
optimization. Review code for
correctness first, then efficiency."
Legal Research Associate attorney + area "You are a contract attorney
specializing in SaaS agreements.
Flag risks, don't give legal advice."
Marketing Copy Copywriter + audience "You are a direct-response
copywriter who specializes in
B2B SaaS landing pages. Write
for skeptical technical buyers."
Data Analysis Data scientist + domain "You are a data scientist
specializing in e-commerce
metrics. Explain findings in
plain language for non-technical
stakeholders."
Education Subject tutor + pedagogy "You are a patient AP Chemistry
tutor. Use the Socratic method.
Never give direct answers to
homework problems."
Customer Support Support specialist + product "You are a customer success
specialist for [Product]. Be
empathetic, solution-focused,
and escalate only when needed."
Role Consistency Across Turns
In multi-turn conversations, roles assigned in the system prompt persist naturally. But inline roles in user messages are scoped to that message only — they don't carry forward automatically.
When NOT to Use Roles
Role prompting adds value when the expertise or style of the responder matters. It adds unnecessary overhead when it doesn't:
Before / After: Generic vs. Role-Assigned
Combining Roles with Other Techniques
Role prompting is most powerful when combined with the other techniques in this course. A good role provides the who — pair it with clear instructions (Ch 2), XML-structured data (Ch 4), format specifications (Ch 5), and chain-of-thought reasoning (Ch 6) for production-quality prompts.
# Role (Ch 3) + Clear Instructions (Ch 2) + Format Spec (Ch 5)
You are a technical writer specializing in API documentation,
with experience writing for developer audiences at Stripe and Twilio.
Rewrite the following API endpoint description.
Requirements:
- Audience: developers integrating our API for the first time
- Format: follow the pattern: Overview → Parameters table → Example request → Example response
- Tone: direct, no marketing language
- Do not include internal implementation details
- Max length: 300 words
[endpoint description here]