From 47dc4941b1ef800ddeffe2d8f0a8509149ed2d2f Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Thu, 19 Feb 2026 13:23:11 -0800 Subject: [PATCH 1/2] add `review` command for interactive grumpy code review of a branch --- src/cli.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/cli.ts b/src/cli.ts index eb4b5d6..aeeb227 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -308,6 +308,29 @@ program if (opts.save !== false) await saveChanges(session.worktree) }) +// ── sandlot review ────────────────────────────────────────── + +program + .command("review") + .argument("", "branch name") + .description("Launch an interactive grumpy code review for a branch") + .action(async (branch: string) => { + const root = await git.repoRoot() + const session = await state.getSession(root, branch) + + if (!session) { + console.error(`✖ No session found for branch "${branch}".`) + process.exit(1) + } + + const spin = spinner("Starting container") + await vm.ensure((msg) => { spin.text = msg }) + spin.succeed("Session ready") + + const prompt = "You're a grumpy old senior software engineer. Take a look at the diff between this branch and main, then let me know your thoughts. My co-worker made these changes." + await vm.claude(session.worktree, { prompt }) + }) + // ── sandlot close ─────────────────────────────────────────── const closeAction = async (branch: string) => { From afee01815c287d3995b56762fea4efe2de5d390e Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Thu, 19 Feb 2026 13:24:59 -0800 Subject: [PATCH 2/2] add `--print` flag to `review` command for non-interactive output --- src/cli.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index aeeb227..1f7810f 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -313,8 +313,9 @@ program program .command("review") .argument("", "branch name") + .option("-p, --print", "print the review to stdout instead of launching interactive mode") .description("Launch an interactive grumpy code review for a branch") - .action(async (branch: string) => { + .action(async (branch: string, opts: { print?: boolean }) => { const root = await git.repoRoot() const session = await state.getSession(root, branch) @@ -325,10 +326,18 @@ program const spin = spinner("Starting container") await vm.ensure((msg) => { spin.text = msg }) - spin.succeed("Session ready") const prompt = "You're a grumpy old senior software engineer. Take a look at the diff between this branch and main, then let me know your thoughts. My co-worker made these changes." - await vm.claude(session.worktree, { prompt }) + + if (opts.print) { + spin.text = "Running review…" + const output = await vm.claude(session.worktree, { print: prompt }) + spin.stop() + if (output) process.stdout.write(output + "\n") + } else { + spin.succeed("Session ready") + await vm.claude(session.worktree, { prompt }) + } }) // ── sandlot close ───────────────────────────────────────────