Skip to content
Back to search

workout-gate

A Claude Code hook that blocks your prompt until you do your push-ups, counted live via webcam. Random reps, session-persistent debt (no closing the tab to skip), streak stats, and three trigger modes. Your AI works hard, so should you.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/botchetdig--workout-gate/badge.svg)](/listings/botchetdig--workout-gate)

HTML

<a href="/listings/botchetdig--workout-gate"><img src="/api/listings/botchetdig--workout-gate/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

These steps run a script from the network that findsafeskills does not scan.

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).

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 13 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. {
  2. "name": "workout-gate",
  3. "owner": {
  4. "name": "BotchetDig"
  5. },
  6. "plugins": [
  7. {
  8. "name": "workout-gate",
  9. "source": "./",
  10. "description": "Exercise before prompts: a webcam-counted challenge (push-ups or squats) gates your Claude Code prompts."
  11. }
  12. ]
  13. }
README.md · README · 267 lines · 1 finding marked

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Workout Gate 🏋️
  2. > Your AI works hard, so should you.
  3. <p align="center">
  4. <img src="assets/demo.gif" alt="Workout Gate — push-ups gate your AI coding prompts" width="640">
  5. </p>
  6. A Claude Code and Codex hook that blocks your prompt until you work out —
  7. push-ups or squats, counted live via webcam. When a challenge fires you pick
  8. your pain (say 6 push-ups *or* 9 squats). Random reps, session-persistent debt
  9. (no closing the tab to skip), streak stats, and three trigger modes.
  10. *Version française : [README.fr.md](README.fr.md) · made by [@Botchet](https://x.com/Botchet)*
  11. ## Requirements
  12. - **Python 3.9–3.13** — including the macOS system Python 3.9, so there's no newer Python to install.
  13. - A **webcam** + an internet connection (first run downloads MediaPipe/OpenCV and a ~9 MB pose model).
  14. - **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.
  15. - `git` and `python3` on your PATH.
  16. ## Install
  17. ### As a Claude Code plugin (CLI + desktop, recommended)
  18. ```
  19. /plugin marketplace add BotchetDig/workout-gate
  20. /plugin install workout-gate@workout-gate
  21. ```
  22. Then **start a new session** (or run `/reload-plugins`) — nothing happens
  23. until you do. The plugin works in Claude Code CLI and desktop. Onboarding pops
  24. up in a Terminal window on its own — dependencies install, then a 30-second
  25. wizard (your max, trigger choice, a 2-pushup camera test). Until setup is done,
  26. prompts pass freely. The gate and `/workout-gate:workout` then work in every
  27. session, and plugin updates never break the install (the runtime lives in
  28. `~/.workout-gate/`).
  29. ### Also works in Codex (CLI + desktop)
  30. The gate uses the same `UserPromptSubmit` hook in **Codex** — CLI and desktop.
  31. From Codex, open `/plugins`, add the `BotchetDig/workout-gate` marketplace if
  32. needed, then install `workout-gate`. Codex shows the hook review separately, so
  33. approve the plugin hooks once with `/hooks` before testing a prompt.
  34. Prefer terminal commands? After setup, wire it into all your Codex sessions:
  35. ```bash
  36. workout codex on # adds the hook to ~/.codex/hooks.json
  37. workout codex off # remove it
  38. ```
  39. If `workout` is not on your PATH yet, use the installed launcher directly:
  40. ```bash
  41. ~/.workout-gate/app/workout codex on
  42. ```
  43. Heads-up: `workout global on` wires both Claude Code *and* Codex when it sees
  44. `~/.codex`, because you're gating your AI usage, not one tool. Verified working
  45. across all four surfaces — Claude Code CLI and desktop, Codex CLI and desktop.
  46. Everything is **shared across tools**: one runtime in `~/.workout-gate/` holds
  47. your debt, prompt counter, stats and streak. Dodge a challenge in Claude Code
  48. and the debt blocks your next Codex prompt. Concurrent prompts from two tools
  49. can't double-trigger (the counter is locked) and never open two webcam windows
  50. at once (a challenge already running elsewhere just lets the other prompt
  51. through). On macOS desktop flows that run hooks without a controlling terminal,
  52. the challenge opens in a Terminal window so the camera prompt attaches to
  53. Terminal — force it either way with `WORKOUT_GATE_TERMINAL=1` / `0`.
  54. ### One line, without the plugin
  55. ```bash
  56. curl -fsSL https://raw.githubusercontent.com/BotchetDig/workout-gate/main/get.sh | bash
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 76 on GitHub
  57. ```
  58. Re-running the same line updates the install. Prefer to look around first?
  59. ```bash
  60. git clone https://github.com/BotchetDig/workout-gate.git && cd workout-gate
  61. ./install.sh
  62. ```
  63. The installer sets everything up (venv, dependencies, pose model) then walks
  64. you through a 30-second wizard: it asks your one-set max to size the
  65. challenges to you (25–50% of it), lets you pick a trigger, offers the global
  66. install, and runs a 2-pushup camera test so the macOS permission dialog
  67. happens now — not in the middle of your first gated prompt.
  68. Re-run the wizard anytime with `workout setup`. Use `./install.sh --no-setup`
  69. for a non-interactive install with defaults (every 15 prompts, 5–10 reps).
  70. ## Usage
  71. Drive it with `! workout` from inside Claude Code (the `!` prefix runs a shell
  72. command — instant, **zero tokens**), or just `workout` from any terminal. Codex
  73. CLI does not have Claude's `!` shell shortcut, so use a terminal for settings
  74. commands like `workout on`, `workout off`, and `workout status`.
  75. | Command | Effect |
  76. |---|---|
  77. | `! workout` | open the web dashboard (settings + live stats) in your browser |
  78. | `! workout tui` | the terminal dashboard instead (curses, arrow keys) |
  79. | `! workout now` | force a challenge right now (great for filming) |
  80. | `! workout stats` | per-exercise totals + 7-day chart (arrow keys to switch exercise in a real terminal) |
  81. | `! workout status` | gate state (counter, debt, settings) |
  82. | `! workout on` / `off` | enable / disable |
  83. | `! workout stop` | close a running challenge window |
  84. | `! workout preset chill\|demo\|hardcore` | see presets below |
  85. | `! workout enable\|disable squats` | turn an exercise on/off |
  86. | `! workout set reps squats 8 15` | rep range for one exercise |
  87. | `! workout set mode choice\|random` | pick the exercise yourself, or at random |
  88. | `! workout debug on\|off` | overlay the detected skeleton + live joint angle (handy when adding exercises) |
  89. | `! workout set freq 15` | one challenge every 15 prompts |
  90. | `! workout set time 30` | time-based: at most one challenge per 30 min |
  91. | `! workout set chance 10` | roulette: 10% chance on every prompt |
  92. > There's also a `/workout-gate:workout` slash command, but it routes through
  93. > Claude and costs tokens — prefer `! workout` for everything above.
  94. ### Dashboard
  95. `! workout` (or `workout` in a terminal) opens the **web dashboard** in your
  96. browser. It's organised in **tabs**: an **Overview** tab (all the settings —
  97. preset, trigger, gate on/off — plus combined stats) and **one tab per
  98. exercise**, each with its own enable toggle, rep range, today/total counters and
  99. 7-day chart. Add an exercise (one entry in `detector.py`) and its tab appears on
  100. its own. A "force a challenge" button is one click away. It's a tiny local-only
  101. server (stdlib, no dependencies, bound to `127.0.0.1`) that shuts itself down a
  102. few minutes after you close the tab.
  103. Prefer the terminal? `! workout tui` opens the curses **settings** dashboard
  104. (arrow keys to navigate, left/right to change values), and `! workout stats` is
  105. the dedicated **stats** viewer (←/→ cycles through ALL + each exercise: total,
  106. streak, record, 7-day chart). Both pop up in a Terminal window on macOS; the
  107. webcam challenge itself is unchanged everywhere.
  108. ### Presets
  109. - **chill** — every 25 prompts, 3–6 reps. Everyday use.
  110. - **demo** — every single prompt, 5–8 reps. Filming mode.
  111. - **hardcore** — every 5 prompts, 15–25 reps. You asked for it.
  112. ## How it works
  113. - A `UserPromptSubmit` hook counts your prompts. When a challenge is due, it
  114. draws a random rep count, **persists the debt to disk first**, opens the
  115. webcam window and freezes your prompt until you're done. Then the prompt
  116. sends itself.
  117. - Detection: MediaPipe Pose. Push-ups from the elbow angle (**profile view,
  118. on the floor**, body horizontal); squats from the knee angle (**stand in
  119. full view, side-on**, body upright). One rep = full descent then full
  120. extension, with smoothing and a posture guard so you can't cheat.
  121. - When more than one exercise is enabled, the challenge offers a choice
  122. ("pick your pain") — or picks at random in `mode random`.
  123. - The challenge window names whoever's paying right now — **CLAUDE** or
  124. **CODEX** — same trash-talk voice, just the tag.
  125. - Every rep is written to disk the moment it happens (atomic writes): quit at
  126. 4/8 and you keep 4 in the stats, with 4 still owed next session.
  127. - **Blocking by default**: an aborted challenge holds your prompt until you
  128. finish (resend to retry). Flip *Challenge mode* to non-blocking in the
  129. dashboard and the webcam still counts your reps, but closing it always lets
  130. the prompt through.
  131. - Data lives in `~/.workout-gate/`: `config.json`, `state.json`, `stats.json`,
  132. `gate.log`.
  133. ## Escape hatches (anti-lockout, by design)
  134. 1. `workout off` from any terminal — the universal off switch (works no matter
  135. which tool you're in).
  136. 2. Gate-management prompts are never blocked, so you can always reach the gate:
  137. `/workout ...` in Claude Code, or the bare `workout ...` / `wg ...` forms
  138. in Codex CLI. They may still cost a model turn in Codex; use a terminal for
  139. zero-token control.
  140. 3. `WORKOUT_GATE_OFF=1` env var bypasses everything.
  141. 4. A challenge already running in another tool/session → this prompt fails open
  142. (no second webcam window).
  143. 5. **Fail-open**: no webcam, broken dependency, any crash → your prompt goes
  144. through and the error lands in `~/.workout-gate/gate.log`. You can never be
  145. locked out of your own tool.
  146. ## Global install
  147. By default the gate only fires in this folder. To gate **every** Claude Code
  148. session on your machine (the plugin install does this for you):
  149. ```bash
  150. ./install.sh --global # or: workout global on
  151. workout global off # to remove
  152. ```
  153. This surgically adds one hook entry to `~/.claude/settings.json` (a backup of
  154. your original file is kept next to it) and removes exactly that on `off`.
  155. Takes effect in new sessions.
  156. For Codex CLI without the plugin, use:
  157. ```bash
  158. workout codex on
  159. workout codex off
  160. ```
  161. Then approve the hook once with `/hooks` in a new Codex CLI session.
  162. ## Tests
  163. ```bash
  164. .venv/bin/python -m unittest discover -s tests
  165. ```
  166. ## Statusline segment (optional)
  167. Show your reps right in the Claude Code statusline. `workout statusline` prints
  168. a compact self-colored segment — `🏋 36 🔥4d` (today's reps + day streak).
  169. Claude Code runs one statusline command (`statusLine` in `settings.json`). If
  170. you already have a statusline script, append the segment to its output:
  171. ```sh
  172. # near the end of your statusline script, before the final printf
  173. WG="$HOME/.local/bin/workout"
  174. [ -x "$WG" ] && wg=$("$WG" statusline 2>/dev/null)
  175. # ...then add ${wg:+ $wg} to your printf
  176. ```
  177. Or, for a statusline that's *only* the workout segment, set in
  178. `settings.json`:
  179. ```json
  180. "statusLine": { "type": "command", "command": "workout statusline" }
  181. ```
  182. ## Add your own exercise (forking)
  183. Everything routes through one registry, `detector.EXERCISES`. Adding an
  184. exercise is two steps in `workout_gate/detector.py` and nothing else:
  185. 1. **A counter** — subclass `ExerciseCounter`, declare the joint angle to
  186. track and the down/up thresholds (override `posture()` to reject bad form):
  187. ```python
  188. class SitupCounter(ExerciseCounter):
  189. SIDES = ((L_HIP, L_SHOULDER, L_KNEE), (R_HIP, R_SHOULDER, R_KNEE))
  190. DOWN_ANGLE = 55.0 # torso folded
  191. UP_ANGLE = 110.0 # lying back
  192. ```
  193. 2. **A registry entry**:
  194. ```python
  195. "situps": {
  196. "label": "SIT-UPS", "counter": SitupCounter,
  197. "cue": "LIE DOWN - SIDE-ON",
  198. "default_reps": (8, 15), "default_max": 30,
  199. },
  200. ```
  201. Config defaults, presets, the setup wizard, the dashboard, the choice screen
  202. and per-exercise stats all read the registry — they pick it up automatically.
  203. Run the tests (`test_factory.py` proves a new entry flows end-to-end).
  204. ---
  205. Built by **[@Botchet](https://x.com/Botchet)**. If Workout Gate made you sweat,
  206. a follow is appreciated. 🏋️
get.sh · Bundled script · 31 lines · 1 finding marked
  1. #!/bin/sh
  2. # Workout Gate one-line installer:
  3. # curl -fsSL https://raw.githubusercontent.com/BotchetDig/workout-gate/main/get.sh | bash
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 3 on GitHub
  4. #
  5. # Clones (or updates) the app into ~/.workout-gate/app and runs the installer.
  6. set -eu
  7. REPO_URL="${WORKOUT_GATE_REPO:-https://github.com/BotchetDig/workout-gate.git}"
  8. APP_DIR="${WORKOUT_GATE_APP_DIR:-$HOME/.workout-gate/app}"
  9. command -v git >/dev/null 2>&1 || { echo "error: git is required"; exit 1; }
  10. command -v python3 >/dev/null 2>&1 || { echo "error: python3 (3.10+) is required"; exit 1; }
  11. if [ -d "$APP_DIR/.git" ]; then
  12. echo "==> Updating existing install in $APP_DIR"
  13. git -C "$APP_DIR" pull --ff-only
  14. else
  15. echo "==> Installing Workout Gate into $APP_DIR"
  16. mkdir -p "$(dirname "$APP_DIR")"
  17. git clone --depth 1 "$REPO_URL" "$APP_DIR"
  18. fi
  19. # When run as `curl | bash`, stdin is the script itself - reattach the real
  20. # terminal so the setup wizard stays interactive.
  21. if [ -t 0 ]; then
  22. exec "$APP_DIR/install.sh"
  23. elif (exec </dev/tty) 2>/dev/null; then
  24. exec "$APP_DIR/install.sh" </dev/tty
  25. else
  26. exec "$APP_DIR/install.sh" --no-setup
  27. fi

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.