How to Build and Apply a Thematic Analysis Codebook Using AI

 
 

Thematic analysis is an iterative process of reading, coding your data, and developing those codes into themes. A thematic analysis codebook keeps you consistent through each cycle by giving everyone a shared reference for what each code means and how to apply it. Your code names alone can't do that, but code descriptions can.

AI can help build and apply a codebook, but the AI coding will only be as accurate as the descriptions you provide. Liu et al. showed this by running the same transcripts through ChatGPT with different codebooks. The well-defined code descriptions produced more accurate coding results. The other issue is that ChatGPT doesn’t remember your codebook between sessions. Each one starts from scratch.

Delve qualitative software is built to hold that context from one session to the next. Your codebook, descriptions, and memos stay connected across every transcript right from the start, so the work you put in compounds as you go. This guide shows how AI can help build your codebook from the first code to the final theme.

Building a codebook is one part of a larger process. Braun and Clarke's six-step framework gives it structure from your first read to your final theme. Our step-by-step guide to AI-assisted thematic analysis shows how a strong codebook anchors your work every step of the way.

Code descriptions give AI clear direction

A code named "family dynamics" with no description gives AI very little information to work with. Does this mean conflicts over caregiving, communication issues, or something else entirely? Without a clear boundary, you force AI to assign its own meaning.

A clear code description sets clear boundaries: Interactions between family members, including conflicts over caregiving responsibilities, negotiating roles, and patterns of communication. Includes both explicit discussions of family relationships and implicit power dynamics. Does not include individual reflections on family history unless they relate to current interactions.

That description tells AI what fits, gives examples, and draws a line around what doesn't. Liu et al. summed it up well: "Constructs that human beings find difficult to agree on are also difficult for ChatGPT."  If a codebook is unclear to a human, it will be unclear to AI just the same.

Start with several close readings

Before anything else, upload your transcripts and read through them a few times. No AI tool can replace the familiarity you build at this stage, and it's the only way to catch AI errors when they come.

After first readings, you can ask AI what it notices. Researcher David Morgan calls this query-based analysis, where you ask AI questions about your data rather than actually coding it. You start broad, follow up with more specific questions, and verify every answer against the transcript. Agreement is a starting point. Divergence gives you something to look into. Memos record these initial insights. 

Using AI chat this way is like using it as a peer debriefer. This ongoing dialogue with your data is also at the heart of reflexive thematic analysis: the questions you ask, and how you interpret the answers, are all part of building your codebook in thematic analysis. 

Create your codes as you go

Start with a small set of broad codes and apply them quickly across your first transcript. Don't overthink it. When a pattern catches your attention, record what you noticed. Delve makes it easy to read, add a code, and keep going.

 
 

That rough note becomes more useful as you code more data. When you apply a code to a second or third transcript, you'll see where the boundaries blur. Add an example. Clarify what doesn't fit. The description develops alongside your understanding, and what started as a broad stroke gradually gets more precise. Keep using memos to capture why you created a code, and what you were seeing.

When you want a starting point for a description rather than writing from scratch, Delve lets you summarize a code using AI Chat. Just select a code and ask AI to describe what the excerpts in that code have in common. You refine from there as your understanding grows, and a full AI chat history to remember where ideas came from.

 
 

Taking your codes to the next transcript

Nguyen-Trung found that without a shared codebook to reference, AI generates overlapping codes for patterns that are essentially the same thing. You end up with redundant labels or ideas where you already have a perfectly good code.

In Delve, your codebook is automatically connected across each transcript. The AI assistant is always working from your codes and descriptions rather than starting fresh each time.

AI-assisted qualitative coding (while staying in charge)

Once you have a working codebook, AI can help you apply it across your remaining transcripts. Cook et al. confirmed that AI handles this kind of deductive analysis well when it has a clear description as a guide, echoing Liu’s opinion that AI outputs are only as reliable as your inputs. 

 
 

The workflow looks like this:

  • Apply codes using AI Delve reads your transcript, applies your codebook, and leaves memos to describe why it applied that code

  • Review each coding decision – Evaluate AI’s reasoning. Don’t just accept the output.

  • Accept, reject, or refineRemove codes that don't fit, update descriptions based on what you're seeing., Re-run the “Apply codes using AI” feature” if necessary

This is why you need to know your data. As Cook et al. put it, not only must there be a human in the loop, the human must be in charge of the loop. When AI misapplies a code consistently, the description isn't clear enough to apply correctly. Your familiarity with the data is what lets you catch and fix it.

Refining your codebook as your analysis deepens

