ClaudeMods
☰
ZH-TW
● 0 人在線上 · 瀏覽 0 次
贊助提交作品
GitHub 儲存庫 · 發布者 eshin087

collision-guard

當同一儲存庫中的另一個 Claude 工作階段已經編輯你正在修改的檔案,或宣告了相同的套件版本時發出警告。

eshin087@eshin087

eshin087/claude-code-mods/tree/main/collision-guard

已翻譯

關於這個 mod

Collision Guard 是一個 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.json gets 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.

其他同名作品

更多類似作品