No history yet

Role-Based Prompt Engineering

Putting Claude on Your Hiring Team

You already know how to talk to a large language model. Now, let's learn how to give it a job. For complex tasks like talent acquisition, treating the AI as a general-purpose assistant isn't enough. To get expert-level results, you need to turn it into a specialist. This is done through a technique called role prompting.

Role prompting is more than just a clever trick; it frames the model's entire response. By telling Claude to act as a specific persona, like a senior technical recruiter or a diversity sourcing specialist, you're loading it with a specific context, vocabulary, and set of priorities. A generic prompt might just match keywords between a resume and a job description. A role-prompted AI, however, will start to think like a seasoned professional.

For example, instructing Claude to “Act as a headhunter for executive-level SaaS sales roles” will produce drastically different and more insightful candidate analyses than simply asking it to “review this resume for a sales job.”

Lesson image

Structuring Data with XML

Recruiting involves juggling multiple pieces of information: job descriptions, resumes, screening notes, and success criteria. Simply pasting all this text into a prompt window creates a confusing mess for both you and the AI. Anthropic's models, like Claude, are exceptionally good at parsing prompts structured with XML tags. This lets you create a clean, organized, and machine-readable input.

Think of these tags as labeled folders. You put the job description in a <job_description> folder and the candidate's resume in a <candidate_resume> folder. This separation makes it crystal clear to the AI what each piece of information represents. It reduces ambiguity and helps the model focus on the relationships between the different documents.

<prompt>
  <role>
    Act as a senior technical recruiter with 10 years of experience hiring for backend engineering roles at FAANG companies. You are skeptical, detail-oriented, and value demonstrable impact over buzzwords.
  </role>

  <job_description>
    Position: Senior Backend Engineer (Payments)
    - 5+ years of experience with distributed systems.
    - Proficiency in Go or Java.
    - Experience with high-throughput, low-latency APIs.
    - Must have led a project from design to deployment.
  </job_description>

  <candidate_resume>
    Jane Doe - Software Engineer
    ...[rest of resume]...
  </candidate_resume>

  <instructions>
    Please review the candidate's resume against the job description. Provide your analysis.
  </instructions>
</prompt>

Forcing the AI to Think

The biggest risk in using AI for screening is that it might make snap judgments based on superficial keyword matching. To prevent this, we use a technique called Chain of Thought. Instead of just asking for a final verdict, you instruct the AI to reason through its evaluation step-by-step. This forces a more deliberate and transparent analysis.

By adding instructions like "First, identify the core requirements from the job description. Second, find evidence for each requirement in the candidate's resume. Third, note any gaps or red flags. Finally, provide a summary recommendation and a confidence score," you are guiding the model's analytical process. This makes the output more trustworthy and allows you to see why the AI reached its conclusion. It's the difference between getting a 'yes' or 'no' and getting a detailed hiring committee memo.

Teaching by Example

Sometimes, the best way to explain what you want is to show it. This is the idea behind few-shot prompting. In this technique, you provide the AI with one or more examples of a high-quality input and its corresponding desired output before giving it the new task. This is incredibly powerful for calibrating the model to your specific standards and nuanced requirements.

For recruiting, you could provide the profile of a past successful hire and the analysis you want the AI to emulate. By providing a template for what 'good' looks like, you dramatically increase the chances that the AI's output for new candidates will match your expectations in tone, structure, and depth of insight. It's like giving a junior recruiter an example of a great candidate write-up to follow.

<prompt>
  <role>...</role>
  <job_description>...</job_description>

  <!-- Example 1: The 'Ideal' Candidate -->
  <example>
    <candidate_resume>
      [Resume of a perfect past hire]
    </candidate_resume>
    <analysis>
      [Your ideal, high-quality analysis of this perfect hire]
    </analysis>
  </example>

  <!-- The New Candidate to Evaluate -->
  <candidate_resume>
    [Resume of the new candidate]
  </candidate_resume>

  <instructions>
    Following the format and reasoning in the example, analyze the new candidate's resume against the job description. Use Chain of Thought reasoning.
  </instructions>
</prompt>

Now that you've seen the core techniques, it's time to put them to the test.

Quiz Questions 1/5

When using an LLM for a complex task like recruiting, what is the main purpose of giving it a specific persona, such as 'Act as a senior technical recruiter'?

Quiz Questions 2/5

What is the primary benefit of structuring a prompt with XML tags like <job_description> and <candidate_resume>?