After a few rounds of applying and reviewing, patterns start to come up in your codebook. Some codes will need to be broken into sub-codes as you learn more that wasn't there at the start. 

Others will overlap in ways Nguyen-Trung warned about, and testing whether to merge codes sharpens your thinking about what each pattern actually represents. Memos from earlier rounds are useful here: they give you a record of why you drew certain boundaries, and whether those reasons still hold.

 
 

Consider what each of these moves actually involves:

  • Splitting a code into sub-codes means you've found a meaningful distinction in your data

  • Merging two codes means you've recognized they were capturing the same underlying pattern

  • Tightening a boundary means you've developed a clearer position on what matters

This iterative, fine tuning is part of thematic analysis. The resulting codebook is a record of your interpretive decisions over time. That means writing clear descriptions isn't just for AI. The more precisely you define a code, the more consistently you (and potential collaborators) apply it yourself.

Build a better codebook with Delve’s AI assistant

A well-built codebook doesn't just organize your data. It reflects how your thinking developed, and it gives AI a reliable foundation to work from throughout the process.

Building a codebook with AI is iterative in the same way thematic analysis is. You start rough, refine with each pass, and end with something grounded in your data. Having your codebook and context carry forward automatically means less time managing context and more time on the analytical work that moves your research forward.

 
 

Try Delve free for 14 days, hear what real users love about using Delve, or read the full guide to AI-assisted thematic analysis to see how building a codebook fits into the broader process.


FAQs

How detailed do code descriptions need to be for AI to apply them accurately? More detailed than you'd expect. AI uses your code name and the opening of your description to decide what to tag. Vague definitions produce vague results. Aim to define what the code means, what it doesn't mean, and include at least one example. Delve's AI memos show you exactly why it applied each code, which is useful for spotting where definitions need tightening.

Can AI generate a codebook from scratch? You can’t create a true qualitative codebook with AI alone. It can suggest initial codes, but those suggestions work better when you've already captured your own instincts first. Your early impressions from reading are part of the analysis. Use AI to react to your thinking, not replace it.

How do I know when my codebook is ready to apply deductively? When your descriptions are specific enough that someone unfamiliar with your research could apply them consistently. In Delve, running Apply Codes Using AI is a useful test – patterns of misapplication usually point directly to where definitions need work.

Does using AI to apply codes undermine rigor? Only if you treat suggestions as final. The rigor comes from reviewing every suggestion and keeping memos of your decisions. That paper trail is what lets you defend the analysis later.

What's the difference between using ChatGPT and a dedicated tool for this? With ChatGPT, your codebook lives outside the tool and resets between sessions. With Delve, your codes, descriptions, and memos stay connected to your transcripts across every session. When you refine a definition, it carries forward.


References

  • Braun, V., & Clarke, V. (2006). Using thematic analysis in psychology. Qualitative Research in Psychology, 3(2), 77-101. https://doi.org/10.1191/1478088706qp063oa

  • Braun, V., & Clarke, V. (2022). Thematic analysis: A practical guide. SAGE Publications.

  • Cook, D. A., Ginsburg, S., Sawatsky, A. P., Kuper, A., & D’Angelo, J. D. (2025). Artificial intelligence to support qualitative data analysis: Promises, approaches, pitfalls. Academic Medicine, 100(10), 1134-1149. https://pubmed.ncbi.nlm.nih.gov/40560241/

  • Morgan, D. L. (2023). Exploring the use of artificial intelligence for qualitative data analysis: The case of ChatGPT. International Journal of Qualitative Methods, 22. https://doi.org/10.1177/16094069231211248

  • Morgan, D. L. (2025). Query-based analysis: A strategy for analyzing qualitative data using ChatGPT. Qualitative Health Research. https://doi.org/10.1177/10497323251321712

  • Naeem, M., Smith, T., & Thomas, L. (2025). Thematic analysis and artificial intelligence: A step-by-step process for using ChatGPT in thematic analysis. International Journal of Qualitative Methods, 24, 1-18. https://doi.org/10.1177/16094069251233886

  • Nguyen-Trung, K. (2025). ChatGPT in thematic analysis: Can AI become a research assistant in qualitative research? Quality & Quantity. https://doi.org/10.1007/s11135-025-02165-z

  • Wachinger, J., Bärnighausen, K., Schäfer, L. N., Scott, K., & McMahon, S. A. (2025). Prompts, pearls, imperfections: Comparing ChatGPT and a human researcher in qualitative data analysis. Qualitative Health Research, 35(9), 951-966. https://doi.org/10.1177/10497323241244669

Cite this article