This week's tip of the week is Mergiraf
These days, if I hit an annoying merge conflict, there's a good chance I'll just hand it off to my coding agent.
That works, but it also means I'm burning agent context on something that might not require an LLM at all.
Mergiraf is a syntax-aware merge tool. Instead of only looking at lines of text like Git does, it understands the structure of supported languages and can automatically resolve some conflicts that Git can't.
Here's a real example:
$ git merge add-retry-config
Auto-merging internal/config.go
CONFLICT (content): Merge conflict in internal/config.go
Automatic merge failed; fix conflicts and then commit the result.
$ mergiraf solve internal/config.go
WARN Cannot solve conflicts in diff2 style. Merging the original conflict sides from scratch instead.
INFO Solved all conflicts.
$ git diff --name-only --diff-filter=U
# no unresolved conflicts
Plain Git stopped at the conflict. Mergiraf reconstructed the original sides and resolved it structurally.
That's the workflow I wanted, so I also made a Mergiraf Agent Skill.
When my agent encounters a merge conflict, the skill checks for Mergiraf, installs it if necessary, and runs Mergiraf against the conflicted files first. Only the conflicts that remain get handed back to the agent for reasoning.
The principle here is bigger than this one tool: don't spend LLM tokens reasoning about something deterministic tooling can solve first.
You can install Mergiraf with Homebrew, Scoop, or Cargo. See the installation instructions.
Mergiraf won't magically solve every conflict, and you should still review what it resolves. But if it can make the conflict smaller, or eliminate it entirely, that's less work for you and less context for your coding agent.
And if you find Mergiraf useful, you can set it up as your Git merge driver so Git automatically gives it the first shot during merges, rebases, cherry-picks, and reverts.
That's it! Short and sweet. Until the next one!

