Ranking|Claude Code Mods

ModsCode / Claude Code Mods / Ranking / blackjack

blackjack

A blackjack table in a side pane to play while Claude works

Code you can checkTerminal + desktopPaneBandToastBoxButtonSvgText
draws, remembers

What it does

  • Draws a pane, toasts
  • Adds /blackjack
  • Hooks classic.SessionStart, session.start, turn.complete, turn.start and 1 more
  • Keeps its own state between turns

Good points

  • No network calls
  • Starts no processes
  • Written in TypeScript
  • Has a desktop-specific branch

Code to start from

A starter ModsCode writes from the drawing it read, and the mod's own lines that draw, where there are any.

Starter (register.tsx)

register.tsx
import type { Register } from 'claude-code'

// Drawn like blackjack by michaeldavodovski (pane, band, toast), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/michaeldavodovski-blackjack/
// Written by ModsCode from that reading, not copied from the mod: use it as you like.
// Each value below stands for one the mod works out at run time; put in your own.
export const register: Register = on => {
  // the pane: open it with $.ui.open({ id: 'my-pane', title: "Blackjack" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Svg, Button } = $.ui.resolve(e)
    const run = '…'
    const run2 = '…'
    const run3 = '…'
    const run4 = '…'
    const run5 = '…'
    const run6 = '…'
    const run7 = '…'
    const run8 = '…'
    const run9 = '…'
    const bankroll = '…'
    const wagerOf = '…'
    const ruleSvg = '…'
    const RESULT = '…'
    const row = '…'
    const row2 = '…'
    const row3 = '…'
    const source = '…'
    const hotkey = '…'
    const centered = '…'
    const text = '…'
    const betFor = '…'
    const keysHint = '…'
    const label = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="column" alignItems="center" marginBottom={1}>
          <Box flexDirection="column">
            <Box flexDirection="row">
              <Text bold>
                {run}
              </Text>
              <Text bold>
                {run2}
              </Text>
              <Text bold>
                {run3}
              </Text>
            </Box>
            <Box flexDirection="row">
              <Text bold>
                {run4}
              </Text>
              <Text bold>
                {run5}
              </Text>
              <Text bold>
                {run6}
              </Text>
            </Box>
            <Box flexDirection="row">
              <Text bold>
                {run7}
              </Text>
              <Text bold>
                {run8}
              </Text>
              <Text bold>
                {run9}
              </Text>
            </Box>
          </Box>
          <Text bold>
            CCC
          </Text>
          <Text dimColor>
            Claude Code Casino
          </Text>
        </Box>
        <Box flexDirection="row" justifyContent="space-between">
          <Text bold>
            {"Bank "}
            {bankroll}
          </Text>
          <Text>
            Bet
            {" "}
            {wagerOf}
          </Text>
        </Box>
        <Box marginTop={1}>
          <Svg source={`${ruleSvg}`} alt="Divider" height={1} />
        </Box>
        <Box flexDirection="column" marginY={1}>
          <Box flexDirection="row" justifyContent="space-between">
            <Text dimColor>
              {"Dealer "}
              soft 0
            </Text>
            <Text dimColor>
              {"stands on "}
              17
            </Text>
          </Box>
          <Box flexDirection="row" flexWrap="wrap" columnGap={1}>
            <Text>
              {" ?? "}
            </Text>
            <Text>
              {" ?? "}
            </Text>
            <Text>
              {" ?? "}
            </Text>
          </Box>
          <Box marginTop={1}>
            <Text dimColor>
              {"You "}
              soft 0
            </Text>
          </Box>
          <Box flexDirection="row" flexWrap="wrap" columnGap={1}>
            <Text>
              {" ?? "}
            </Text>
            <Text>
              {" ?? "}
            </Text>
            <Text>
              {" ?? "}
            </Text>
          </Box>
        </Box>
        <Box flexDirection="column" marginBottom={1}>
          <Box height={1} justifyContent="center">
            <Text dimColor>
              Dealer plays...
            </Text>
            <Text bold color="success">
              {RESULT}
            </Text>
          </Box>
          <Box flexDirection="column" alignItems="center" height={3}>
            <Text bold>
              {row}
            </Text>
            <Text bold>
              {row2}
            </Text>
            <Text bold>
              {row3}
            </Text>
            <Svg source={`${source}`} alt="A rain cloud" />
          </Box>
        </Box>
        <Box flexDirection="column" rowGap={1}>
          <Box flexDirection="column">
            <Button plain label="        " />
            <Button hotkey={`${hotkey}`} label={`${centered}`} variant="primary" autoFocus />
            <Button plain label="        " />
          </Box>
          <Box flexDirection="column">
            <Button plain label="        " />
            <Button hotkey={`${hotkey}`} label={`${centered}`} variant="primary" autoFocus />
            <Button plain label="        " />
          </Box>
          <Box flexDirection="column">
            <Button plain label="        " />
            <Button hotkey={`${hotkey}`} label={`${centered}`} variant="primary" autoFocus />
            <Button plain label="        " />
          </Box>
        </Box>
        <Box flexDirection="column" rowGap={1}>
          <Text>
            Out of chips.
          </Text>
          <Box flexDirection="column">
            <Button plain label="        " />
            <Button hotkey={`${hotkey}`} label={`${centered}`} variant="primary" autoFocus />
            <Button plain label="        " />
          </Box>
        </Box>
        <Box flexDirection="column" rowGap={1}>
          <Box flexDirection="row" alignItems="center" columnGap={1}>
            <Box>
              <Button plain label={` ${text} `} />
            </Box>
            <Box>
              <Button plain label={` ${text} `} />
            </Box>
            <Box flexDirection="column" justifyContent="center" alignItems="center" paddingX={2}>
              <Text bold>
                {betFor}
              </Text>
            </Box>
            <Box>
              <Button plain label={` ${text} `} />
            </Box>
            <Box>
              <Button plain label={` ${text} `} />
            </Box>
          </Box>
          <Box flexDirection="column">
            <Text dimColor>
              Bet change step
            </Text>
            <Box flexDirection="row" justifyContent="space-between">
              <Box>
                <Button plain label={` ${text} `} />
              </Box>
              <Box>
                <Button plain label={` ${text} `} />
              </Box>
              <Box>
                <Button plain label={` ${text} `} />
              </Box>
            </Box>
          </Box>
          <Box flexDirection="column">
            <Button plain label="        " />
            <Button hotkey={`${hotkey}`} label={`${centered}`} variant="primary" autoFocus />
            <Button plain label="        " />
          </Box>
        </Box>
        <Box flexDirection="column" marginTop={1}>
          <Box flexDirection="column" height={2}>
            <Text dimColor>
              Claude is working...
            </Text>
            <Text color="success">
              Claude is done.
            </Text>
            <Text bold>
              Get back to work!
            </Text>
          </Box>
          <Text dimColor>
            {keysHint}
          </Text>
          <Box flexDirection="row" columnGap={2}>
            <Button plain hotkey="1" label="Min" autoFocus />
            <Button plain hotkey="2" label={`${label}`} autoFocus />
            <Button plain hotkey="3" label={`${label}`} autoFocus />
            <Button plain hotkey="4" label="Max" autoFocus />
          </Box>
          <Box flexDirection="row" columnGap={2}>
            <Button plain hotkey="5" label="smaller step" autoFocus />
            <Button plain hotkey="6" label="bigger step" autoFocus />
          </Box>
          <Text dimColor>
            ctrl+x tab to use keys
          </Text>
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    await $.ui.toast(`Blackjack: could not save the bank`)
    await $.ui.toast(`Blackjack: run /blackjack to open the table`)
    return next(e)
  })
}

