Use an AI to referee a D&D 5e dungeon

They ran a browser D&D crawl with three characters while the agent checked rules text and monster stats from separate sources.

Done with Custom agentยท Advancedยท Oct 2026

What they did
They built The Goblin Warren as a browser game and let an AI serve as dungeon referee for a three-person party. To keep the game on the rails, the system consulted a Sanity Context knowledge base for rule wording and GROQ for exact creature statistics; the server loaded both in advance and gave the model one optional tool call. Claude Code agents assembled the Sanity layer, and any citations tied to missing lookups were removed.
How it went
Rules checks typically came back in 1.3โ€“2.2 seconds. The knowledge base also turned up six cases where its own content disagreed across 2014 and 2024 editions, so those entries were set aside for review.
Tips
The setup needs an org token that has the Context Viewer role; a project token will fail with 403 contextGrantRequired. The knowledge base holds only about 150 documents, so keep the scope narrow.

Try it yourself with Claude Cowork

You are the referee for a D&D 5e crawl featuring three adventurers: [hero A name, class, level], [hero B name, class, level], and [hero C name, class, level]. Rely only on official 5e rules, ask me to handle any rolls or choices you need, and if a rule is unclear, say so rather than guessing. Guide us through roughly [number] chambers. Before you do anything irreversible, such as spending, submitting, sending, deleting, or ending the game, stop and ask me to confirm. When the crawl is done, give me a brief summary of treasure and XP.

Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.

Read the original on dev.to โ†—

Get 3 agent uses like this every morning

With the day's top AI news. Free, and one click to unsubscribe.