Open-ended survey response coding with a reusable codebook
Builds a codebook from free-text survey answers, codes every response, and reports theme counts with representative quotes. You can reuse the codebook on the next survey so results stay comparable.
Prompt in Research by AISkillHub Library
What it does
Free-text survey answers ("What is the one thing we should improve?") are often the most useful part of a survey and the least analysed. This prompt does a first pass of qualitative coding: it proposes a codebook with definitions, applies it to every response, counts themes, and pulls representative quotes. Because the codebook is written out explicitly, you can review it, edit it, and reuse it next quarter so the trend is comparable.
**Use it when** you have roughly 30 to 300 free-text responses to one question, such as NPS follow-ups, churn surveys, event feedback or employee pulse comments. For larger sets, run it in batches with the same codebook.
**What you get** - A codebook: code name, definition, include and exclude rules, and an example response. - A coded table with response ID, the codes applied (a response can have more than one), and sentiment. - Theme counts and the share of responses, sorted by frequency. - Two or three representative quotes per theme. - Responses that were uncodable or ambiguous, listed for human review.
**Two modes** - `build`: create a new codebook from the responses. - `apply`: use a codebook you paste in, adding new codes only when responses clearly do not fit, and marking them as new.
**What it will not do** - It will not report statistical significance or extrapolate to people who did not respond. - It will not drop responses because they are short, off-topic or negative; these are coded or listed for review. - Counting by hand in a chat is error-prone for large sets. If your chat has a code execution or data analysis tool, the prompt asks the model to use it to tally the coded table. Otherwise, spot-check the counts.
How to use it
## How to use
1. Open `prompts/open-ended-survey-coding.md` and copy everything below the title line. 2. Replace each `{{variable}}` with your own content. Paste long material (notes, transcripts, tables) directly in place of the variable; keep the surrounding tags so the model can tell inputs apart. 3. Start a new chat in ChatGPT, Claude or Gemini and paste the filled prompt as your first message. 4. Read the output against the quality checks at the end of the prompt before you use or send it.
## Variables
- `{{question}}`: the exact survey question asked. - `{{responses}}`: the responses, one per line, each starting with an ID like `R1:`. Remove names and emails. - `{{mode}}`: `build` or `apply`. - `{{existing_codebook}}`: your previous codebook if mode is `apply`; otherwise `none`. - `{{context}}`: who answered and when, e.g. `customers who cancelled in Q3`.
If you do not have a value for an optional variable, write `none` rather than deleting it, so the prompt still reads correctly.
## Reusing it
To reuse it often, save the prompt (with the variables left in) as the instructions of a Claude Project, a custom GPT or a Gemini Gem, then paste only the inputs in each new chat.
Files
Save each file at the path shown, relative to your project root.