The mod's own code

Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.

hooks/register.tsx lines 399–558 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    isFullscreen = e.viewport?.isFullscreen ?? isFullscreen

    const { Box, Button, Text } = $.ui.resolve(e)
    const table = await read($, game)
    const status = await read($, claude)
    const net = netOf(table)
    // Minus and plus carry the amount they move the bet by, so the row that
    // picks it explains itself.
    const less = `-${stepOf(table)}`
    const more = `+${stepOf(table)}`

    // The dealer's cards start turning before anything is saved, so a save
    // that fails cannot leave the table waiting on them. A move that stakes
    // or restores chips (`isFresh`) first takes up the bank as saved.
    const play = (move: (table: Game) => Game, isFresh = false) => async () => {
      if (isFresh) {
        await refresh($)
      }

      let before = table
      const after = await update($, game, now => {
        before = now

        return move(now)
      })
      if (isRevealing(after)) {
        reveal($)
      } else if (isFxRunning(after)) {
        animate($)
      }
      await save($, before, after)
    }

    // While the dealer's cards turn, the table shows the hand as it stood:
    // no result yet, and the bank as it was before it.
    const isTurning = isRevealing(table)
    const isBetting = !table.isPlaying && !isBroke(table) && !isTurning
    const faceUp = table.isPlaying ? 1 : table.dealerShown
    const dealerUp = table.dealer.slice(0, faceUp)
    const isHoleDown = faceUp === 1 && table.dealer.length > 1
    const frame =
      table.outcome !== null && !isTurning
        ? frameOf(table.outcome, table.fx)
        : null

    const hand = (cards: readonly number[], isHoleHidden: boolean) => (
      <Box flexDirection="row" flexWrap="wrap" columnGap={1}>
        {cards.map((card, i) =>
          isHoleHidden && i === 1 ? (
            <Text backgroundColor={theme.back} color={theme.backInk}>
              {' ?? '}
            </Text>
          ) : (
            <Text
              backgroundColor={theme.card}
              color={isRed(card) ? theme.redInk : theme.ink}
              bold
            >
              {` ${rankOf(card)}${suitOf(card)} `}
            </Text>
          ),
        )}
      </Box>
    )

    const columns = e.props.bodyColumns
    const isDocked = e.props.placement === 'dock'
    const isTerminal = e.surface === 'terminal'
    // The bet row: Min and minus on one side of the bet, plus and Max on
    // the other, each a chip two cells wider than its label.
    // Minus and plus are as wide as their longest label (`-100`), so the
    // row does not shift when the step changes.
    const stepCells = String(Math.max(...STEPS)).length + 1
    const betColumns = Math.max(
      4,
      columns - 5 - (stepCells + 2) - (stepCells + 2) - 5 - 4,
    )

    // A chip is a one-row filled Button with nothing but its label drawn: a
    // terminal Button that has a hotkey draws brackets or the key too, so
    // the chips' keys are the row of `1: Min` Buttons under the table.
    // Art made of characters, for a surface whose font is not fixed-width:
    // one image set in a fixed-width font. The terminal draws the rows as text.
    const picture = (rows: readonly (readonly Run[])[], alt: string) => {
      if (e.surface === 'terminal') {
        return null
      }

      const { Svg } = $.ui.resolve(e)
      const image = asciiSvg(rows)

      return (
        <Svg
          source={image.source}
          alt={alt}
          width={image.width}
          height={image.height}
        />
      )
    }

    // A thin rule across the pane, where the surface can draw one.
    const divider = () => {
      if (e.surface === 'terminal') {
        return null
      }

      const { Svg } = $.ui.resolve(e)

      return (
        <Box marginTop={1}>
          <Svg source={ruleSvg(IMAGE_INK)} alt="Divider" height={1} />
        </Box>
      )
    }

    const chip = (
      key: string,
      label: string,
      tone: { fill: string; lit: string },
      move: (table: Game) => Game,
      cells?: number,
    ) => {
      if (isTerminal) {
        const text = cells === undefined ? label : centered(label, cells)

        return (
          <Box
            key={`${key}-fill`}
            backgroundColor={tone.fill}
            hover={{ backgroundColor: tone.lit }}
          >
            <Button key={key} plain label={` ${text} `} onPress={play(move)} />
          </Box>
        )
      }

      // Off the terminal a button is as wide as its label, so one whose
      // label changes sits in a slot that fits its longest.
      const button = (
        <Button
          key={key}
          label={label}
          variant={tone === theme.chosen ? 'primary' : 'secondary'}
          onPress={play(move)}
        />
      )

      return cells === undefined ? (
        button
      ) : (
        <Box key={`${key}-slot`} minWidth={cells + 2} justifyContent="center">
          {button}
        </Box>
      )
    }

    // One entry of the key legend, which is also what the key presses: a
    // plain Button draws as `1: Min`, its hotkey in the accent color.
