convez.ai
PluginUtilidadesIntermediário
dragosroua

Tetris Break

dragosroua/compaction-tetris

Tetris no shell para forçar breaks durante LLM compaction

Ver no GitHub
InicialPluginScore · de 0 a 100

Um jogo Tetris minimalista que roda no terminal e interrompe você periodicamente para forçar pausas. Integra-se ao Claude Code durante compactação de contexto, transformando tempo de espera em gameplay.

Instalação

$npx convez-ai dragosroua/compaction-tetris

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
8
Forks
1
Acompanhando
0
Saúde
28%
Último commit
há 5 meses
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Pausas automáticas a cada ~30 minutos de trabalho
  • Ocupar tempo durante compactação de contexto do Claude
  • Gamificar intervalos de descanso em fluxo de desenvolvimento

Veredito

Ferramenta criativa e leve que resolve um problema real: idle durante operações de IA. Sem dependências externas (apenas curses), integração bem pensada com Claude Code via hooks, mas audiência niche (macOS-first, requer setup manual).

README

A tradução para o português deste README ainda está na fila.

tetris-break 🧱🧘

A tiny terminal Tetris that interrupts you (gently) so you actually take breaks. Two triggers:

  1. Random intervals — pops up roughly every 30 minutes (±10 min jitter)
  2. Claude Code compaction — while Claude compacts context, you stack blocks

Zero dependencies. Python 3 stdlib curses only.

Files

FilePurpose
tetris.pyThe game. Run directly: python3 tetris.py --minutes 5
tetris-break.shOpens the game in a new terminal window (iTerm2 or Terminal.app)
tetris-daemon.shLoops forever, fires tetris-break.sh at random ~30 min intervals
com.dragosroua.tetrisbreak.plistOptional launchd agent (survives reboots)

Install

mkdir -p ~/bin/tetris-break
cp tetris.py tetris-break.sh tetris-daemon.sh ~/bin/tetris-break/
chmod +x ~/bin/tetris-break/*.sh

# quick test — should open a new terminal window with the game
~/bin/tetris-break/tetris-break.sh 5

Random 30-minute breaks

Simple version (dies on logout):

nohup ~/bin/tetris-break/tetris-daemon.sh >/dev/null 2>&1 &
# stop with: pkill -f tetris-daemon.sh

Persistent version: see install notes inside the .plist file.

The daemon skips quiet hours (22:00–08:00, edit QUIET_START/QUIET_END) and won't fire when the screen is locked (requires pip3 install pyobjc-framework-Quartz, otherwise the check is silently skipped). It also never stacks windows — if a game is already open, the trigger is a no-op.

Claude Code: play during compaction

Add a PreCompact hook to ~/.claude/settings.json (all projects) or .claude/settings.json (one project). The hook fires right before Claude compacts context — i.e., exactly when you'd otherwise be staring at a spinner:

{
  "hooks": {
    "PreCompact": [
      {
        "matcher": "auto",
        "hooks": [
          {
            "type": "command",
            "command": "~/bin/tetris-break/tetris-break.sh 3"
          }
        ]
      }
    ]
  }
}

Notes:

  • "matcher": "auto" fires only on automatic compaction. Use "manual" for /compact, or omit the matcher to fire on both.
  • The hook can't take over Claude Code's own terminal (hooks are non-interactive), so the game opens in a fresh window. Quit with q whenever Claude is done.
  • If you already have PreCompact hooks (e.g. transcript backup), just append this entry to the existing array — hooks merge.

Controls

← →    move          ↑ / x  rotate CW
z      rotate CCW    ↓      soft drop
space  hard drop     p      pause
q      quit          r      restart (after game over)

--minutes N gives the break a soft timer shown in the sidebar; when it expires the game closes itself and sends you back to work.

Ver o original no GitHub

Bom para

Relacionados