Skip to content

MuratKus/sidepot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sidepot

Terminal sidecar that runs beside Claude Code in a split pane. Shows live session status and a poker game driven by your coding lifecycle events.


Install

Via skills.sh (recommended — adds /sidepot skill to any Claude Code session):

npx skills add muratkus/sidepot

One-liner (clones to ~/.sidepot, sets up venv, installs /sidepot skill):

bash -c "$(curl -fsSL https://raw.githubusercontent.com/MuratKus/sidepot/main/install.sh)"

Manually:

git clone https://github.com/MuratKus/sidepot.git ~/.sidepot
cd ~/.sidepot
uv venv --python 3.11
uv pip install -e ".[dev]"

Then type /sidepot in a terminal-based Claude Code session to launch.

Note: /sidepot requires Claude Code in a terminal. Claude Desktop's code panel can't render the TUI — run bash ~/.sidepot/launch.sh claude in a separate terminal instead.


Game modes

Balatro (default)

Roguelike poker inspired by Balatro. Score chips × mult to beat blinds, collect jokers, survive 8 antes.

  • Blinds: Each ante has a target score (300 → 3000). Beat it to advance.
  • Jokers: 12 unique jokers with triggers (always, on test pass, on file change, on hand type, etc.)
  • Shop: Buy jokers between rounds. Reroll for $3.
  • Lives: Start with 3. Lose one per failed blind. Game over at 0.
  • Scoring: base_chips × mult, modified by jokers

Video Poker

Classic Jacks-or-Better. Starting chips: 500, bet: 25.

Hand Payout
Royal Flush 250×
Straight Flush 50×
Four of a Kind 25×
Full House
Flush
Straight
Three of a Kind
Two Pair
Jacks or Better

Hotkeys

Key Action When
15 Toggle hold on card After prompt submitted
D Draw / Play hand After command/tests start
X Discard (Balatro) During play, uses remaining
B/N/M Buy joker 1/2/3 In shop
E Reroll shop In shop ($3)
S Skip shop In shop
R Reset session + game Always
G Switch game mode Always
Q Quit Always

Wiring to Claude Code (live mode)

Each hook sends the raw JSON payload to the sidecar's HTTP endpoint (localhost:4321/events) via curl. The sidecar translates it into a game event — your file edits, commands, and test results drive the poker hand.

Claude Code Hook Matcher Game Event
SessionStart Deal a new hand
UserPromptSubmit Unlock hold (press 1–5)
PreToolUse / PostToolUse Bash (test cmd) tests_started / tests_passed/failed
PostToolUse Write|Edit|MultiEdit Show file changed in session panel
PreToolUse / PostToolUse Bash command_started / command_finished → unlock draw
Notification Pause game (⚠ ATTN)
Stop Auto-score final hand

The hook timeout is 2000ms — if the sidecar isn't running, hooks fail silently. The installer configures hooks automatically. To add them manually, copy from hooks/claude_code.json into ~/.claude/settings.json.


Launch modes

Command Description
./launch.sh claude Split pane, live Claude Code events
./launch.sh Split pane, mock events (demo/dev)
python -m src.main --mode claude Direct launch, live mode
python -m src.main Direct launch, mock mode
python -m src.main --no-tui Print events to stdout (debug)

Running tests

.venv/bin/pytest tests/ -v

133 tests covering deck, hand evaluator, video poker engine, Balatro engine (scoring, jokers, blinds, shop, persistence), session reducer, pause/resume, and Claude Code hook translation.


Project structure

src/
├── main.py              # entry point
├── types/               # all dataclasses and enums
├── events/              # event schema, async bus
├── session/             # pure session state reducer
├── game/                # deck, hand evaluator, balatro engine, jokers
├── adapters/            # mock (timer) + claude_code (HTTP)
├── tui/                 # Textual app + all widgets
└── utils/               # card rendering (Rich markup)
tests/                   # 133 tests
hooks/claude_code.json   # hook config reference

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors