thinkhard.SI

Prompt repository Research & learning

Code qualitative data against your codebook and count the codes

You have transcripts, notes or open-ended answers and a codebook, and need each passage coded consistently, with counts you can trust.

Registry no.
RES-027
Collection
Research & learning
Laid out for
Claude
Score
10 out of 10
Blanks to fill
5
Added

Research & learningClaude

The prompt

Score 10 of 10, Excellent

Use it when You have transcripts, notes or open-ended answers and a codebook, and need each passage coded consistently, with counts you can trust.

  • {{codebook}}
  • {{data}}
  • {{research_question}}
  • {{data_description}}
  • {{audience}}
Full prompt and why it works
System prompt
You are a careful qualitative researcher who applies a codebook consistently. You code only what the text says, quote the passage behind every code, and report where the codebook does not fit the data.
User message
<codebook>
{{codebook}}
</codebook>

<data>
{{data}}
</data>

<study>
Research question: {{research_question}}
What the data is and how it was collected: {{data_description}}
</study>

Code the data above against the codebook, for {{audience}}, so that the counts and quotes can go into the analysis without anyone recoding from scratch. If the data has no IDs for each participant or response, give each one an ID in the order given, such as P1, P2.

Produce:
1. Coded passages: a table with the columns Participant or response ID, Passage (quoted, under 40 words), Code or codes, Note (only where the coding was a judgment call).
2. Code counts: a table with the columns Code, Passages, Distinct participants, with the participants listed by ID.
3. Codebook fit: passages that relate to the research question but fit no code, grouped into suggested new codes with a one-line definition each, and codes that no passage used.
4. Hard calls: up to 8 passages where two codes could apply or a definition was unclear, each with the codes considered and the one chosen, so a second coder can check them.

<example>
The form of one row: "P4 | 'I only open the dashboard when my manager asks for the numbers' | Low engagement; External trigger | Fits two codes."
</example>

Apply each code by its definition in the codebook, not by the code's name, because names are shorthand and the definitions are what the team agreed. A passage may carry more than one code. Count a participant once per code however often they say it, so one talkative person does not look like a pattern. Do not summarize themes, explain why people said what they said, or put codes that are not in the codebook into the main table; new codes go in section 3 only. If a passage is too short or ambiguous to code, leave it uncoded and list it in section 4 rather than guessing. A good result is one a second coder could repeat and mostly agree with.

Variables

{{codebook}}
Your codebook: each code with its definition and, if you have them, inclusion and exclusion rules.
{{data}}
The transcripts, notes or open-ended answers, labeled by participant or response where possible.
{{research_question}}
The question the coding serves, in one sentence.
{{data_description}}
What the data is, for example "12 semi-structured interviews with ward nurses, transcribed".
{{audience}}
Who will use the coded data, for example "me and my second coder" or "the research team".

Why it works

  • What good looks like. Codes are applied by their definitions, and each participant counts once per code, so one talkative person does not look like a pattern.
  • What to avoid. New codes stay in a separate section instead of creeping into the main table, so the codebook remains the agreement.
  • If unsure. Ambiguous passages are left uncoded and listed as hard calls for a second coder to check.

How to use it

  1. Press Fill in variables and type your details into each blank. What you type stays in this browser.
  2. Copy the filled prompt into the AI tool you already use, such as ChatGPT, Claude or Gemini, or open it in the Grader or the Prompt Tester here.
  3. Before you rely on it, try it on three or four real examples. The Prompt Tester runs them all at once and shows which ones go wrong.
Use it from code

Get this prompt as JSON from the free REST API, with your own text in the blanks, or let an AI assistant fetch it through the MCP server. No key.

curl -s https://thinkhard.si/api/v1/prompts/qualitative-coding-with-codebook

With the MCP server added to Claude, ChatGPT, Cursor or VS Code, call get_prompt with {"prompt": "qualitative-coding-with-codebook"}, or just ask for it by name.