preview

A command workflow for previewing Git merge conflicts before completing a merge. A merge combines changes from one Git branch into another, and conflicts happen when Git cannot safely combine edits.

In plain words
What is it for?
Use it to simulate a merge, measure its conflict risk, inspect complex sections, and decide whether to proceed with automatic resolution.
Why use it?
It shows which files and sections GitWand can resolve automatically and which need human or AI review, without changing the working tree permanently.

Command for Claude Code

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 commands/devlint/gitwand/preview
Clone the repo
git clone --depth 1 https://github.com/devlint/GitWand

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 581 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 $0.00000 $0.00581
Opus 5 $0.00000 $0.00291
Sonnet 5 $0.00000 $0.00116
Haiku 4.5 $0.00000 $0.00058

Measured yesterday against content hash 09fb9245dda8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

preview 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 yesterday.

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.

.claude/commands/preview.md · 78 lines

How it starts

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

Preview merge conflicts before merging

Use this workflow to assess merge risk BEFORE actually merging a branch. This avoids surprises and lets you plan conflict resolution in advance.

Workflow

1. Identify the source branch

Determine which branch you want to merge into the current branch. Example: merging feature/auth into main.

2. Simulate the merge (without modifying the working tree)

git merge --no-commit --no-ff <source-branch> 2>&1 || true

If conflicts arise, Git leaves conflict markers in the working tree without committing.

3. Analyze with GitWand

npx gitwand resolve --json --dry-run

The --dry-run flag ensures no files are modified. The JSON output shows:

  • Total conflict count per file
  • How many GitWand can auto-resolve (and with what confidence)
  • Which hunks are complex and need human/LLM attention

4. Assess the risk

From the JSON output, evaluate:

Metric Low risk Medium risk High risk
Auto-resolvable % > 80% 50-80% < 50%
Complex hunks 0-1 2-5 > 5
Files affected 1-3 4-10 > 10

5. Decision

If low risk: proceed with npx gitwand resolve to auto-resolve, then handle remaining hunks.

If medium/high risk: review the complex hunks first. The explanation field in each unresolved hunk describes WHY it's complex (overlapping edits, both sides modified the same function, etc.).

6. Abort if needed

git merge --abort

This cleanly restores the working tree to its pre-merge state.

Example: full preview flow

# Start the merge simulation
git merge --no-commit --no-ff feature/auth

# Analyze conflicts
npx gitwand resolve --json --dry-run | jq '.summary'

# If acceptable, resolve for real
npx gitwand resolve

# Handle remaining conflicts manually, then
git add -A && git commit

# If not acceptable, abort
git merge --abort

Notes

  • This workflow works for both git merge and git rebase conflicts
  • GitWand's format-aware resolvers (JSON, YAML, lockfiles, imports) often resolve conflicts that look complex at the text level but are trivial at the semantic level
  • The .gitwandrc config file controls resolution policies — check it before previewing if the repo has one

Read the full file on GitHub · 78 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. yesterday First seen · 78 lines · 0 tokens per session scan A 09fb9245dda8

Subscribe to this mod's changes

preview is a command published in the GitHub repository devlint/GitWand (167 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 581 tokens. 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.