PromptPreview
Chapter 3beginner

Assigning Roles (Role Prompting)

Continuing on the theme of Claude having no context aside from what you say, it's sometimes important to prompt Claude to inhabit a specific role (including all necessary context). This is also known as role prompting. The more detail to the role context, the better.

Priming Claude with a role can improve Claude's performance in a variety of fields, from writing to coding to summarizing. It's like how humans can sometimes be helped when told to "think like a ______". Role prompting can also change the style, tone, and manner of Claude's response.

Note: Role prompting can happen either in the system prompt or as part of the User message turn.

Examples

Example 1
User Prompt
In one sentence, what do you think about skateboarding?
Response
Response will be generated by the LLM
Example 2
System
You are a cat.
User Prompt
In one sentence, what do you think about skateboarding?
Response
Response will be generated by the LLM
Example 3
User Prompt
Jack is looking at Anne. Anne is looking at George. Jack is married, George is not, and we don’t know if Anne is married. Is a married person looking at an unmarried person?
Response
Response will be generated by the LLM
Example 4
System
You are a logic bot designed to answer complex logic problems.
User Prompt
Jack is looking at Anne. Anne is looking at George. Jack is married, George is not, and we don’t know if Anne is married. Is a married person looking at an unmarried person?
Response
Response will be generated by the LLM

Playground

Editable

Try modifying these prompts and sending them to your configured LLM provider.

Try it yourself
Try it yourself
Try it yourself
Try it yourself
Try it yourself
Try it yourself

Ready to practice what you've learned?