ClaudeCodeMod

All shelves / Mods / Safety

collision-guard

By nateherkai

collision-guard is a Claude Code safety mod by nateherkai.

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.

Holds a command

Install

The marketplace name is nateherk-mods.

In your shell
claude plugin marketplace add nateherkai/claude-code-mods
claude plugin install collision-guard@nateherk-mods
Open the repo

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
1.0.0
License
MIT
Repo stars
47
Last change
2026-10-02

What it can reach

  • Holds a command
  • Reads this turn's file edits

Claude Code 2.1.287 or later, in the terminal or the desktop app's Code tab, with mods turned on for your account, which the README says Anthropic is doing gradually. Open a new chat after installing: the author says /reload-plugins does not reload it. Before Claude edits or writes a file, it checks whether another open chat changed that file in the last 30 minutes, and if one did, it asks. Proceed edits anyway. Move to a worktree has Claude move this chat's work into a git worktree, so the two chats stop touching the same files, and is offered when git tracks the file. Cancel leaves the file alone, and Claude asks you how to go on. /guard shows what it sees, /guard off turns it off, and /guard window 60 widens the window to 60 minutes. Each chat keeps a small list of the files it changed, under ~/.claude/mods-data/, and the author says nothing is added to Claude's prompt and the mods make no network calls of their own.

The marketplace name is nateherk-mods. The marketplace also holds cache-keeper, recording-mode, and goal-meter. This one installs on its own; to update, run claude plugin marketplace update nateherk-mods, then claude plugin update collision-guard@nateherk-mods, and open a new chat. Stopping two chats from changing the same file is why this page files it under safety. 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 you before an edit or a write, and offers a worktree. Its plugin.json names Nate Herk as its author. In the source, the question is Claude Code's own question dialog, and it watches Edit, Write, and NotebookEdit.

Demo

The collision-guard section on the author's GitHub page
Screenshot of the author's GitHub page.

What it hooks into

  • session.startWhen a session starts
  • session.endWhen a session ends
  • prompt.submitWhen you send a prompt
  • tool.callAround a tool call, where it can hold oneEditWriteNotebookEdit
  • command.runWhen you run its slash command/guard/collision-guard

Read from the on() calls in its hook modules. Open its source under Files to check what each one does.

Slash commands 2

  • /guard
  • /collision-guard

Files

The author's source, 6 files. They load when you open them.

Facts

Author
nateherkai
Category
Safety
Marketplace
nateherk-mods
Repo
nateherkai/claude-code-mods
Folder
collision-guard
Version
1.0.0
License
MIT
Repo stars
47
Last change
2026-10-02
Language
JavaScript
Files
7

Other mods in Safety

recording-modenateherkaiHolds a commandMasks keys, personal details, and business figures on screen while you record, hides results from mail, chat, and finance tools, and keeps private files closed.secret-boxray-amjadHolds a commandOpens a masked box when Claude needs a key, writes the key to .env, and gives Claude a placeholder; any key a tool prints comes back as a placeholder too.secret-shieldSingh-APHolds a commandReplaces API keys, tokens, private keys, and passwords in tool output with a redaction marker before the model or the transcript sees them.transcript-redactorray-amjadSwaps secrets and email addresses in the session for stable placeholders, and puts the real value back on the way into Bash, Write, and Edit.safe-deletecharlie947Holds a commandMoves the files Claude deletes to the Bin instead, toasts a receipt, and /undo-delete puts the last batch back.loop-detectiveYeonwooSungOpens a case when the same Bash command fails the same way again, ties it to the edits that followed, and shows the live cases in a pane and a status line.display-redactionmelodic-softwareMasks email addresses and secret-shaped text in what Claude Code draws, and leaves the transcript, the model's context, and the files unchanged.jev-permission-gatemadisonrickertHolds a commandHolds routine tool calls in auto mode for Jev to allow or deny, and sends the uncertain ones on to Claude Code's built-in classifier.subagent-wallerikdarlingdataHolds a commandHolds a subagent after a time limit to git, gh, and Markdown or text writes, and nudges a code-changing subagent that has edited nothing.public-repo-guardSzotaszHolds a commandAsks in a popup before a push to a public GitHub repo, or before one goes public, when outgoing commits hold keys, emails, local paths, or private repo names.agentic-qe-fleetproffesor-for-testingHolds a commandHolds a command that would delete or overwrite .agentic-qe learning data, and toasts when the guard is set to notify.secrets-guardBioInfoHolds a commandDenies writes of secret files and credential-shaped content, and Bash that would print those secrets.
All 73 in Safety