Lesson

Setting a Persona or Role

When you open a fresh chat, Claude is a highly intelligent, polite, generic assistant. But sometimes, a generic assistant isn't what you need.

If you ask a generic assistant to review your code, it will say "Looks good! Here are a few minor tweaks."

If you ask a Principal Engineer who is famous for being utterly ruthless about performance to review your code, they will tear it apart and force you to rewrite it.

You can force Claude to become that Principal Engineer by assigning it a Persona.

The "Act As..." Prompt

This is one of the oldest and most effective prompt engineering techniques. By simply telling the AI who it is before giving it the task, you radically shift the vocabulary, tone, and focus of the output.

Prompt:

"Act as a grumpy but brilliant Senior Security Architect. Review this authentication flow code. Assume I am a junior developer who makes amateur mistakes. Do not hold back, point out every single security flaw, and use technical terminology."

When you use a prompt like this, Claude sheds its polite, helpful default tone. It will actively look for edge cases, SQL injections, and race conditions that the "generic" Claude might gloss over to avoid overwhelming you.

Tailoring the Output to the Audience

Personas aren't just for changing the AI's personality; they are crucial for defining who the AI is speaking to.

If you need to write an email to the non-technical CEO explaining why the servers crashed, you don't want Claude explaining the intricacies of the Node.js event loop.

Prompt:

"Act as the VP of Engineering. Write an incident report for the CEO regarding yesterday's 2-hour downtime. The CEO has an MBA but no technical background. Keep the tone professional, reassuring, and focus entirely on business impact and the timeline to resolution. Do not use technical jargon."

Roleplaying Complex Scenarios

You can also use personas to simulate real-world interactions. If you are preparing for a system design interview, you can have Claude roleplay the interviewer.

Prompt:

"Act as a Staff Software Engineer at Google conducting a system design interview. I am the candidate. Ask me how I would design Twitter. Ask me one question at a time. Challenge my design decisions regarding scaling and database sharding. Wait for my response before asking the next question."

By setting the persona, you dictate the entire context of the conversation, ensuring you get exactly the level of rigor you need.

Ready to test your understanding? Take the quiz to reinforce what you learned.

© 2026 Ant Skillsv.26.07.07-23:01