Clash
Avoid merge conflicts across git worktrees for parallel AI coding agents
Clash is an open-source CLI tool that helps avoid merge conflicts across git worktrees.
It's designed for developers running multiple AI coding agents (Claude Code, Codex, Cursor, etc.) in parallel — helping them identify potential conflicts early in the development process so they can work around them before it's too late.
Table of Contents
Problem Statement with Some Context
AI coding agents like Claude Code have transformed software development as we know it. Developers now run 3-6+ agents simultaneously, each working on a different feature/bug fix. The recommended approach put forward by most frontier labs is to isolate each agent in its own git worktree — essentially a separate working directory with its own branch.
When multiple AI agents (or developers) work in separate worktrees, they're blind to each other's changes and inevitably touch overlapping parts of the codebase. Conflicts only surface at feature completion, often after significant work and time is wasted. Current tools only catch these conflicts later down the line — we can do better by detecting them earlier in the process.
Clash surfaces worktree-to-worktree conflicts early, so you and your agents can be aware of overlapping changes and act on them before it's too late.
Real quotes from developers:
"Now you have created the fun new ability to create merge conflicts with yourself."
— GitButler Blog
"I now know to expect potential conflicts. This happened to me recently, which was a big learning moment."
— Developer on Medium
"If conflicts look tricky, I throw away the work."
— Developer workflow description
Clash - The Saviour
Clash detects merge conflicts between all worktree pairs during development, helping you/agent:
- Guard file writes via hooks — automatic conflict check before every AI agent edit
- See conflicts instantly across all active worktrees
- Visualize conflict matrix showing which branches conflict
- Monitor in real-time as files change
- Integrate with AI agents via Claude Code hooks, CLAUDE.md instructions, or JSON output
Clash in Action
Hook integration — Clash automatically detects conflicts before Claude Code writes a file. A single line in your settings and every file edit is guarded — no prompts to remember, no commands to run:

Automatic conflict detection — Clash prompts you before a conflicting edit goes through
Conflict warning in action — When a file has conflicts with multiple worktrees, Clash surfaces a clear warning so you can coordinate:

CLI usage — Ask your agent to use Clash directly for a full conflict overview:

Clash alerts Claude Code to conflicts in another worktree, enabling smarter parallel development
Quick Start
Step 1: Quick Setup (Claude Code Recommended)
Install Clash and the Claude plugin in one go: