merge-worktree

merge-worktree is a cursor rule for Cursor from briangmilnes/APAS-VERUS. It costs 3,346 tokens per session, scanned A, original, MIT.

A Git worktree merge procedure for combining changes from several agent branches into a main branch.

In plain words
What is it for?
It is for merging agent1/ready through agent4/ready into the main APAS-VERUS worktree while excluding a deprecated review branch.
Why use it?
It reduces merge mistakes by requiring clean, pushed branches and a fixed order of checks and merge steps.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: reads .claude/ paths; mentions CLAUDE.md.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/briangmilnes/apas-verus/merge-worktree
Clone the repo
git clone --depth 1 https://github.com/briangmilnes/APAS-VERUS

Made for: Cursor.

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 merge-worktree

README.md
[![agentmods](https://agentmods.dev/badge/rules/briangmilnes/apas-verus/merge-worktree.svg)](https://agentmods.dev/rules/briangmilnes/apas-verus/merge-worktree)
Your own site
<a href="https://agentmods.dev/rules/briangmilnes/apas-verus/merge-worktree"><img src="https://agentmods.dev/badge/rules/briangmilnes/apas-verus/merge-worktree.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,346 This file is loaded in full into every session.
When invoked 3,346 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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.03346 $0.03346
Opus 5 $0.01673 $0.01673
Sonnet 5 $0.00669 $0.00669
Haiku 4.5 $0.00335 $0.00335

Measured 5d ago against content hash 41862a7fa62c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

merge-worktree 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 5d 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.

.cursor/rules/git/merge-worktree.mdc · 353 lines

How it starts

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

Merge Worktree

When to use

When merging agent worktree branches into main. Execute phases 0–5 in strict order. Do NOT skip phases. Do NOT reorder phases.

Agent worktree layout

Worktree Directory Branch
main ~/projects/APAS-VERUS main
agent1 ~/projects/APAS-VERUS-agent1 agent1/ready
agent2 ~/projects/APAS-VERUS-agent2 agent2/ready
agent3 ~/projects/APAS-VERUS-agent3 agent3/ready
agent4 ~/projects/APAS-VERUS-agent4 agent4/ready

Branches not used in merge

Do NOT merge review/prose. That branch is deprecated. It diverged before the Int→I64/Float→F64 rename and other lib.rs evolution. Merging it overwrites lib.rs with an outdated version and breaks the build. Only merge agent1/ready, agent2/ready, agent3/ready, and agent4/ready.

Phase 0: Ensure all worktrees are committed and pushed

All branches must be clean and pushed before merging. Do not proceed if any worktree has uncommitted changes or unpushed commits.

set -e
# 1. Check main
cd ~/projects/APAS-VERUS && git status
cd ~/projects/APAS-VERUS && git log origin/main..HEAD --oneline

# 2. Check agent1
cd ~/projects/APAS-VERUS-agent1 && git status
cd ~/projects/APAS-VERUS-agent1 && git log origin/agent1/ready..HEAD --oneline

# 3. Check agent2
cd ~/projects/APAS-VERUS-agent2 && git status
cd ~/projects/APAS-VERUS-agent2 && git log origin/agent2/ready..HEAD --oneline

# 4. Check agent3
cd ~/projects/APAS-VERUS-agent3 && git status
cd ~/projects/APAS-VERUS-agent3 && git log origin/agent3/ready..HEAD --oneline

# 5. Check agent4
cd ~/projects/APAS-VERUS-agent4 && git status
cd ~/projects/APAS-VERUS-agent4 && git log origin/agent4/ready..HEAD --oneline
  • git status must show "nothing to commit, working tree clean" in each worktree.
  • git log origin/<branch>..HEAD --oneline must show no output (no unpushed commits).

STOP. Do not proceed to Phase 1 until all five worktrees are committed and pushed.

Read the full file on GitHub · 353 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. 5d ago First seen · 353 lines · 3,346 tokens per session scan A 41862a7fa62c

Subscribe to this mod's changes

merge-worktree is a cursor rule published in the GitHub repository briangmilnes/APAS-VERUS (10 stars, last pushed 1mo ago), licensed MIT. It adds 3,346 tokens to every session, about $0.0167 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-31.