From 97a6a2632a856182a47080f8a257a0e8d6f53a56 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Sun, 15 Mar 2026 23:13:40 -0700 Subject: [PATCH] Improve commit message prompts and use Opus model --- src/commands/helpers.ts | 6 +++--- src/vm.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/helpers.ts b/src/commands/helpers.ts index a5dc0c5..7a22a02 100644 --- a/src/commands/helpers.ts +++ b/src/commands/helpers.ts @@ -173,10 +173,10 @@ async function squashCommit(branch: string, cwd: string): Promise { if (diff.trim()) { const gen = await vm.claudePipe( diff, - "write a single-line commit message for these changes, max 50 characters. no body, no blank line, just the subject. output only the message, no quotes or extra text.", + "Write a commit message summarizing all changes in this squash merge. 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.", ) if (gen.exitCode === 0 && gen.stdout.trim()) { - await git.commit(gen.stdout.trim().split("\n")[0], cwd) + await git.commit(gen.stdout.trim(), cwd) return } } @@ -209,7 +209,7 @@ export async function saveChanges(worktree: string, branch: string, message?: st const gen = await vm.claudePipe( diff, - "write a single-line commit message for these changes, max 50 characters. no body, no blank line, just the subject. output only the message, no quotes or extra text.", + "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.", ) if (gen.exitCode !== 0) { diff --git a/src/vm.ts b/src/vm.ts index 498bfe8..d237faa 100644 --- a/src/vm.ts +++ b/src/vm.ts @@ -386,7 +386,7 @@ export async function claudePipe(input: string, prompt: string): Promise<{ exitC await Bun.write(tmpPath, input) return await exec( join(homedir(), '.sandlot'), - `cat /sandlot/${tmpName} | claude -p "${prompt.replace(/"/g, '\\"')}"`, + `cat /sandlot/${tmpName} | claude --model claude-opus-4-6 -p "${prompt.replace(/"/g, '\\"')}"`, ) } finally { await Bun.file(tmpPath).unlink().catch(() => {})