pr-fitness
v0.1.1
Published
Get fit one PR at a time. Assigns calisthenics exercises when you create pull requests.
Maintainers
Readme
PR Fitness
Get fit one PR at a time. A CLI tool that assigns calisthenics exercises every time you create a pull request in Claude Code.
How It Works
- Create a pull request in Claude Code
- PR Fitness assigns you an exercise (fires before PR creation, non-blocking)
- Do the exercise, log what you completed
On your first PR each day, you pick your exercise for the day (random is the default option). Every subsequent PR that day assigns reps of your chosen exercise. Rep counts adapt to your history — the first few sessions use defaults, then the system learns from what you've actually completed.
Install
npm install -g pr-fitnessQuick Start
pr-fitness setupThis walks you through two things:
- Equipment — Select what you have (pull-up bar, resistance bands, weights) to unlock additional exercises. No equipment? No problem — the defaults are all bodyweight.
- Claude Code hook — Installs a hook so exercises are assigned automatically when you create PRs. This is the key step. Without it, you'd have to remember to run
pr-fitness promptmanually.
Commands
pr-fitness setup
Initial setup. Configures your exercise pool and installs the Claude Code hook.
pr-fitness prompt
Get your exercise assignment. On the first PR of the day, shows a menu to pick your exercise. After that, assigns reps.
pr-fitness choose <exercise>
Lock in your exercise for the day. Use an exercise name or random.
pr-fitness choose push-ups
pr-fitness choose randompr-fitness log
Record a completed exercise.
pr-fitness log --exercise push-ups --assigned 10 --completed 12
pr-fitness log --exercise plank --assigned 20 --completed 20 --unit secondsOutput: Logged! Back to work.
pr-fitness history
View your exercise log.
pr-fitness history # today
pr-fitness history -p week # this week
pr-fitness history -p sprint # current sprint
pr-fitness history -p all # everythingpr-fitness stats
View your exercise balance (banked vs. owed).
pr-fitness stats # this week
pr-fitness stats -p today
pr-fitness stats -p sprintpr-fitness config
Update preferences without re-running setup.
pr-fitness config --tone encouraging
pr-fitness config --equipment pull-up-bar,bands
pr-fitness config --sprint-length 21pr-fitness reset
Clear exercise data.
pr-fitness reset # reset balances to zero
pr-fitness reset --all # clear all data (keeps profile)Exercises
Default (bodyweight):
- Push-ups (5-15 reps)
- Sit-ups (10-20 reps)
- Squats (10-15 reps)
- Lunges (10-20 reps, alternating legs)
- Plank (15-30 seconds)
With pull-up bar:
- Pull-ups (3-8 reps)
- Hanging leg raises (5-10 reps)
With resistance bands:
- Band rows (8-12 reps)
- Band pull-aparts (10-15 reps)
With weights/dumbbells:
- Dumbbell curls (8-12 reps)
- Overhead press (5-10 reps)
How the Claude Code Hook Works
During setup, PR Fitness installs a Claude Code PreToolUse hook at ~/.claude/hooks.json. The hook fires before PR creation (non-blocking) — it reads tool input as JSON from stdin via jq to detect gh pr create calls, then runs pr-fitness prompt.
You can inspect the hook manually:
cat ~/.claude/hooks.jsonIf you skipped hook installation during setup, you can trigger exercises manually:
pr-fitness promptData Storage
All data is stored locally at ~/.pr-fitness/data.json. Nothing is sent to any server.
Set PR_FITNESS_DIR to use a custom location:
export PR_FITNESS_DIR=/path/to/custom/dirDevelopment
git clone https://github.com/DomGme/pr-fitness.git
cd pr-fitness
npm install
npm link # makes pr-fitness available globally
npm test # run tests
npm run test:watch # watch modeLicense
MIT
