Text adventures that actually adapt to your choices. Built specifically for Claude Code.
Unlike traditional choice-based games, Kleene responds to free-form actions and improvisation. The temperature system lets you control how much the AI adapts - from traditional branching (temp 0) to fully emergent storytelling (temp 10).
🎮 Get Started in 5 Minutes | 📖 Documentation | 🤝 Contributing
# Play a game
/kleene play
# Try the beginner-friendly Dragon Quest
/kleene play dragon_quest
# Start at temperature 0 (traditional), increase once comfortable
/kleene temperature 0
# Generate your own scenario
/kleene generate a cyberpunk heist
# Check your scenario for issues
/kleene analyze👉 New to Kleene? Check out the Getting Started Guide
# Add the marketplace
/plugin marketplace add kleene-games/kleene
# Install the plugin
/plugin install kleene@kleene-gamesVerify installation: Run /kleene to see the menu, then /kleene play to start your first game!
| Command | What It Does |
|---|---|
/kleene play |
Start a new game (shows scenario menu) |
/kleene continue [scenario] |
Resume from save |
/kleene temperature [0-10] |
Set adaptation level |
/kleene foresight [0-10] |
Set hint specificity |
/kleene parser [on|off] |
Toggle text adventure mode |
/kleene save |
Save current game |
/kleene rewind [target] |
Rewind to earlier point (T6.2.3, -1, --1) |
/kleene export [mode] |
Export gameplay (transcript/summary/stats/branches/gallery) |
/kleene gallery [on|off] |
Toggle educational meta-commentary |
- 0 (Verbatim): Scenario text exactly as written - traditional branching
- 1-3 (Subtle): Faint echoes of your discoveries woven in
- 4-6 (Balanced): Direct references to your exploration
- 7-9 (Immersive): Rich integration + bonus options appear
- 10 (Adaptive): Narrative fully shaped by your actions
Pro tip: Start every scenario at temp 0 to learn it, then replay at temp 10 for emergent magic.
When playing at temp > 0, you can type anything instead of picking from options:
- Explore: "I search the room for hidden doors"
- Interact: "I try to befriend the guard"
- Act: "I light the papers on fire"
- Meta: "I want to leave this location"
The AI evaluates feasibility and generates responses that fit the scenario tone.
- Improvisation Support: Type any action—Claude interprets and responds dynamically
- State Persistence: Save/load game states, pick up where you left off
- Scene Tracking: Turn/Scene/Beat counters show precise gameplay position
- Multi-Level Rewind: Jump back to any Turn.Scene.Beat (T6.2.3 notation)
- Export System: Save gameplay as clean narrative or analytical summary
- Gallery Mode: Educational meta-commentary on narrative techniques
- Foresight Setting: Control how much the game reveals when you ask for hints
- Parser Mode: Text adventure-style play—type commands like Zork
- Auto-approval Hooks: Seamless gameplay without permission prompts
- Pure Claude Code Integration: No separate app, plays in your terminal
- AI-Powered Generation: Create complete scenarios from a single theme prompt
- YAML-based Format: Human-readable, version-controllable scenario files
- Structural Validation: Analyze completeness across Bronze/Silver/Gold tiers
- Decision Grid Framework: Built-in guidance for rich, non-binary storytelling
- Preconditions & Consequences: Full game logic with inventory, traits, flags, relationships
- Location State System: Per-location flags, properties, and environment conditions
- Node/Location Preconditions: Gate story nodes and location access
- Temporal System: Time-based gating with scheduled events
- NPC Tracking: Move NPCs and check their locations
Kleene isn't just a game engine—it's a complete authoring toolkit:
- Generate: Start with a theme (
/kleene generate "space station mystery") - Edit: Scenarios are YAML files you can hand-edit or ask Claude to refine
- Validate: Check structural completeness (
/kleene analyze my_scenario) - Play: Test your creation immediately (
/kleene play my_scenario) - Share: Push to the community scenarios repo
/kleene generate a space station mystery
# Or be more specific
/kleene generate a noir detective story set in 1940s Los AngelesThe AI creates a complete scenario with branching paths, endings, and proper structure.
- Check out
scenarios/dragon_quest.yamlfor inspiration - Use templates in
scenarios/TEMPLATES/ - Follow the Scenario Authoring Guide
- Validate with
/kleene analyze your_scenario
Minimal scenario example:
name: "My Adventure"
description: "A brief description"
initial_character:
name: "Hero"
traits: { courage: 5, wisdom: 5 }
inventory: []
start_node: intro
nodes:
intro:
narrative: |
You stand at the beginning of your adventure...
choice:
prompt: "What do you do?"
options:
- id: brave
text: "Be brave and enter"
next_node: victory
- id: flee
text: "Run away"
next_node: escape
endings:
victory:
narrative: "You conquered your fear!"
type: victory
escape:
narrative: "You lived to fight another day."
type: unchangedSee the complete format specification for all features.
| Skill | Purpose |
|---|---|
kleene-play |
Interactive gameplay with inline state management |
kleene-generate |
Create scenarios from themes or expand existing ones |
kleene-analyze |
Check narrative completeness and structure |
Saves are stored at: ./saves/[scenario_name]/[timestamp].yaml
- Auto-save: Created when you start a game
- Manual save:
/kleene saveduring gameplay - Resume:
/kleene continue [scenario]lists available saves - Rewind:
/kleene rewind T6.2.3jumps to Turn 6, Scene 2, Beat 3 - Save format v8: Includes scene/beat counters, location state, NPC tracking, scheduled events, foresight, and parser mode settings
Export your adventures as clean markdown files:
/kleene export # Default transcript mode
/kleene export summary # Analysis with thematic notes
/kleene export --granularity=beat # Maximum detail
/kleene export branches # Split by timelineExport modes:
- transcript (default): Clean narrative log
- summary: Analysis with gallery notes
- stats: Numbers only - trait/relationship evolution
- branches: Split by timeline for rewind sessions
- gallery: Meta-commentary only
Exports are saved to: ./exports/[scenario]_[timestamp].md
Classic fantasy adventure. Perfect for learning Kleene basics. Playtime: 15-20 minutes | Difficulty: Beginner
The legendary 1980 Infocom text adventure, adapted for Kleene. Explore the white house, descend into the Great Underground Empire, and collect treasures. Playtime: 20-30 minutes | Difficulty: Intermediate | Parser Mode Recommended
Type anything. Don't just pick from options - describe what you want to do and the AI responds:
- "I examine the dragon's scales closely"
- "I try to sneak past while it's distracted"
- "I offer it gold from my pouch"
Same scenario, completely different experience:
- Temperature 0: Traditional branching narrative
- Temperature 5: Story adapts to your exploration
- Temperature 10: Fully emergent storytelling - every playthrough is unique
Try playing Dragon Quest at temp 0, then replay at temp 10. Mind = blown.
- Native integration with seamless UX
- Auto-saves during gameplay
- Smart lazy loading for massive scenarios
- No external dependencies
- Dragon Quest (beginner) - Classic fantasy adventure to learn Kleene basics
- Zork I: Mini (intermediate) - The legendary text adventure, reimagined
- Simple YAML format (no coding required)
- Built-in scenario generator:
/kleene generate haunted mansion - Validator ensures no dead ends:
/kleene analyze - Templates to get you started quickly
- Contribute scenarios: See CONTRIBUTING.md
- Report bugs: Open a GitHub issue
- Share your creations: Tag them with
#kleene - Get help: Check FAQ or Troubleshooting
- Getting Started - 5-minute quick start
- Settings Reference - Temperature, foresight, parser mode, gallery mode
- Scenario Authoring Guide - Create your own adventures
- Scenario Format Reference - Complete YAML specification
- Presentation Conventions - Headers, traits, choice formatting
- Improvisation Guide - Free-text action handling
- FAQ - Common questions answered
- Troubleshooting - Fix common issues
Kleene is built on solid theoretical foundations for those who want to dive deep.
Every choice exists at the intersection of player intent and world response:
| World Permits | World Indeterminate | World Blocks | |
|---|---|---|---|
| Player Chooses | Triumph | Commitment | Rebuff |
| Player Unknown | Discovery | Limbo | Constraint |
| Player Avoids | Escape | Deferral | Fate |
Player Unknown captures both hesitation and improvised free-text actions. Limbo (center cell) is where side quests and improvisation thrive.
A narratively complete scenario ensures coverage across the grid. See Core Framework for deep technical details.
The zork1-mini.yaml scenario is adapted from the original ZIL source code.
- Original Creators: Tim Anderson, Marc Blank, Bruce Daniels, and Dave Lebling
- Original Publisher: Infocom, Inc. (1980)
- Source Repository: historicalsource/zork1
- License: MIT License (c) 2025 Microsoft Corporation
The ZIL source was relicensed under MIT in November 2025 by Microsoft's OSPO, Team Xbox, and Activision. Per Microsoft: "The goal is not to modernize Zork but to preserve it as a space for exploration and education."
Copyright (c) 2025 Mountain Ash Holdings Pty Ltd. All rights reserved.
For commercial licensing inquiries: nathaniel.ramm@discretedatascience.com
GNU Affero General Public License v3.0 - see LICENSE file for details.
See CHANGELOG.md for version history and updates.
Made with ❤️ for Claude Code | Report Issues | Contribute