You play a pharaoh fighting your way up the Nile to the temple, past mummies, sphinxes and the Pharaoh’s chariot. Along the way you rescue captives, collect cats into an army that fights for you, and throw sandstorms.
Making a wish
Press E and time stops. A council of characters from ancient Egyptian mythology appears in the sky, and you can type any wish you like. Most are granted, and about one in ten gets turned down with a joke. Whatever’s granted really happens in the game: lightning, stone tombs, portals, mummies turned into cats, shields, a flight straight to the temple, and, with Claude, even part of the map redrawn.
Online, a small model I trained reads your wish and picks the power. On your own computer with Claude Code, Claude can read it instead and write every reply itself, so no two wishes play out the same way.
Reading wishes without Claude
The model doesn’t write anything. It’s an intent classifier: it sorts a wish into one of the game’s 14 powers, or “none”. Simple rules then fill in the details, like how many cats or which mummy, and the gods reply with lines written beforehand.
It’s a bag-of-n-grams logistic regression:
- Features: each wish is lowercased and cut into word unigrams and bigrams, plus character n-grams of 2 to 4 letters inside each word, with a space added at each end. Only n-grams that appear in at least two training wishes are kept, 20,755 of them. A wish becomes a vector of their counts, scaled to unit length. Word order is thrown away, hence “bag”.
- Model: one-vs-rest logistic regression, one binary classifier per power, trained with scikit-learn. Each gives a probability from 0 to 1, the highest wins, and a second power is added if it also scores over 0.5.
- Running it: the weights are quantised to 8-bit integers and exported as JSON. The browser runs it in a few lines of TypeScript, with no machine learning library.
- Data: 2,998 labelled wishes written by AI, split 80/20 into training and test. Every training wish also gets three copies with made-up typos: dropped, doubled and swapped letters, and neighbouring keys.
The character n-grams are what make typos work: it never saw “kittys”, but it saw most of its chunks.
On the 600 test wishes, 90.3% get the right power first, and 87.2% get exactly the right powers, counting wishes that ask for two. Per power, recall goes from 97% for blessings down to 81% for slowing time. Claude took about 4 to 5 seconds a wish, so the game now waits almost a second on purpose, so the gods still look like they’re thinking. It only knows English, and it can’t redraw the map, which needs Claude.
Where it came from
It started as the same small shooter everyone got at the workshop, and became something else entirely by the end of the day. At first the wishes needed Claude running on your own computer, so that was the only place it could run. To put it online, I trained the model above to read them instead, and wrote about what surprised me. It runs in your browser, so the game works on a phone too, with touch controls: sands-of-ra.nour.page.
The code is on GitHub. If you run it yourself with Claude Code installed, you can switch back to Claude.