merge
What it does
This skill lands the best result from a multi-agent session and tidies up the rest. It is for people who want the winning code in their project without leftover branches.
When to use it
- ✓When a multi-agent session has finished and you want to keep the winning result.
- ✓When you want to keep the losing attempts without cluttering your branches.
- ✓When you want to clean up the temporary worktrees from a session.
Skill link
https://github.com/alirezarezvani/claude-skills/blob/main/engineering/agenthub/skills/merge/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Merge the winning agent from the latest session and archive the other attempts.”
5 new skills a week. 1 minute to read.
How it works
The agent picks the winner, merges its branch into the base branch, saves each losing branch as a tag and removes the temporary worktrees. It also writes a merge summary to the results channel.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
/agenthub:merge — Merge Winner
Merge the best agent's branch into the base branch, archive losing branches via git tags, and clean up worktrees.
Usage
/agenthub:merge # Merge winner of latest session
/agenthub:merge 20260317-143022 # Merge winner of specific session
/agenthub:merge 20260317-143022 --agent agent-2 # Explicitly choose winner
What It Does
1. Identify Winner
If --agent specified, use that. Otherwise, use the #1 ranked agent from the most recent /agenthub:eval.
2. Merge Winner
git checkout {base_branch}
git merge --no-ff hub/{session-id}/{winner}/attempt-1 \
-m "hub: merge {winner} from session {session-id}
Task: {task}
Winner: {winner}
Session: {session-id}"
3. Archive Losers
For each non-winning agent:
# Create archive tag (preserves commits forever)
git tag hub/archive/{session-id}/{agent-id} hub/{session-id}/{agent-id}/attempt-1
# Delete branch ref (commits preserved via tag)
git branch -D hub/{session-id}/{agent-id}/attempt-1
4. Clean Up Worktrees
python {skill_path}/scripts/session_manager.py --cleanup {session-id}
5. Post Merge Summary
Write .agenthub/board/results/merge-summary.md:
---
author: coordinator
timestamp: {now}
channel: results
---
## Merge Summary
- **Session**: {session-id}
- **Winner**: {winner}
- **Merged into**: {base_branch}
- **Archived**: {loser-1}, {loser-2}, ...
- **Worktrees cleaned**: {count}
6. Update State
python {skill_path}/scripts/session_manager.py --update {session-id} --state merged
Safety
- Confirm with user before merging — show the diff summary first
- Never force-push — merge is always
--no-fffor clear history - Archive, don't delete — losing agents' commits are preserved via tags
- Clean worktrees — don't leave orphan directories on disk
After Merge
Tell the user:
- Winner merged into
{base_branch} - Losers archived with tags
hub/archive/{session-id}/agent-{N} - Worktrees cleaned up
- Session state:
merged
FAQ
Are the losing attempts deleted?
Their branches are removed, but their commits are kept in archive tags.
Can I choose the winner myself?
Yes. You can name a specific agent to merge instead of the top-ranked one.
Where is the merge summary saved?
It is written to the results channel on the agent message board.
Details
Original description by the author
Use to land the winning AgentHub branch, archive the others and clean up worktrees.
Popularity
- GitHub stars
- 29k
- Ranking position
- #9534
- License
- MIT
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
agent-launcher-orchestrator
29kHelps your agent plan, build, test and schedule a Claude managed agent in your own account, step by step, starting from one clear goal.
grade-iterate
29kLets your agent grade a managed AI agent's work against a rubric and improve it in a fixed number of rounds, so it never loops forever.
interview
29kLets your agent interview you about an AI agent idea and turn your answers into a simple build plan before anything is launched.
run-without-you
29kHelps your agent set up a managed AI agent to run on a schedule or when an event happens, with the cron timing checked before launch.
Similar skills
add-model-provider
394kLets your agent connect a new AI model provider to OpenClaw using safe setup commands, keep API keys out of plain text, and run a live test.
acp-router
394kHelps your agent send a task to a coding assistant such as Claude Code or Cursor through OpenClaw, so the work runs in that tool.
browser-automation
394kTeaches your agent to control web pages step by step, including logins, tabs, and recovery when a page stops responding.