Claude Modsunofficial directory

Games·terminal·MIT

gamble-with-claude-code

Slots, roulette and blackjack, played with the tokens Claude Code burned today.

gamble-with-claude-code blackjack table showing an ace and a king, with bet sizes and a DEAL button
Demo animation from the gamble-with-claude-code repository, MIT license

gamble-with-claude-code is a small casino inside Claude Code: slots, European roulette and blackjack in one panel. Your chips are the tokens Claude Code has burned since midnight, read from its own session logs on your machine. Nothing is spent or won for real. The bets only move a counter the mod keeps for the day, and the games never call the model.

What it does

  • Slots: three reels with five symbols: 7, $, LGTM, 429 and rm -rf. Three of a kind pays from ×3 to ×50 (777 pays ×20, three rm -rf pay ×50), and a matching pair on neighboring reels pays ×1.5.
  • Roulette: a European wheel, 0 to 36. One bet per spin: red or black, even or odd, low or high half, a dozen, or a single number at 35:1. Zero loses every outside bet.
  • Blackjack: a fresh 52-card deck each hand. The dealer stands on every 17, a natural pays 3:2, and you can double on your first two cards. No split and no insurance.
  • Stakes: each bet is 10, 25, 50 or 100 percent of your balance.
  • Balance: today’s burn plus whatever you have won or lost at the tables. It never drops below zero, grows again as Claude Code burns more tokens, and starts over at midnight.
  • Saved hands: an unfinished blackjack hand is kept and comes back the next time you open the casino.

claude-slots is a different take on the slot machine: it replaces the spinner and plays itself on every prompt. This mod is a table you open with a command and bet on yourself.

Install

Needs Claude Code 2.1.287 or later and Python 3 on your PATH, as python3, python or py -3.

claude plugin marketplace add szarkans/gamble-with-claude-code
claude plugin install gamble-with-claude-code@gamble-with-claude-code

Run /reload-plugins or restart Claude Code, then /casino. Press z, x or c for slots, roulette or blackjack, 1 to 4 for the stake, and s to spin, deal or stand; h hits and d doubles. Every button shows its key, and clicks work in terminals that report the mouse. Esc or q closes the panel. It is up to 88 columns wide and wants a terminal about 50 rows tall; on a shorter one, scroll it with PageDown.

How it works

/casino opens a panel titled GAMBLE WITH CLAUDE CODE that takes the keyboard until you close it. Reels, wheel and cards are animated at 25 frames a second by pushing frames straight into the panel’s drawing area.

To count your tokens, the mod runs a Python script bundled with the plugin, tools/count_today.py. According to the README, it reads Claude Code’s session logs under ~/.claude/projects (or $CLAUDE_CONFIG_DIR) and adds up today’s input, cache-write and output tokens; cache reads are left out. The script runs when you open the panel, before every bet or blackjack move, and every five seconds while the panel is open. The author states the mod makes no network calls. The hooks module has none, and that script is the only process it starts.

Your result for the day and any unfinished hand live in Claude Code’s plugin store on your machine, under one key per date. The only environment variable it reads is GWCC_DEBUG: set to 1, it pins the balance at 10,000 tokens, adds buttons that force a win or a loss, and keeps those rounds apart from your real day.

Spins, reel stops, dealt cards and results play short WAV clips that ship with the plugin. The mod has no setting to turn them off.

Limitations

  • Terminal only. In the Desktop app’s Code tab the panel shows a note asking you to run /casino in a terminal instead.
  • Without Python 3 on your PATH the panel still opens, but it cannot count tokens and its message line asks for Python 3.

Similar Claude Mods

The whole directory →