0014 Keep the follow-up chat in the browser, and answer it with Haiku¶
- Status: Accepted
- Date: 2026-12-05
Context¶
Phase 3 of the demo adds a chat to the feedback screen: Claude asks the questions from the draft, one at a time, and the tester answers or says what to change. A second call to Claude updates the profile from each answer, and the character sheet shows the change, with Undo.
ADR 0012 left three questions for this phase:
- Is the conversation stored, or only the profile it produces?
- How many messages does an invite code allow?
- Which model answers?
The CV is deleted after the first call (ADR 0010), so the chat must work without it. The Anthropic workspace has a USD 5 monthly spend limit, and a CV draft costs about USD 0.03.
Decision¶
The conversation stays in the browser¶
The chat goes to Anthropic like the CV did, so a line under the chat input says: "Your messages go to Anthropic, like your CV. Don't share anything you wouldn't put in a CV." The privacy notice explains it. There's no second consent box.
The conversation is never stored. It lives in the page's memory, like the draft profile. Each message sends Claude the current profile, the draft's questions, the conversation so far, and the new message. Claude answers with the updated profile, a short reply, the next question, and two or three suggested answers. The CV is never sent again.
The Worker stores one row per draft: the SHA-256 hash of a random chat token
that /api/draft hands out, a message count, and an expiry a day later.
Nothing in the row says who the tester is or what they wrote. Expired rows
are deleted at the next upload. The updated profile is stored only if the
tester signs up, as before.
Leaving the page or reloading it loses the chat and the profile, as it already does for the draft.
20 messages per profile¶
- Each draft allows 20 messages (
CHAT_MESSAGES_PER_PROFILE). A suggested answer, including Skip, counts as a message, because it asks Claude. Undo doesn't: it only restores the sheet in the browser. - An invite code allows no separate number of messages. It allows 3 drafts
(
CVS_PER_CODE), so at most 60 messages. - The day's cap on drafts (
CVS_PER_DAY, 30) also caps the chat: at most 600 messages a day. The spend limit stays the last guard. - The count goes up in one statement that fails at the limit, before Claude is called. A call that fails before Claude answers gives the message back.
Haiku answers¶
The chat uses claude-haiku-5-5 at low effort, set in
profiler/chat_prompt.json next to the CV prompt.
The comparison, for one message and for a full chat of 20, uses these estimates: about 2,000 input tokens on average (the system prompt, the profile, the questions, and a conversation that grows with each message) and about 650 output tokens (the profile, the reply, and some thinking). Haiku's tokenizer counts the same text as about 30% more tokens, which the table includes. Prices are per million input and output tokens.
| Model | Price | Per message | Full chat, 20 messages | Full chats in USD 5 |
|---|---|---|---|---|
| Sonnet 5.5 | USD 2 / 10 | about USD 0.011 | about USD 0.21 | about 23 |
| Haiku 5.5 | USD 0.10 / 0.50 | about USD 0.0007 | about USD 0.014 | about 350 |
Haiku makes a full chat cost about half a CV draft, instead of seven times one. The task suits it: small edits to a short, structured profile, with the JSON schema fixing the answer's shape and the Worker checking every field. The CV draft stays on Sonnet, because reading a whole CV well matters more.
Consequences¶
- No transcript exists anywhere WFHeaven controls, so there's nothing to delete, export, or leak. Anthropic keeps each request for up to 30 days, as for the CV, and doesn't train on it.
- The browser sends the profile, so a tester could edit it before sending. That only changes their own profile. The Worker cleans it the same way as Claude's answer, limits its size, and only the fields on the sheet can change.
- Claude sees the conversation only as the browser sends it: the last 40 turns, each up to 1,000 characters.
- These estimates aren't measured. After the deploy, check the usage in the Claude Console and the Worker's CPU time for a chat message.
- Risk: Haiku's answers are too weak, for example it changes phrases it
wasn't asked to change, or picks title phrases that match few jobs. The
maintainer checks the answers' quality with a fictional CV after the
deploy, before inviting testers. Fallback: switching to Sonnet is one
line: set
modelinprofiler/chat_prompt.jsontoclaude-sonnet-5-5. A full chat then costs about USD 0.21, so raise the spend limit or lower the message limit. - Haiku has no server-side fallback for refusals. A declined message shows an error, goes back into the input box, and stays counted.