AI Takes Over as DM
Key point
Built a family-friendly AI DM for D&D using a Claude Code skill that even casts to a TV.
Details
I built a D&D 5e skill that uses Claude Code as a DM so the family can play gathered around the couch.
When I type in the party's actions on my laptop, Claude handles dice rolls, NPC roleplay, HP management, and combat progression, and the narrative is automatically sent to a browser page and displayed on the TV via Chromecast.
The core features are as follows.
- D&D 5e support: handles initiative, attacks, saves, spell slots, XP, and leveling up
- Character creation guide: point buy / rolled stats, racial bonuses, automatic assignment of starting equipment by class and background
- Persistent campaigns: state, NPCs, and quests are saved as markdown files, carrying over between sessions
- Cinematic display: typewriter-style narration, per-scene backgrounds, and a party sidebar with HP bars
- 17 scene types: backgrounds automatically switch based on keywords like tavern, dungeon, glacier, crypt
- Combat tracker: automatic initiative, real-time turn order pointer
The structure was also tuned with token cost in mind.
- Simple, deterministic tasks are offloaded to python
- Remaining simple reasoning is assigned to Haiku
- Actual campaign judgment is handled by Sonnet
- Opus is used only for world generation, designed to produce more nuanced narrative elements
For session management, instead of sending the entire conversation history, it's summarized into a session-log md, and the character/state/world/NPC files are updated. The Flask server for the TV is a separate option, so the install is relatively simple.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.