worktree-resolve

worktree-resolve is a skill for Claude Code from jmylchreest/aide. It costs 14 tokens per session (2,036 once invoked), scanned A, original, MIT.

A procedure for merging Git worktrees after a group of coding agents has finished. A Git worktree is a separate working directory connected to another branch.

In plain words
What is it for?
Use it to inspect active worktrees, test completed branches, run linting, and merge eligible swarm branches.
Why use it?
It helps bring completed agent changes into the main branch while checking their tests and status first.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./.aide/bin/aide message send --from=resolver --to=orchestrator "CONFLICT: Cannot merge feat/<name> - <brief reason>".

Part of the aide plugin — 25 skills, 9 agents shipped together

Good fit Use it to inspect active worktrees, test completed branches, run linting, and merge eligible swarm branches.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/jmylchreest/aide
agentmods
npx agentmods add skills/jmylchreest/aide/worktree-resolve

Made for: Claude Code.

Or install aide, the plugin that ships this one along with the rest of its 25 skills, 9 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for worktree-resolve

README.md
[![agentmods](https://agentmods.dev/badge/skills/jmylchreest/aide/worktree-resolve.svg)](https://agentmods.dev/skills/jmylchreest/aide/worktree-resolve)
Your own site
<a href="https://agentmods.dev/skills/jmylchreest/aide/worktree-resolve"><img src="https://agentmods.dev/badge/skills/jmylchreest/aide/worktree-resolve.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,036 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 239
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Memory Poisoning · line 238
    Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
    Fix: Protect agent memory and state from modification by untrusted content. Use read-only memory for critical instructions and validate all state changes.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00014 $0.02036
Opus 5 $0.00007 $0.01018
Sonnet 5 $0.00003 $0.00407
Haiku 4.5 $0.00001 $0.00204

Measured 8d ago against content hash fedbcff8ebb0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

worktree-resolve scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/worktree-resolve/SKILL.md · 359 lines

How it starts

The opening of the file, as written. The whole thing — 359 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Worktree Resolution

Recommended model tier: balanced (sonnet) - this skill performs straightforward operations

Merge all swarm worktrees back into the main branch after testing.

Workflow

1. List Active Worktrees

git worktree list

Check the AIDE worktree state file for metadata and status:

cat .aide/state/worktrees.json

Worktree Status Values:

  • active - Agent is still working on this worktree
  • agent-complete - Agent finished, ready for merge review
  • merged - Successfully merged to main

Only merge worktrees with status agent-complete.

Example state file:

{
  "active": [
    {
      "name": "story-auth",
      "path": ".aide/worktrees/story-auth",
      "branch": "feat/story-auth",
      "taskId": "story-auth",
      "agentId": "agent-auth",
      "status": "agent-complete",
      "createdAt": "2026-02-07T...",
      "completedAt": "2026-02-07T..."
    }
  ],
  "baseBranch": "main"
}

2. For Each Worktree Branch

Run these steps for every feat/* branch from swarm:

a) Test the Branch
# Checkout the worktree
cd .aide/worktrees/<name>

# Run tests
npm test  # or appropriate test command

# Run linting
npm run lint  # or appropriate lint command

# Check build
npm run build  # if applicable
b) Review Changes
# Back in main repo
git log main..feat/<name> --oneline
git diff main...feat/<name> --stat
c) Check Merge Compatibility
# Dry-run merge check
git merge-tree $(git merge-base main feat/<name>) main feat/<name>

If conflicts shown, note them for manual resolution.

3. Merge Clean Branches

For branches that pass tests and have no conflicts:

git checkout main
git merge feat/<branch-name> --no-edit

4. Handle Conflicts (Intelligent Resolution)

When merge conflicts occur, do not use -X theirs or -X ours - these blindly discard changes.

Instead, resolve conflicts intelligently:

Step 1: Attempt merge and identify conflicts

Read the full file on GitHub · 359 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 359 lines · 14 tokens per session scan A fedbcff8ebb0

Subscribe to this mod's changes

worktree-resolve is a skill published in the GitHub repository jmylchreest/aide (16 stars, last pushed yesterday), licensed MIT. It adds 14 tokens to every session and 2,036 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

repo-hygiene

Use when the scheduled repo-hygiene workflow runs from GitHub Actions (or an operator dry-run) to scan the repository for small, certain docs/test/code hygiene issues and fix them as one batched branch.

QwenLM/qwen-code · 48 tokens

create-issue

Draft and submit a GitHub issue from a user idea or bug description, with bilingual body and correct labels.

QwenLM/qwen-code · 26 tokens

docs-update-from-diff

Review local code changes with git diff and update the official docs under docs/ to match. Use when the user asks to document current uncommitted work, sync docs with local changes, update docs after a feature or refactor, or when phrases like "git diff", "local changes", "update docs", or "official docs" appear.

QwenLM/qwen-code · 75 tokens

prepare-pr

Prepare GitHub pull request title and body files from the current branch diff, especially for non-interactive CI/autofix flows that must follow the repository PR template without pushing or creating the PR.

QwenLM/qwen-code · 42 tokens

triage

Gatekeep and review GitHub issues and pull requests for Qwen Code maintainers. Use for GitHub Action issue triage, PR admission checks, product-direction review, KISS-focused PR review, and staged bilingual GitHub comments.

QwenLM/qwen-code · 50 tokens

safe-extraction

Apply when extracting code from a large monolith file into submodules. Covers barrel re-exports, internals DI seam proxy patterns, CI invariant allowlist updates, and cross-file test verification. Prevents CI failures, broken imports, and test regressions from code extraction.

ZaxbyHub/opencode-swarm · 60 tokens