Skip to content

0010 Draft profiles from CVs with the Claude API

  • Status: Accepted
  • Date: 2026-12-05

Context

Milestone 2 lets people upload a CV instead of writing a profile file by hand. Today's only profile, profiles/gergely.yaml, took several rounds of tuning against real daily emails. A new user needs a good first draft, and needs to know what the draft got wrong.

A CV is free text in many layouts. Turning it into weighted job-title phrases, skills, languages, exclusions, and years of experience needs judgment: which past roles are the roles the person wants next, which seniority words to exclude, and which tools to treat as skills. Rules can't do that reliably; a language model can, if a person checks the result.

The daily ranker stays rule-based and doesn't use AI (ADR 0005). This decision is about one step, once per CV.

Options considered

Option For Against
No AI: the person fills in a form No cost, no data leaves WFHeaven Slow, and people pick titles as they'd say them, not as job ads write them
Rules: match the CV's words against lists of titles and skills No cost, predictable Can't tell past roles from wanted roles, or read seniority; needs a list for every field of work
A local open model The CV stays on the computer Needs a GPU or a slow run, weaker results, and a model to maintain
The Claude API, one call per CV Good judgment on free text; reads PDFs directly; structured output Costs a few cents per CV; the CV goes to Anthropic

Decision

Use the Claude API, once per CV, to draft a profile that the person reviews. Start with a local prototype, profiler/cv_to_profile.py, that runs on the maintainer's computer and isn't part of the daily workflow.

One call. The script sends the CV and a fixed prompt. Structured outputs (output_config.format with a JSON schema) make the answer a draft profile, 3 to 8 remarks on the CV, and 3 to 5 clarifying questions. The script turns the draft into YAML in the layout of profiles/*.yaml and checks it with the profile rules the ranker uses before saving it. A draft that breaks a rule isn't saved.

What the person decides. The draft leaves can_work_from and min_salary_usd_per_year empty and sets ai_training to the default, because a CV can't answer them. These choices belong to the person.

Model. claude-sonnet-5-5 by default, and --model chooses another. Sonnet is the middle tier: the task needs judgment, but it's a single, short call that doesn't need the most capable model. Server-side fallbacks are turned on for models that support them, so if a model declines a request, the API retries it on another model in the same call.

Input. A PDF is sent as a PDF document, so the script needs no PDF library and Claude reads the layout too. A .docx file is read with the standard library, and a .txt file as it is.

Software. The script uses Anthropic's official Python SDK, which handles retries and typed errors. It's listed in a separate requirements-profiler.txt, and imported only when the script calls the API, so the daily run and the tests don't need it.

Cost per CV

Prices from Anthropic's pricing page, read on 2026-12-05, in USD per million tokens:

Model Input Output
Claude Haiku 5.5 0.10 0.50
Claude Sonnet 5.5 (default) 2 10
Claude Opus 5.5 4 20

The PDF documentation says each page uses 1,500 to 3,000 text tokens, plus up to 1,568 tokens for the page image. A two-page CV and the prompt are roughly 5,000 to 10,000 input tokens. The answer, including Claude's thinking, is roughly 2,000 to 4,000 output tokens.

  • Estimate: USD 0.03 to 0.06 per CV with Sonnet 5.5.
  • Measured on the maintainer's CV, a PDF, on 2026-12-05: 6,344 input and 2,165 output tokens, about USD 0.034.

With Opus 5.5, the same CV would cost about twice as much. With Haiku 5.5, it would cost well under a cent, if its drafts are good enough, which hasn't been tested.

Privacy

What Anthropic's own pages say, read on 2026-12-05:

  • Training. Inputs and outputs of commercial products, including the API, aren't used to train models by default. The exceptions are feedback that a person sends, and data a customer explicitly allows Anthropic to use (Is my data used for model training?, updated 2026-08-18). The API data retention page says retained data is never used for training without express permission.
  • Retention. The privacy center says Anthropic deletes API inputs and outputs from its back end within 30 days (How long do you store my organization's data?, updated 2026-07-01). The API documentation says conversation content isn't retained by default, except for the Covered Models, which require 30 days. Sonnet 5.5 isn't a Covered Model. Because the two pages differ, WFHeaven assumes the longer one: up to 30 days.
  • Exceptions. Requests flagged by Anthropic's trust and safety systems can be kept for up to 2 years, and data can be kept longer where the law requires it.
  • Structured outputs cache only the JSON schema, for up to 24 hours. The schema contains no CV data.
  • Zero data retention is a separate agreement with Anthropic's sales team. WFHeaven doesn't have one.

What WFHeaven does with the CV:

  • The CV must be in private/, which git ignores. A pre-commit hook and a test block CVs, .env, and anything in private/ from the repository.
  • The CV's text is held in memory for the one call, and never written to disk. The outputs hold the draft profile, remarks, and questions only. The prompt tells Claude to leave names, contact details, employers, and other personal data out of the profile.
  • In the prototype, the CV is the maintainer's own file, so the script doesn't delete it: it reminds the maintainer to. In Milestone 2, the uploaded copy is deleted as soon as the profile is built, as the privacy page says.
  • The API key is read from the ANTHROPIC_API_KEY environment variable, or from the git-ignored .env file. The script never prints it.

Consequences

  • A person gets a first profile in under a minute, for a few cents, with a list of what to check.
  • The draft varies from run to run. A person must review it, and the comparison report shows where it differs from a hand-made profile.
  • The first comparison, with the maintainer's CV, found 7 of the 11 target titles in profiles/gergely.yaml, and the same experience years. It missed titles the CV doesn't show, such as help center and support content, and added staff to exclude_seniority. The hand-made profile leaves staff out on purpose, because of titles such as Staff Writer (Rank jobs). The prompt now says that staff signals seniority only in engineering titles, and suggests entry-level among the boost levels, which the draft had left out. The rule checks can't catch choices like that one; the person's review can.
  • The reference profile isn't a target to tune the prompt toward. It holds career choices a CV can't show, such as wanting help center roles, or languages kept for a bonus at a basic level. Only general mistakes, ones that would be wrong for anyone, become prompt changes.
  • The CV leaves WFHeaven's computers once, for Anthropic. The privacy page names Anthropic as the AI provider.
  • requirements-profiler.txt adds the anthropic package for the prototype only.

Open questions

  • In Milestone 2, where does the call run: in the profile service, with the key as a server secret? Answered in ADR 0011: in a Cloudflare Worker, with the key as a Worker secret, in its own Anthropic workspace.
  • Is Haiku 5.5 good enough? Compare its drafts with Sonnet's on a few fictional CVs before choosing.
  • Should a second call turn the person's answers to the questions into an updated profile?