ClaudeMods
☰
ZH-CN
● 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.

其他同名作品

更多类似作品