Licence text (MIT)
MIT License

Copyright (c) 2026 michaeldavodovski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

How to build this: Pane (panel), Add a slash command

What its code calls

remembers

What its code shows

Read from the source at commit 954b6bdb6551 on 2026-10-11. The first group decides whether a mod is listed; the rest is for you to weigh. A later commit is not read until the next crawl.

Decides the listing: code you can check
Entry readEvery module hooks/hooks.json names was read.hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.3 files parsed
All its code is in the modEvery import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod
ReadableNo minified lines, no eval or new Function, no import of a computed path, no encoded blobs.no minified code, no eval, no encoded blobs
Calls in the openNetwork and programs are reached as $.http.fetch and $.process.run in place, never passed around.every call outside goes through $ in the open
For you to weigh before installing
Where it drawsThe terminal, the desktop app, both, or nothing (hooks only: a guard or a prompt rewriter), as its code says. Shown, never a reason to leave a mod out.draws in the terminal and the desktop app, the same in both
Install lineWhether its repository's own .claude-plugin/marketplace.json lists it, so it installs from that marketplace with the lines on its page.listed in its repository's .claude-plugin/marketplace.json: installs from there
Programs on WindowsWhether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks
NetworkWhether every fetch names its https host in the code.no network
ProgramsWhether every program it starts is named in the code and is not a shell, an interpreter or a network tool.starts no programs
Reads and sendsWhether it both reads something of yours (files, environment variables, the transcript, settings) and reaches outside (the network, an MCP server, another session, telemetry).reaches nothing outside
Keys in the sourceWhether the source holds what looks like an API key or a private key.no keys in the source
LicenceAn open licence (MIT, Apache-2.0, BSD, ISC, Unlicense, 0BSD, CC0) with its text lets ModsCode show its code; otherwise the code is linked.MIT
Settings hooksHooks declared in hooks/hooks.json or plugin.json beside the module: a command (a shell when it has no args), an HTTP request, an MCP tool or a model prompt at an event. They run outside $.no settings hooks: its function hooks alone
Servers it shipsMCP servers (a program, or a URL; a headersHelper is a shell command; a .mcpb bundle is unpacked at run time), LSP servers, monitors (a shell command for the whole session) and bin/ (on the PATH of the Bash tool).ships no MCP or LSP server, no monitor, no bin/
Skills, commands, agentsWhat its Markdown declares beyond text: allowed-tools granted for the turn, hooks added when a skill is invoked, a command run before Claude reads the skill.no skills, commands, agents or workflows
Tools and MCPWhether every tool it calls through $.tool.call and $.mcp.call is named in the code, and none is a shell (Bash through the tool runs a shell without $.process).calls no tool, MCP server or command
Asks of the modelCompletions it runs ($.model.complete, fork, classify), subagents it spawns, prompts it submits as you, and the tools, commands and agents it adds.adds command blackjack
Events it hooksBy what a hook there can do: gates (refuse a tool call, a prompt, a setting, another plugin), shapes (what the model reads: the system prompt, tool descriptions, each request), reads (your input, the events of the settings hooks, every event with *), and the rest.gates: command.run (blackjack) · reads: classic.SessionStart · also: session.start, turn.start, turn.complete, ui.close (+1) · timers: clock.after
Reads, by nameThe environment variables and files it names, and whether it reads the transcript, settings.json, the prompt box or the mouse selection.reads no files, environment variables, settings or transcript
Writes, by nameThe files and environment variables it names, and whether it changes settings, the prompt box, the clipboard, the conversation (a row the model reads) or another session.writes no files, environment variables, settings or conversation rows

