A literary, mood-driven interactive text adventure that runs as a Claude Artifact inside the Claude.ai chat. Five premises — Echo, Neon, Omen, Dream, and a Wild custom-scenario builder — each a contained "hour" with its own voice and its own ways to win or lose. The aesthetic is twilight-and-cream serif, typewriter reveal, and narrative-flavored loading phrases: the wait is part of the texture.
The whole engine is one self-contained React file — the-borrowed-hour.jsx.
- Open claude.ai and start a new chat.
- Ask Claude to create an Artifact, or open the Artifacts panel.
- Paste the entire contents of
the-borrowed-hour.jsxas the Artifact source. - Run it, and pick an hour.
It only runs inside Claude Artifacts. The engine calls
https://api.anthropic.com/v1/messagesdirectly and relies on the Artifacts sandbox to proxy and authenticate that request. There is no API key in the code, and you should not add one — outside the sandbox the fetch will simply fail.
| Realm | Title | The hook |
|---|---|---|
| ECHO | The 8:11 | A commuter train, a Tuesday morning, and a folded note in your own handwriting you don't remember writing. |
| NEON | The Vermillion Thread | Twenty minutes in an elevator going somewhere you've never been allowed. The Thread is deciding what to do with you. |
| OMEN | Three Nights to the Solstice | You saw the queen die. You cannot tell anyone. Three nights remain, and the assassin already moves among us. |
| DREAM | The Carnival Lethe | A circus that performs in the dreams of sleepers. Tonight the dreamer is dying, the ringmaster is missing, and the big top has begun to leak. |
| WILD | The Unwritten Hour | Your premise. Write a seed and the engine builds the hour around it. |
Full write-ups in docs/PREMISES.md.
- Two-tier model strategy. Sonnet 4.6 writes the opening scene only — the longest, voice-setting piece of prose. Haiku 4.5 carries every subsequent turn and the post-game discussion, for roughly 30–40% the cost of all-Sonnet.
- Forced structured output. Every in-fiction turn is a forced
narrate_and_update_statetool call, so narration and game state are always produced in lockstep — no fragile JSON-in-prose parsing. - Private GM scratchpad. The model gets a hidden working space that runs an explicit boundary check and style check before every turn.
- Public/hidden state boundary. Player-facing state is "the player's diary" — only what they've actually been shown. Clocks, twists, and secret motives live in hidden GM state.
- 1-hour prompt caching. The system prompt and tool schema are cached with
an explicit
ttl: "1h", matching the human pacing of interactive fiction.
Full internals in docs/ARCHITECTURE.md.
Forking is the point. The engine is built to be taken apart:
- Switch models — run it all on Opus, all on Haiku, or any mix.
- Rewrite the premises — replace the five realms with your own worlds.
- Add RPG mechanics — HP, stats, dice rolls, inventory weight, factions.
- Reskin it — the entire look is one CSS template literal.
- Change the voice — retune the authorial register in the system prompt.
The hands-on guide is docs/ADAPTING.md, and
CONTRIBUTING.md covers contributing back.
MIT © 2026 faded-penguin021