Claude narrates. The engine owns truth.
A simulation-grounded campaign RPG where Claude stages the story, the engine preserves truth, and worlds evolve through rumor, pressure, faction, relationship, economy, and arc systems toward meaningful conclusions.
Play
npx claude-rpg play --world fantasy
Generate
npx claude-rpg new "A flooded gothic trade city"
Archive
npx claude-rpg archive
Simulation-first design
Every turn runs through a deterministic simulation before Claude narrates the result.
Deterministic truth
The engine resolves combat, movement, and dialogue. Claude only narrates what the perception layer allows the player to see. No hallucinated outcomes.
NPC agency
NPCs act on goals, track obligations, and retaliate when loyalty breakpoints shift. Consequence chains ripple across factions and districts.
Campaign arcs
10 arc kinds detected from accumulated state. 8 endgame resolution classes trigger when thresholds are crossed. Deterministic finale rendering with LLM epilogue.
Living districts
Commerce, morale, and safety shift from player actions, faction moves, and NPC consequence chains. District mood flows into narration.
Player leverage
Spend influence, favors, and intel on social, rumor, diplomacy, and sabotage actions. Strategic map analysis and move advisor guide political play.
Equipment provenance
Items carry history. A sword that kills enough becomes a relic with an epithet. NPCs recognize equipped items and react to their reputation.
Campaign archives
Browse completed campaigns, export chronicles as markdown or JSON, and share standalone finale documents. Every campaign leaves a record.
Streaming narration
Text arrives incrementally at the terminal. The engine resolves first — streaming is presentation only. Interrupted streams cannot corrupt game state.
API retry + autosave
Transient API failures retry with exponential backoff. Game state autosaves periodically. No more lost progress from crashes or disconnects.
NPC conversation memory
NPCs remember what you told them and reference past exchanges. Voice archetypes give each NPC a distinct speech pattern — scholarly, gruff, merchant, noble.
Terminal polish
ANSI colors, animated spinner during LLM calls, tab completion for commands/names/items, turn separators, and structured announcement blocks.
Swarm-hardened
625 tests across 53 test files. 67 bug fixes + 22 proactive hardening passes covering error containment, graceful degradation, and observability.
Quick start
Install and play
# Install globally
npm install -g claude-rpg
# Set your API key
export ANTHROPIC_API_KEY=sk-ant-...
# Play a starter world
claude-rpg play --world fantasyGenerate a custom world
# Create a world from any prompt
claude-rpg new "A flooded gothic trade city
ruled by three merchant houses"
# Load a saved game
claude-rpg load10 starter worlds
Each world comes with factions, NPCs, districts, and genre-specific modules.
| World | Genre | Theme |
|---|---|---|
| Chapel Threshold | Fantasy | A mountain monastery under siege by the faithful and the fallen |
| Neon Lockbox | Cyberpunk | Corporate arcology where data is currency and trust is a weapon |
| Gaslight Detective | Detective | Victorian streets hiding a conspiracy that reaches the crown |
| Black Flag Requiem | Pirate | A dying pirate republic choosing between freedom and survival |
| Ashfall Dead | Zombie | Post-outbreak colony where the living are more dangerous than the dead |
| Dust Devil's Bargain | Weird West | Frontier town where every deal has a supernatural catch |
| Signal Loss | Sci-Fi Colony | Deep space colony that lost contact with Earth three years ago |
| Iron Colosseum | Gladiator | Arena politics where every fight is a transaction and every champion has a patron |
| Jade Veil | Ronin | A masterless warrior navigating clan feuds in a land where honor is currency |
| Crimson Court | Vampire | Immortal aristocrats scheming through centuries of debt, blood, and betrayal |
Three modes
Play, inspect, or replay.
Play mode
Immersive narrated RPG. Type freeform text, explore, fight, negotiate, scheme. Perception filtering means you only see what your character perceived.
Director mode
Inspect hidden simulation truth. See NPC beliefs, faction cognition, rumor networks, obligation ledgers, and consequence chains. Understand exactly why things happened.
Campaign conclusions
Arc detection tracks your trajectory. Endgame triggers fire at pivotal moments. /conclude renders a structured epilogue with faction fates, NPC outcomes, and your legacy.