Skip to main content

Chronicler

261 words

Chronicler is a single-player tabletop role-playing engine built around Claude Code. It exists because scheduling a real D&D session with five adults is harder than slaying a dragon.

The engine pairs Claude with about thirty Python tools exposed over MCP, a web front-end for the parts a chat window does poorly, and a file-system store that lets campaigns grow indefinitely without devouring the context window.

What it does
#

  • Plays AD&D 2nd edition (and other rulesets you can import) with fair mechanics — dice that the model can’t fudge, real encumbrance, morale, surprise, reactions.
  • Persists everything to disk: party, NPCs, locations, quests, rumors, faction clocks, session transcripts.
  • Renders tactical maps from DungML, a small DSL that takes the spatial reasoning out of the model’s hands.
  • Generates scenes and portraits via Replicate, narrates via OpenAI TTS, and tracks per-character voices.
  • Supports Greyhawk and Forgotten Realms out of the box, with GeoJSON overland maps and full setting lore search.

How it’s built
#

Claude Code is the reasoning core. Python tools handle anything mechanical — combat resolution, dice, travel days, weather, lookups. State lives on the file-system as structured JSON and a handful of SQLite databases; the web UI is a thin reflection of that state.

The architecture is designed to run on a low-powered always-on machine — a laptop today, a Raspberry Pi tomorrow.

Read more
#

The full story is told across the Chronicler series:

  1. Why I built a TTRPG engine
  2. AI and roleplaying — a good match?
  3. Chronicler overview
  4. Dungeons as Code
  5. Engine tools and instructions
  6. Playing a Chronicler campaign