Who it is forA developer finishing an agent's branch who wants it merged and cleaned up without several git commands.
The problemFinishing a worktree by hand means commit, rebase, merge, then remove the worktree and branch.
The outcomeThe change merged to main with a generated commit message and the worktree removed.
What you need first
- git
- Homebrew or Cargo to install
- Shell integration via `wt config shell install` so commands can change directories
- An agent such as Claude Code or Codex
Steps
- Run
wt merge mainfrom the worktree - It generates a commit message, merges the commit to main and removes the worktree and branch in the background
- For a PR workflow instead run
wt step commit, thengh pr create - After the PR is merged run
wt remove
Prompt for your agent
In the worktree for <branch>, run `wt merge main` and show me the output. If I prefer a PR, use `wt step commit`, `gh pr create` and later `wt remove`.
Caveat. Commit message generation relies on a configured LLM; see the LLM commit messages docs.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for max-sixty/worktrunk and "Merge a finished worktree back to main in one command"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer