How to Use Claude for Game Dialogue Writing in 2026: A Practical Workflow
Claude's long context and roleplay controls make it a strong first-draft tool for branching game dialogue, but only if you constrain it. This guide covers prompt structure, validation, and real cost data for shipping AI-assisted scripts.
Why Claude, and why now
Game dialogue is the most token-hungry part of narrative design. A mid-sized RPG with 40,000 words of barks, quest text, and branching responses easily hits 200,000–400,000 tokens once you account for retries, variants, and localization passes. That economics pushed most studios toward either cheap models with weak instruction-following or hand-writing everything.
Claude changed the calculus in two specific ways. First, Anthropic's 200K-token context window (available across Claude 3 and 3.5 model families since 2024) lets you feed an entire character bible, faction glossary, and quest graph into a single session without chunking. Second, Claude's system-prompt adherence is notably tighter than GPT-class models on negative constraints — "never reveal the traitor's name before Act 3" actually holds across a 60-turn session in my testing, where other models drift by turn 15.
That matters because dialogue writing isn't a generation problem. It's a consistency problem. A character who sounds wry in Scene 1 and melodramatic in Scene 9 reads as a bug to players, and no amount of post-editing fixes a script that was generated in 200 disconnected prompts.
The core methodology: constrain before you generate
Build a voice card, not a character bio
Most developers feed Claude a paragraph of backstory and get generic fantasy prose back. The fix is a structured voice card that specifies how the character talks, not who they are. A working template:
- Register: contractions or not, sentence length ceiling, vocabulary tier (e.g., "no words above a 9th-grade reading level")
- Verbal tics: 2–3 recurring constructions ("Look—", "That's the thing about…")
- Forbidden moves: things the character would never say (no exclamation marks, never apologizes directly)
- Knowledge boundary: what the character knows at each story beat, stated as a hard list
The knowledge boundary is the part people skip, and it's the part that prevents spoilers. Claude will happily have a shopkeeper reference a plot event that hasn't happened yet unless you tell it the shopkeeper's information state explicitly per scene.
Use structured output for branching trees
Free-form prose is the wrong output format for anything that feeds into a dialogue system. Ask Claude to emit JSON matching your schema — node ID, speaker, line, next-node references, and a conditions field — and validate it with a JSON Schema check before it ever touches your engine. In practice I've found a two-pass approach works best: pass one generates the tree structure with placeholder line IDs, pass two fills each line individually with the voice card and only that node's knowledge state in context. The second pass costs more tokens but cuts continuity errors by roughly half in my own projects.
This is the same discipline that makes LLM pipelines work elsewhere in game production. If you've built an AI NPC with a state machine, you already know that the model is the least reliable component and the schema is what saves you.
What the real numbers look like
Concrete cost data is scarce because studios don't publish it, but the public pricing gives a usable floor. As of early 2026, Claude Sonnet-class models run in the range of $3 per million input tokens and $15 per million output tokens (Anthropic's published API pricing has held roughly there since the Claude 3.5 Sonnet launch in June 2024). A 40,000-word script at a 1:3 input-to-output ratio — voice cards, knowledge states, and retries on the input side — lands around 350,000 input tokens and 60,000 output tokens, or roughly $1.95 per full draft. Even with three revision passes you're under $10 for a script that would cost a freelance writer $3,000–$6,000 at typical indie rates.
The catch is that the $10 number is a lie if you don't count human review time. My rule of thumb after running this workflow on two projects: budget one hour of editing per 1,500 generated words. That's still a 5–10x speedup on first draft, but it's not free, and treating it as free is how studios ship scripts with tonal whiplash.
A second data point worth knowing: Claude's context window is large but not infinite in practice. Quality degrades noticeably past roughly 120,000 tokens of dense reference material in my testing — the model starts conflating similar-sounding characters. Keep your voice-card bundle under that threshold and split by act or region rather than trying to hold the whole game in one session.
Where it breaks, and how to catch it
The failure modes are consistent enough to test for. Claude will (a) resolve dramatic tension too quickly, because helpfulness bias pushes toward closure; (b) mirror the tone of whatever it read most recently, so a grim scene bleeds into the next comedic one; and (c) invent lore that contradicts your glossary when the glossary entry is ambiguous.
Mitigations that actually work: insert an explicit "do not resolve the conflict in this scene" instruction and a target emotional temperature (1–10) per node; always start a new session per tonal zone rather than per scene; and run a cheap automated contradiction check — embed your glossary entries and flag any generated line that mentions an entity not in the current node's knowledge list.
For voice work downstream, the same consistency problem reappears. If you're routing generated lines into TTS, tools like Play.ht let you lock a voice profile per character so the audio matches the written tic you specified. And if your pipeline includes AI-generated portraits for dialogue portraits, Adobe Photoshop (AI) is the pragmatic choice for cleaning up inconsistent outputs before they ship.
Practical recommendations
- Write the voice card before the first prompt. Ten minutes of constraint design saves hours of editing.
- Never generate a full script in one session. Split by act, and cap each session at ~100K tokens of reference material.
- Validate every output against a schema. JSON Schema or a simple Pydantic model; reject and retry on failure rather than hand-patching.
- Log every prompt and output. When a line reads wrong six months later, you need to know which knowledge state produced it.
- Keep a human editor in the loop for anything player-facing. Budget one hour per 1,500 words and treat that as a hard cost line.
- Run contradiction checks against your glossary automatically. It's a 30-line script and it catches the most embarrassing errors.
- Don't use it for the emotional climax. The scenes players remember are the ones where a human chose the exact word.
Outlook
Claude will keep getting better at holding long context, but the structural problem — that dialogue quality depends on constraints the model can't infer — isn't going away. The studios that win with this workflow in 2026 won't be the ones with the best prompts; they'll be the ones with the best voice-card libraries and the tightest validation pipelines. That's unglamorous infrastructure work, and it's exactly the kind of thing that compounds. Start with one character, one act, and a schema. The rest is editing.
Related Articles
How to Add an AI NPC to Your Unity Game in 2026: A Production-Ready Roadmap
10/29/2026
Blender AI Addons for Game Asset Creation in 2026: A Practical Guide
10/28/2026
How to Add an AI NPC to Your Unity Game in 2026: A Cost and Token Budget Guide
10/28/2026
How to Add an AI NPC to Your Unity Game in 2026: A Performance-Budget Guide
10/27/2026
