/hub:merge — Merge Winner
SkillDev toolsThis skill lets your agent wrap up an AgentHub session by landing the winner. It merges the winning agent's git branch into the base branch, archives the losing branches, and cleans up leftover worktrees so the session ends tidy.
Available today. Use it from your connected AI after setup.
No other account needed.
After adding it, ask your agent to merge the winning result or run /hub:merge when you are ready to land the best outcome and tidy up the session.
Then ask your AI: use the /hub:merge — Merge Winner skill
What your AI can do with it
- Merge the winning agent's git branch into the base branch
- Archive the branches from losing agents
- Clean up leftover worktrees
- Land an AgentHub result when you ask for it
What this skill tells your AI
The instructions your AI receives, as published by che-incubator/che-code in code/src/vs/sessions/skills/merge/SKILL.md and read by ahel’s review.
Merge the best agent's branch into the base branch, archive losing branches via git tags, and clean up worktrees.
Usage
/hub:merge # Merge winner of latest session
/hub:merge 20260317-143022 # Merge winner of specific session
/hub: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 /hub: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
Signals
- GitHub stars
- 35
- Forks
- 50
- Last commit
- Sep 2026
- Hacker News mentions
- 20
Advanced
- Catalog kind
- skill
- Gateway key
merge- Source
- github.com/che-incubator/che-code