mod-collision-guard is a Claude Code safety mod by v-amorim.
Pauses a file edit when another open session just edited that file, and asks you to proceed, move to a worktree, cancel, or type an instruction for Claude.
It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.
Version
2.0.0
License
MIT
Repo stars
5
Last change
2026-10-30
What it can reach
Draws in the session
Holds a command
Reads this turn's file edits
Needs Claude Code 2.1.287 or newer; the author tested on Windows Terminal and macOS iTerm2. /plugin install asks where to install the mod: keep Install for you (user scope), press Enter, press Esc to leave the plugin screen, then run /reload-plugins. Auto-update is off for unofficial marketplaces; turn it on under /plugin, Marketplaces, claude-mods. The README warns that mods are not sandboxed and run with your permissions. Each session keeps a small file of the files it edits under ~/.claude/mods-data/mod-collision-guard/sessions. The window defaults to 30 minutes and only other sessions' edits count. With Guard edits off, edits are still recorded for other sessions but never paused.
The marketplace, claude-mods, holds 13 mods in the Moonlight look, and other repositories use that name too, so add v-amorim/moonlight-claude-mods. Stopping two sessions from editing the same file is why this page files it under safety. collision-guard holds an edit to a file another open chat changed in the last 30 minutes, and asks you to proceed, move this chat to a worktree, or cancel. shared-file-guard-mutlumehmet refuses a shell write to a shared file this session never read, or that another session changed, and tells Claude to read it again. This one asks before Edit, Write, MultiEdit or NotebookEdit, with a window you can change, and has four ways out: proceed, move to a worktree (Claude calls EnterWorktree and redoes the edit there), cancel, or type an instruction for Claude.
Demo
Screenshot of the author's GitHub page.
What it hooks into
ui.toastA Claude Code event
ui.messageAdds a message to the session
session.startWhen a session starts
session.endWhen a session ends
tool.callAround a tool call, where it can hold one
command.runWhen you run its slash command/mod-collision-guard
ui.closeWhen its pane closes
state.setA Claude Code event
ui.renderDraws into the sessionAbovePromptPane
Read from the on() calls in its hook modules. Open its source under Files to check what each one does.
Slash commands 1
/mod-collision-guard
Files
The author's README and source, 4 files. They load when you open them.