Workout Gate 🏋️
Your AI works hard, so should you.
A Claude Code and Codex hook that blocks your prompt until you work out —
push-ups or squats, counted live via webcam. When a challenge fires you pick
your pain (say 6 push-ups or 9 squats). Random reps, session-persistent debt
(no closing the tab to skip), streak stats, and three trigger modes.
Version française : README.fr.md · made by @Botchet
Requirements
- Python 3.9–3.13 — including the macOS system Python 3.9, so there's no newer Python to install.
- A webcam + an internet connection (first run downloads MediaPipe/OpenCV and a ~9 MB pose model).
- macOS for the zero-config plugin onboarding — it pops the setup in a Terminal and triggers the camera-permission dialog. Linux/Windows work too; Claude just points you at
bootstrap.sh to run once by hand.
git and python3 on your PATH.
Install
As a Claude Code plugin (CLI + desktop, recommended)
/plugin marketplace add BotchetDig/workout-gate
/plugin install workout-gate@workout-gate
Then start a new session (or run /reload-plugins) — nothing happens
until you do. The plugin works in Claude Code CLI and desktop. Onboarding pops
up in a Terminal window on its own — dependencies install, then a 30-second
wizard (your max, trigger choice, a 2-pushup camera test). Until setup is done,
prompts pass freely. The gate and /workout-gate:workout then work in every
session, and plugin updates never break the install (the runtime lives in
~/.workout-gate/).
Also works in Codex (CLI + desktop)
The gate uses the same UserPromptSubmit hook in Codex — CLI and desktop.
From Codex, open /plugins, add the BotchetDig/workout-gate marketplace if
needed, then install workout-gate. Codex shows the hook review separately, so
approve the plugin hooks once with /hooks before testing a prompt.
Prefer terminal commands? After setup, wire it into all your Codex sessions:
workout codex on # adds the hook to ~/.codex/hooks.json
workout codex off # remove it
If workout is not on your PATH yet, use the installed launcher directly:
~/.workout-gate/app/workout codex on
Heads-up: workout global on wires both Claude Code and Codex when it sees
~/.codex, because you're gating your AI usage, not one tool. Verified working
across all four surfaces — Claude Code CLI and desktop, Codex CLI and desktop.
Everything is shared across tools: one runtime in ~/.workout-gate/ holds
your debt, prompt counter, stats and streak. Dodge a challenge in Claude Code
and the debt blocks your next Codex prompt. Concurrent prompts from two tools
can't double-trigger (the counter is locked) and never open two webcam windows
at once (a challenge already running elsewhere just lets the other prompt
through). On macOS desktop flows that run hooks without a controlling terminal,
the challenge opens in a Terminal window so the camera prompt attaches to
Terminal — force it either way with WORKOUT_GATE_TERMINAL=1 / 0.
One line, without the plugin
curl -fsSL https://raw.githubusercontent.com/BotchetDig/workout-gate/main/get.sh | bash
Re-running the same line updates the install. Prefer to look around first?
git clone https://github.com/BotchetDig/workout-gate.git && cd workout-gate
./install.sh
The installer sets everything up (venv, dependencies, pose model) then walks
you through a 30-second wizard: it asks your one-set max to size the
challenges to you (25–50% of it), lets you pick a trigger, offers the global
install, and runs a 2-pushup camera test so the macOS permission dialog
happens now — not in the middle of your first gated prompt.
Re-run the wizard anytime with workout setup. Use ./install.sh --no-setup
for a non-interactive install with defaults (every 15 prompts, 5–10 reps).
Usage
Drive it with ! workout from inside Claude Code (the ! prefix runs a shell
command — instant, zero tokens), or just workout from any terminal. Codex
CLI does not have Claude's ! shell shortcut, so use a terminal for settings
commands like workout on, workout off, and workout status.