From e64564a045f26755f8f173711b7a56ee772dd956 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Sat, 11 Apr 2026 23:56:48 -0700 Subject: [PATCH] Replace Claude with Pi throughout codebase --- src/cli.ts | 18 +++++++++--------- src/commands/helpers.ts | 10 +++++----- src/commands/list.ts | 6 +++--- src/commands/new.ts | 4 ++-- src/commands/open.ts | 4 ++-- src/commands/rebase.ts | 2 +- src/commands/review.ts | 4 ++-- src/commands/squash.ts | 2 +- src/commands/vm.ts | 2 +- 9 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index bd9465e..297b474 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -35,7 +35,7 @@ const program = new Command() program .name("sandlot") - .description("Sandboxed development with Claude.") + .description("Sandboxed development with Pi.") .configureHelp({ styleTitle: (str) => `${yellow}${str}${reset}` }) .helpOption(false) .addOption(new Option("-h, --help").hideHelp()) @@ -59,19 +59,19 @@ program program .command("new") .argument("[branch]", "branch name or prompt (if it contains spaces)") - .argument("[prompt]", "initial prompt for Claude") - .option("-p, --print ", "run Claude in non-interactive mode with -p") - .option("-n, --no-save", "skip auto-save after Claude exits") - .description("Create a new session and launch Claude") + .argument("[prompt]", "initial prompt for Pi") + .option("-p, --print ", "run Pi in non-interactive mode with -p") + .option("-n, --no-save", "skip auto-save after Pi exits") + .description("Create a new session and launch Pi") .action(newAction) program .command("open") .argument("", "branch name") - .argument("[prompt]", "initial prompt for Claude") - .option("-p, --print ", "run Claude in non-interactive mode with -p") - .option("-n, --no-save", "skip auto-save after Claude exits") - .description("Open an existing Claude session") + .argument("[prompt]", "initial prompt for Pi") + .option("-p, --print ", "run Pi in non-interactive mode with -p") + .option("-n, --no-save", "skip auto-save after Pi exits") + .description("Open an existing Pi session") .action(openAction) program diff --git a/src/commands/helpers.ts b/src/commands/helpers.ts index df08235..d695c8b 100644 --- a/src/commands/helpers.ts +++ b/src/commands/helpers.ts @@ -104,7 +104,7 @@ const SKIP_RESOLVE = new Set([ "yarn.lock", ]) -/** Resolve conflict markers in files using Claude, then stage them. */ +/** Resolve conflict markers in files using Pi, then stage them. */ export async function resolveConflicts( files: string[], cwd: string, @@ -124,13 +124,13 @@ export async function resolveConflicts( throw new Error(`Failed to read conflicted file: ${file}`) }) - const resolved = await vm.claudePipe( + const resolved = await vm.piPipe( content, "resolve this merge conflict. output ONLY the resolved file content with no markdown fences, no explanation, no surrounding text.", ) if (resolved.exitCode !== 0 || !resolved.stdout.trim()) { - throw new Error(`Claude failed to resolve ${file}: ${resolved.stderr.trim() || "(no output)"}`) + throw new Error(`Pi failed to resolve ${file}: ${resolved.stderr.trim() || "(no output)"}`) } await Bun.write(join(cwd, file), resolved.stdout.trimEnd() + "\n") @@ -162,7 +162,7 @@ export async function mergeAndClose(branch: string, opts?: { force?: boolean }): return } - // Resolve conflicts with Claude + // Resolve conflicts with Pi spin.text = `Resolving ${conflicts.length} conflict(s)` try { @@ -210,7 +210,7 @@ export async function saveChanges(worktree: string, branch: string, message?: st spin.text = "Generating commit message" const diff = await $`git -C ${worktree} diff --staged`.nothrow().quiet().text() - const gen = await vm.claudePipe( + const gen = await vm.piPipe( diff, "Write a commit message for this diff. Subject line: imperative mood, max 72 characters, no period. If the changes warrant it, add a blank line then a brief body explaining why, not what. Output only the raw commit message, no quotes or markdown.", ) diff --git a/src/commands/list.ts b/src/commands/list.ts index cb8404d..1659edd 100644 --- a/src/commands/list.ts +++ b/src/commands/list.ts @@ -44,7 +44,7 @@ async function resolveStatus( ): Promise { try { await stat(s.worktree) } catch { return "idle" } if (vmRunning) { - const active = await vm.isClaudeActive(s.worktree, s.branch).catch(() => false) + const active = await vm.isPiActive(s.worktree, s.branch).catch(() => false) if (active && s.in_review) return "review" if (active) return "active" } @@ -58,7 +58,7 @@ async function resolveStatus( } } -/** Clear in_review flags for sessions where Claude is no longer active. */ +/** Clear in_review flags for sessions where Pi is no longer active. */ async function clearStaleReviews( sessions: state.GlobalSession[], statusMap: Map, @@ -79,7 +79,7 @@ async function backfillPrompts(sessions: { worktree: string; prompt?: string }[] if (!vmRunning) return const needsPrompt = sessions.filter(s => !s.prompt) if (needsPrompt.length === 0) return - const result = await vm.exec(homedir() + "/.sandlot", "cat /home/ubuntu/.claude/history.jsonl 2>/dev/null").catch(() => null) + const result = await vm.exec(homedir() + "/.sandlot", "cat /home/ubuntu/.pi/history.jsonl 2>/dev/null").catch(() => null) if (!result || result.exitCode !== 0 || !result.stdout) return const byProject = new Map() diff --git a/src/commands/new.ts b/src/commands/new.ts index ff60a2f..f0379d1 100644 --- a/src/commands/new.ts +++ b/src/commands/new.ts @@ -126,7 +126,7 @@ export async function action( if (opts.print) { spin.text = "Running prompt…" - const result = await vm.claude(worktreeAbs, { prompt, print: opts.print }) + const result = await vm.pi(worktreeAbs, { prompt, print: opts.print }) if (result.output) { spin.stop() process.stdout.write(renderMarkdown(result.output) + "\n") @@ -134,7 +134,7 @@ export async function action( spin.succeed("Done") } } else { - await vm.claude(worktreeAbs, { prompt, print: opts.print }) + await vm.pi(worktreeAbs, { prompt, print: opts.print }) } await vm.clearActivity(worktreeAbs, branch) diff --git a/src/commands/open.ts b/src/commands/open.ts index 81bf8e3..6c99396 100644 --- a/src/commands/open.ts +++ b/src/commands/open.ts @@ -21,7 +21,7 @@ export async function action( if (opts.print) { spin.text = "Running prompt…" - const result = await vm.claude(session.worktree, { prompt, print: opts.print, continue: true }) + const result = await vm.pi(session.worktree, { prompt, print: opts.print, continue: true }) if (result.output) { spin.stop() process.stdout.write(renderMarkdown(result.output) + "\n") @@ -30,7 +30,7 @@ export async function action( } } else { spin.succeed("Session ready") - await vm.claude(session.worktree, { prompt, print: opts.print, continue: true }) + await vm.pi(session.worktree, { prompt, print: opts.print, continue: true }) } await vm.clearActivity(session.worktree, branch) diff --git a/src/commands/rebase.ts b/src/commands/rebase.ts index bb4a764..1dc9f14 100644 --- a/src/commands/rebase.ts +++ b/src/commands/rebase.ts @@ -34,7 +34,7 @@ export async function action(branch: string) { } fetchSpin.stop() - console.log(`◆ Rebase conflicts in ${conflicts.length} file(s). Resolving with Claude...`) + console.log(`◆ Rebase conflicts in ${conflicts.length} file(s). Resolving with Pi...`) const resolveSpin = spinner("Starting container", branch) try { diff --git a/src/commands/review.ts b/src/commands/review.ts index faf6560..5fc481a 100644 --- a/src/commands/review.ts +++ b/src/commands/review.ts @@ -74,11 +74,11 @@ Your thoughts, in brief. try { if (opts.print) { spin.text = "Running review…" - const result = await vm.claude(session.worktree, { print: prompt }) + const result = await vm.pi(session.worktree, { print: prompt }) if (result.output) process.stdout.write(result.output + "\n") } else { spin.succeed("Session ready") - await vm.claude(session.worktree, { prompt }) + await vm.pi(session.worktree, { prompt }) } } finally { spin.stop() diff --git a/src/commands/squash.ts b/src/commands/squash.ts index 764edf9..5ffc9fe 100644 --- a/src/commands/squash.ts +++ b/src/commands/squash.ts @@ -40,7 +40,7 @@ export async function action(branch: string) { process.exit(1) } - const gen = await vm.claudePipe( + const gen = await vm.piPipe( diff, "Write a commit message summarizing all changes. Subject line: imperative mood, max 72 characters, no period. Add a blank line then a concise body with the key changes as bullet points. Output only the raw commit message, no quotes or markdown.", ) diff --git a/src/commands/vm.ts b/src/commands/vm.ts index b1217c6..e42e79f 100644 --- a/src/commands/vm.ts +++ b/src/commands/vm.ts @@ -70,7 +70,7 @@ export function register(program: Command) { sessions.map(async (sess): Promise<[string, string]> => { const key = `${basename(sess.repoRoot)}/${sess.branch}` try { - if (await vm.isClaudeActive(sess.worktree, sess.branch)) return [key, "active"] + if (await vm.isPiActive(sess.worktree, sess.branch)) return [key, "active"] if (await git.isDirty(sess.worktree)) return [key, "dirty"] if (await git.hasNewCommits(sess.worktree)) return [key, "saved"] } catch {}