Cette page est affichée en anglais. Une traduction française est en cours.
SkillsApr 28, 2026·2 min de lecture

/babysit — Auto-Respond to PR Review Comments

Open-source slash command that watches a PR for review comments and auto-pushes fixes. Inspired by Boris Cherny's /babysit pattern.

Introduction

/babysit is Boris Cherny's "I'm in a meeting, let Claude handle the PR" pattern. After opening a PR, instead of context-switching every time a reviewer pings, /babysit watches the PR, classifies each new comment, fixes simple code-change requests in place, replies to questions with code references, and pushes the amendments — autonomously.

The kicker: it knows what NOT to autonomously fix. Architectural pushback, design questions, security concerns -> escalates. Typo fixes, naming nits, missing tests -> handles itself.

Works with: Claude Code 1.x, GitHub CLI (gh).


How /babysit Works

Save to .claude/commands/babysit.md:

---
description: Watch a PR for review comments and auto-respond/fix
argument-hint: [PR number] [--poll <minutes>] [--no-push]
---

You will monitor a PR and respond to review comments. Loop until merged or cancelled.

1. Identify target PR:
   - $ARGUMENTS first token if numeric, else use `gh pr view --json number -q .number`.
   - Stop if not on a branch with an open PR.

2. Poll interval (default 5 minutes):
   - Read `--poll N` from $ARGUMENTS, else default 5.
   - Cap minimum at 2 minutes (rate-limit friendly).

3. Each tick:
   - `gh pr view <num> --json reviews,comments,reviewDecision,merged`.
   - If `merged: true`, stop. If `reviewDecision: APPROVED` and no unresolved comments, stop.
   - For each new review/comment since the last tick, classify:

   | Class | Examples | Action |
   |---|---|---|
   | code-fix | "rename foo to bar", "add a null check on line 42", "missing test" | Edit, commit, push |
   | reply | "Why did you choose X?", "Can you explain Y?" | Post a `gh pr comment` reply with code reference |
   | escalate | "I think we should rearchitect this", "this has security implications" | Post "Tagging @<user> — needs human input" + stop the loop |
   | non-actionable | "Nice!", "LGTM after this", reactions | Skip |

4. After any code-fix:
   - Re-run the project's pre-commit checks (lint + typecheck).
   - Commit with message `fix(review): <comment summary>` (NEVER amend).
   - Push to the PR branch.
   - Reply on the comment thread: "Fixed in <new_sha>."

5. Output a one-line status each tick: `tick N — <action> — next: <ISO>`.

## Boundaries

- Never amend a previously published commit.
- Never push to main/master.
- Never resolve a review thread without code-fix or human reply.
- Hard cap: 24 hours. After that, escalate and stop.
- If `--no-push` is passed, only post replies — never commit/push.
- Stop the loop AND notify on any escalate-class comment.

Example session

You:    "/babysit 482"
Claude: -> tick 1: 0 new comments, sleep 5min
        -> tick 2: 1 new comment "rename `tmpUsers` to `activeUsers`"
                  Class: code-fix
                  Edited src/admin/audit.ts, ran lint+typecheck, pushed a3b4c5d
                  Replied: "Fixed in a3b4c5d."
        -> tick 3: 1 new comment "Why are we storing the full event payload?"
                  Class: reply
                  Posted: "Storing full payload because compliance requires retroactive
                          query support for 90 days; see src/audit/schema.ts:18 comment."
        -> tick 8: review approved, 0 unresolved -> stopping.

Escalation case:

        -> tick 5: 1 new comment "I think we should split this into two PRs"
                  Class: escalate
                  Posted: "Tagging @williamwang — needs human input on PR scope."
                  Stopping loop.

FAQ

Q: Will it amend my commits? A: Never. Each fix is a new commit (fix(review): ...). Amending published commits loses history.

Q: Will it merge the PR? A: No — never auto-merges. Stops when approved or cancelled, lets you press merge.

Q: What's the cap? A: 24 hours per /babysit invocation. Long PRs need re-invocation.

Q: Does it handle non-English review comments? A: Yes — Claude classifies regardless of language. The reply will match the comment's language.

Q: Is this Boris's actual /babysit? A: No — community-written equivalent. The pattern is from his public description.


🙏

Source et remerciements

Inspired by Boris Cherny's /babysit slash command on howborisusesclaudecode.com.

Citations:

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires