Build a Smart CV / Resume Analyser with Claude API

What Does This CV Analyser Do?
This project builds a CV analyser that accepts PDF or plain-text CVs, extracts structured candidate data using Claude's tool use API (name, skills, years of experience, education), scores the candidate against a provided job description across four dimensions, and outputs a plain-English hiring recommendation with identified strengths and gaps — all in under 100 lines of Python.
Hiring teams review dozens to hundreds of CVs for every open role. Reading each one thoroughly takes time, and the most qualified candidates can be buried under a stack of applications. An AI-powered CV analyser automates the extraction and scoring phase — freeing recruiters to focus their energy on the candidates that actually match.
This project builds a complete CV analyser that takes a PDF or plain-text CV as input, extracts structured candidate data, scores the candidate against a provided job description, and generates a plain-English hiring recommendation. The full implementation runs in under 100 lines of Python and is production-ready with minor additions.
What We Are Building
The CV analyser does three things:
- Extracts structured data from the CV: name, email, years of experience, current role, skills, education, and employment history
- Scores the candidate against a job description on five dimensions: technical skills match, experience level, domain relevance, education requirement, and seniority alignment
- Generates a hiring recommendation: a plain-English paragraph explaining whether to interview the candidate and why
Prerequisites
- Python 3.9 or later
- Anthropic Python SDK: pip install anthropic
- For PDF support: pip install pypdf2 or pip install pymupdf
- An Anthropic API key set as ANTHROPIC_API_KEY
Project Architecture
The system has three components:
- CV ingestion: Reads the CV file (PDF or text) and prepares the content for Claude
- Structured extraction: Uses Claude with tool use to extract typed fields from the CV content
- Scoring and recommendation: Uses Claude to score and explain the match against the job description
Complete Implementation
Extending the Project
- Batch processing: Add a loop to process an entire folder of CVs and produce a ranked shortlist using the Batch API for 50% cost savings
- Web interface: Wrap the analyser in a FastAPI or Flask endpoint that accepts file uploads and returns JSON analysis results
- Database integration: Store extracted candidate data and scores in PostgreSQL for filtering, searching, and tracking candidates across multiple roles
- Files API: For high-volume environments, upload CV PDFs via the Files API to avoid re-uploading the same document when analysing against multiple job descriptions
Use tool_choice: tool for Reliable Extraction
The scoring and extraction steps both use tool_choice: {type: 'tool', name: ...} to force Claude to produce structured output every time. This is more reliable than asking Claude to return JSON in the message text, because the tool use mechanism enforces the schema. Combined with Python's jsonschema library for post-extraction validation, this pattern produces highly consistent structured output across diverse CV formats.
Summary
This project demonstrates the three-step pattern that underlies most document-processing AI applications: ingest → extract → analyse. The same approach applies to processing contracts, financial statements, technical specifications, and any other structured document type.
- Extraction: Use tool_choice to guarantee structured JSON output from any document
- Scoring: Let Claude apply business logic — matching against requirements, identifying gaps — that would be complex to code manually
- Recommendation: Let Claude generate the natural language reasoning that explains its structured scores
Next project: Project: Build a Customer Support Chatbot with Claude API.
For the structured output concepts used in this project, see Claude Structured Outputs and JSON and Claude Tool Use Explained. For processing PDF CVs via the Files API, see Claude Files API Tutorial and Claude Vision, Images, and PDF Analysis.
External Resources
- Anthropic Tool Use documentation — the official reference for the structured extraction schema used in this project.
- PyMuPDF documentation — the recommended library for extracting text from PDF CVs in Python.
This post is part of the Anthropic AI Tutorial Series. Previous post: AI Agents Refresher: Key Concepts, Patterns, and Pitfalls.