This is a reading of the code text, not a security review: it does not run the mod, and it cannot see what a program the mod starts does. The check before installing is yours. How mods are chosen

Install it

Check it yourself before you install it. Mods run unsandboxed, with your permissions, and ModsCode does not vouch for what this code does. Read its code (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.

From its marketplace

Its repository is its marketplace. Add that marketplace (in the terminal with these commands, or in the desktop app's plugin settings) and install the mod from it:

/plugin marketplace add michaeldavodovski/claude-code-blackjack
/plugin install blackjack@claude-code-blackjack
/reload-plugins

This installs the marketplace's latest commit, which may not be the one read here (954b6bdb6551). Compare them before you install. /reload-plugins loads it into a session that is already open.

Try the commit ModsCode read

No marketplace needed. In a terminal, clone the repository, check out the commit read, validate the mod, and load it for one session:

git clone https://github.com/michaeldavodovski/claude-code-blackjack
git -C claude-code-blackjack checkout 954b6bdb6551a9e4b44e1afbaf224774b8940bf8
claude plugin validate claude-code-blackjack
claude --plugin-dir claude-code-blackjack

The validate line lists the events the mod hooks and what it asks Claude Code to do, without running it. The last line loads the mod for this session only and writes nothing to your settings. If the author has rewritten history, the commit may no longer exist.

Ask Claude about it

With the ModsCode connector added, Claude can read this mod's code and what it reaches, and build on them. Ask it like this:

Read the ModsCode mod "michaeldavodovski-blackjack" with its code and make me one like it

Search them from Claude: the MCP connector

Similar mods

Badge for your README

If this is your mod, paste this into your README. It links to this page.

README.md
[![ModsCode](https://modscode.com/badge/michaeldavodovski-blackjack.svg)](https://modscode.com/claude-mods/mods/michaeldavodovski-blackjack/)