GitWand: Command for Claude Code

.claude/commands/preview.md

preview is a command for Claude Code from devlint/GitWand. It costs 0 tokens per session (581 once invoked), scanned A, original, MIT.

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

Written for Claude Code: installed under .claude/.

This is devlint/GitWand's own configuration. It tells Claude Code how to work on GitWand itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything GitWand configures →

Reuse

Borrowing it

Nothing to install: this file belongs to devlint/GitWand. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/devlint/GitWand/main/.claude/commands/preview.md
Clone the repo
git clone --depth 1 https://github.com/devlint/GitWand

Made for: Claude Code.

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 preview

README.md
[![agentmods](https://agentmods.dev/badge/commands/devlint/gitwand/preview/github.svg)](https://agentmods.dev/commands/devlint/gitwand/preview)
Your own site
<a href="https://agentmods.dev/commands/devlint/gitwand/preview"><img src="https://agentmods.dev/badge/commands/devlint/gitwand/preview/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for preview

Your own site · 80×15
<a href="https://agentmods.dev/commands/devlint/gitwand/preview"><img src="https://agentmods.dev/badge/commands/devlint/gitwand/preview.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. A grade says what 26 rules found in the file — not that it is safe.
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.00000 $0.00581
Opus 5.5 $0.00000 $0.00232
Sonnet 5.5 $0.00000 $0.00116
Haiku 4.5 $0.00000 $0.00058

Measured 2mo ago against content hash 09fb9245dda8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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.

.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. 2mo ago 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 (194 stars, last pushed yesterday), 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.

Related

preview compared with commands from other repositories

preview next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
previewdevlint/GitWandCommand194yesterdayMITA0Claude Code
diff-scriptmendixlabs/mxcliCommand137yesterdayApache-2.0A10Claude Code
session-reportdamusix/atomic-claudeCommand1154d agoMITA31Claude Code
commitdamusix/atomic-claudeCommand1154d agoMITA55Claude Code
commitechoVic/blade-codeCommand18124d agoMITA8Claude Code
post-release.enfitlab-ai/agent-infraCommand87yesterdayMITA4Claude Code
commit.zh-CNfitlab-ai/agent-infraCommand87yesterdayMITA6Claude Code