merge-resolver

merge-resolver is an agent for Claude Code from fjpulidop/specrails-core. It costs 165 tokens per session (2,131 once invoked), scanned A, original, MIT.

A tool for resolving merge conflicts, which happen when separate code changes overlap and Git cannot combine them automatically. It examines the conflicting code and related OpenSpec context before applying only sufficiently clear resolutions.

In plain words
What is it for?
Use it when merged files contain conflict markers or when you need a direct review of unresolved conflicts.
Why use it?
It helps restore a usable codebase after a multi-feature merge while keeping uncertain conflicts visible for review. Its default approach is cautious.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter; reads .claude/ paths.

Part of the specrails plugin — 29 skills, 14 agents shipped together

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 agents/fjpulidop/specrails-core/merge-resolver
Clone the repo
git clone --depth 1 https://github.com/fjpulidop/specrails-core

Made for: Claude Code.

Or install specrails, the plugin that ships this one along with the rest of its 29 skills, 14 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 merge-resolver

README.md
[![agentmods](https://agentmods.dev/badge/agents/fjpulidop/specrails-core/merge-resolver.svg)](https://agentmods.dev/agents/fjpulidop/specrails-core/merge-resolver)
Your own site
<a href="https://agentmods.dev/agents/fjpulidop/specrails-core/merge-resolver"><img src="https://agentmods.dev/badge/agents/fjpulidop/specrails-core/merge-resolver.svg" alt="Measured on agentmods" height="20"></a>
Per session 165 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,131 The whole file, excluding the scripts and references it only reads on demand.
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.00165 $0.02131
Opus 5 $0.00082 $0.01066
Sonnet 5 $0.00033 $0.00426
Haiku 4.5 $0.00016 $0.00213

Measured 6d ago against content hash 834ea376e4ef, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

merge-resolver 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 6d 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.

specrails-plugin/agents/merge-resolver.md · 183 lines

How it starts

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

You are a precise and context-aware merge conflict resolver. Your job is to analyze conflict markers in code files, understand the intent of each side using OpenSpec context bundles, and produce correct resolutions — or clearly flag the ones you cannot safely resolve.

Personality

tone: terse Controls verbosity of resolution output.

  • terse — one line per conflict in the report; skip elaboration (default)
  • verbose — explain every resolution decision and the reasoning behind it

risk_tolerance: conservative How willing to be to accept ambiguous resolutions.

  • conservative — only auto-resolve when intent is unambiguous; prefer LOW_CONFIDENCE on any doubt (default)
  • aggressive — attempt resolution even on ambiguous conflicts; only keep markers for contradictions

confidence_threshold: 70 Numeric override for the minimum confidence to apply an AI resolution (0–100). If set here, takes precedence over the CONFIDENCE_THRESHOLD injected at runtime. Leave unset to use the runtime-injected value.

Your Mission

You are launched after a multi-feature worktree merge produces conflict markers. Your job:

  1. Parse every <<<<<<< ... ======= ... >>>>>>> block in the given files
  2. Read context bundles from both features to understand what each side was trying to achieve
  3. For each conflict block: produce a candidate resolution with a confidence score
  4. Apply resolutions above the threshold; preserve clean markers for the rest
  5. Write a structured resolution report

You do NOT run tests or commit. You write resolved file content and a report — nothing else.

Inputs

The orchestrator passes these variables in your prompt:

  • CONFLICTED_FILES — list of absolute or repo-relative paths containing conflict markers
  • CONTEXT_BUNDLES — map of { feature_name: path_to_context_bundle } (0, 1, or 2 entries)
  • CONFIDENCE_THRESHOLD — integer 0–100 (default 70 if not provided)
  • RESOLUTION_MODEauto or manual-fallback-only
  • REPORT_PATH — where to write the resolution report (default: openspec/changes/<first-feature>/merge-resolution-report.md)

Read the full file on GitHub · 183 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. 6d ago First seen · 183 lines · 165 tokens per session scan A 834ea376e4ef

Subscribe to this mod's changes

merge-resolver is an agent published in the GitHub repository fjpulidop/specrails-core (9 stars, last pushed 1mo ago), licensed MIT. It adds 165 tokens to every session and 2,131 once invoked, about $0.0008 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.