Finish: checks, rebase and merge in one click
A Shuriken chat can work on its own branch. Finish commits what's left, rebases, runs your checks and squash-merges it, then cleans up.
Contents
Running five agents at once is the fun part. The end of each one is not: commit what's left, catch up with main, fix the conflict, run the tests, fix the tests, merge, delete the branch, remove the worktree, close the chat. Five times.
We did that by hand for a while and kept forgetting a step, usually the "delete the branch" one. So we built a button for it. It's called Finish, and it lives in the header of every chat that works on its own branch.
What Finish does, step by step#
In Shuriken, a new chat works in your project folder unless you pick Own branch on the New chat screen. Pick it, and the chat gets its own branch in its own git worktree, so its agent stays out of the files other parallel agents are editing. When the work is done, you press Finish and it:
- waits for the turn to end, so it never merges half a thought;
- commits what's left, with the chat's title as the message (or its first message, when the title is too short to say much);
- catches up with your default branch by rebasing onto it;
- runs your checks;
- squash-merges the branch into your default branch, in your project folder;
- removes the branch and its worktree, and closes the chat.
The nice part is what happens when something goes wrong. A conflict during the rebase, or a check that fails, goes back to that chat's own agent as a message: it knows what it changed, so it's the right one to fix it. Finish then tries again. After three attempts it stops, tells you why in plain words, and leaves the branch in place, unmerged, for you to look at.
Two more safety rails we were glad to have:
- One at a time per repository. If two chats edited the same file, they merge one after the other, and the second one resolves against the first.
- No secrets. If the branch adds something that looks like a secret, Finish refuses and merges nothing.
Your checks live in shuriken.json#
Finish runs whatever you list under checks in shuriken.json, the project file Shuriken keeps at the root of your repository. One command or several:
{
"checks": ["npm run typecheck", "npm test"]
}
Commit the file and every new branch starts with the same checks. When Finish gives up, it names the command that held it up: "The checks still fail: npm test".
Or: a pull request that merges itself#
Some projects want a pull request for every change, with CI as the judge. Finish always merges locally, so for those there's the chat's git menu instead. With a GitHub remote it has Create PR, which pushes the branch and opens the pull request, and Auto merge, which turns on GitHub's auto-merge so it merges once its required checks pass.
It never closes a chat over unmerged work#
This was a rule from early on (it shipped in 0.12.0, on 3 October): a chat only closes once its work is in your default branch, or in a pull request on its way there. If you want the chat back without merging, there's Archive, which takes it out of the list and leaves its branch alone.
There's also Merge into main, keep chat, for when you want the work in now but plan to keep going in the same chat. And branches that were merged but left behind show up under Stale branches, where Delete merged clears them in one go.
The Main chat: quick changes in your project folder#
Renaming a variable doesn't need a branch. Each project has one Main chat that works directly in your project folder, for the small stuff: a rename, a version bump, a quick question about the code. It has nothing to merge, so it has no Finish button. Neither does a new chat left on Project folder.
The rule of thumb we use ourselves: everyday quick work goes to the Main chat. Anything you'd want to run in parallel, or anything risky, gets a new chat on its own branch and a Finish at the end.
For the bigger picture on running several agents side by side, read our guide to running Claude Code agents in parallel. Or skip the reading and try Shuriken: Finish is on every plan.
Frequently asked questions
Where do I tell Shuriken which checks to run?
In shuriken.json at the root of your project, under checks: one command or a list of them, such as your type check and your tests.
What happens when the checks fail?
Finish asks the chat's own agent to fix them and tries again, up to three times. If they still fail, it stops, says which command failed and leaves the branch in place, unmerged.
Does Finish squash my commits?
Yes. A local Finish squash-merges the chat's branch into your default branch, then removes the branch and its worktree.
Can I open a pull request instead of merging locally?
Yes, for a project with a GitHub remote. Finish itself merges locally; the chat's git menu has Create PR, and Auto merge turns on GitHub's auto-merge so it merges once its checks pass.