eshin087/claude-code-mods/tree/main/collision-guard
collision-guard
同じリポジトリ上の別の Claude セッションが編集中のファイルをすでに編集した場合、または同じパッケージバージョンを取得した場合に警告します。
この mod について
Collision Guard は、2 つのセッションが同じリポジトリで作業して同じファイルに触れた場合、または同じパッケージバージョンを取得した場合に警告する Claude Code mod です。各セッションはリポジトリごとに自分の編集(Edit/Write/NotebookEdit)を記録し、編集前に他セッションの記録を確認します(12 時間より古い編集は無視)。警告は toast として表示されて Claude にも伝わり、/collisions コマンドでは他のアクティブセッション、ブランチ、ワークツリー、バージョン、重複ファイルを一覧できます。モデル呼び出しはなく、データは ~/.claude/mods-data/collision-guard/ に保存されます。同じ mod を実行しているセッションだけを検知し、ブロックせず警告します。
インストール
まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。
claude plugin marketplace add eshin087/claude-code-mods claude plugin install collision-guard
原文 / README
Collision Guard
What it does: warns when two Claude sessions work on the same repo and touch the same file, or both claim the same version number. Catching that early avoids the merge conflicts and renumbering it otherwise causes.
Where you see it:
- Toast:
⚠ src/09-render.js was also edited 25m ago by another session (release/v0.10.1 · spacex · "Tesla Roadster…"). - Claude gets the same note, so it keeps the change focused and mentions the overlap in its report.
- Version clash: when
package.jsongets a version another session (on another branch) already uses. /collisions: other sessions active on this repo in the last 24h, their branch, worktree, version, and the files you both edited.
How it works: each session records the files it edits (Edit/Write/NotebookEdit) in its own file, keyed by repo. Worktrees count as the same repo, and paths are compared repo-relative. Before an edit, it reads the other sessions' files. Edits older than 12 hours are ignored.
Cost: none. No model calls.
Data saved: ~/.claude/mods-data/collision-guard/<repo>/<session>.json.
Notes: it only knows about sessions that also run this mod. It warns, it never blocks.
同名の他の作品
- collision-guardVedantAndhale · ★ 1
