Tetris Break
dragosroua/compaction-tetris
Tetris no shell para forçar breaks durante LLM compaction
Ver no GitHubUm 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-tetris1 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
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:
- Random intervals — pops up roughly every 30 minutes (±10 min jitter)
- Claude Code compaction — while Claude compacts context, you stack blocks
Zero dependencies. Python 3 stdlib curses only.
Files
| File | Purpose |
|---|---|
tetris.py | The game. Run directly: python3 tetris.py --minutes 5 |
tetris-break.sh | Opens the game in a new terminal window (iTerm2 or Terminal.app) |
tetris-daemon.sh | Loops forever, fires tetris-break.sh at random ~30 min intervals |
com.dragosroua.tetrisbreak.plist | Optional 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
qwhenever 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.