From 1143bf08c9c59030baf13ab51b44ba3fa35769f7 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Tue, 7 Apr 2026 09:21:11 -0700 Subject: [PATCH] Skip AI conflict resolution for lock files Lock files like bun.lock and Cargo.lock contain auto-generated content that Claude cannot meaningfully merge. Remove them during conflict resolution so they get regenerated cleanly. --- src/commands/helpers.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/commands/helpers.ts b/src/commands/helpers.ts index 7a22a02..ef58ac5 100644 --- a/src/commands/helpers.ts +++ b/src/commands/helpers.ts @@ -81,6 +81,9 @@ export async function teardownSession(root: string, branch: string, worktree: st await state.removeSession(root, branch) } +/** Files that should be resolved by accepting "theirs" instead of using Claude. */ +const SKIP_RESOLVE = new Set(["bun.lock", "Cargo.lock"]) + /** Resolve conflict markers in files using Claude, then stage them. */ export async function resolveConflicts( files: string[], @@ -90,6 +93,12 @@ export async function resolveConflicts( for (let i = 0; i < files.length; i++) { const file = files[i] onFile(file, i + 1, files.length) + + if (SKIP_RESOLVE.has(basename(file))) { + await $`git rm -f -- ${file}`.cwd(cwd).nothrow().quiet() + continue + } + const content = await Bun.file(join(cwd, file)).text() const resolved = await vm.claudePipe(