mutlumehmet/claude-plugins/tree/main/plugins/shared-file-guard

拒絕本工作階段未讀取,或自上次讀取後被其他工作階段變更的共享檔案(STATUS.md、CLAUDE.md、MEMORY.md 或您指定的檔案)的 shell 寫入
mutlumehmet/claude-plugins/tree/main/plugins/shared-file-guard

一個 Claude Code 模組,用於在同一個專案上執行多個工作階段。如果本工作階段從未讀取過共享檔案(STATUS.md、CLAUDE.md、MEMORY.md 或您指定的檔案),或者自上次讀取後被其他工作階段變更,它將拒絕寫入該檔案的 shell 命令。它是 claude-plugins 的一部分。
python3 腳本、sed -i、tee、mv 和 cp。cat 或 grep 算作一次讀取;工作階段自己的寫入不會阻止其下一次寫入;允許建立尚不存在的檔案。/shared-file-guard 列出本工作階段已查看的檔案;/shared-file-guard off|on。| 設定 | 預設值 | 功能 |
|---|---|---|
| watched_files | STATUS.md,CLAUDE.md,MEMORY.md | 以逗號分隔的檔案名稱;* 匹配任何名稱字元序列,例如 *register*.md |
tool.call 僅記錄讀取的內容。Bash 上的 tool.call 可能會拒絕該命令;它從不變更它。command.run 回答它自己的 /shared-file-guard 命令,而不回答其他命令。需要 Claude Code 2.1.287 或更高版本(模組)。在 2.1.289 上測試。
/plugin marketplace add mutlumehmet/claude-plugins
/plugin install shared-file-guard@mehmetmutlu
模組在 Claude Code 中以您的權限執行。在安裝任何模組之前請閱讀程式碼。
安裝時或之後使用 /plugin configure shared-file-guard@mehmetmutlu 會要求設定。
cd 之後的相對路徑,無法識別。由 Mehmet Mutlu 製作,是 claude-plugins 的一部分。他的更多作品請訪問 mehmetmutlu.dev。
請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。
claude plugin marketplace add mutlumehmet/claude-plugins claude plugin install shared-file-guard
A Claude Code mod for running several sessions on the same project. It refuses a shell command that would write a shared file (STATUS.md, CLAUDE.md, MEMORY.md, or the files you name) when this session never read it, or another session changed it since. Part of claude-plugins.
python3 scripts, sed -i, tee, mv and cp.cat or grep counts as a read; a session's own writes do not block its next one; creating a
file that does not exist yet is allowed./shared-file-guard lists the files this session has seen; /shared-file-guard off|on.| Setting | Default | What it does |
|---|---|---|
| watched_files | STATUS.md,CLAUDE.md,MEMORY.md | Comma separated file names; * matches any run of name characters, such as *register*.md |
tool.call on Read, Edit and Write only records what was read. tool.call on Bash may refuse that one command; it never changes it. command.run answers its own /shared-file-guard command and no other.Needs Claude Code 2.1.287 or later (mods). Tested on 2.1.289.
/plugin marketplace add mutlumehmet/claude-plugins
/plugin install shared-file-guard@mehmetmutlu
A mod runs inside Claude Code with your permissions. Read the code before you install any mod.
Settings are asked for at install, or later with /plugin configure shared-file-guard@mehmetmutlu.
cd in the same command, are not seen.Made by Mehmet Mutlu, part of claude-plugins. More of his work at mehmetmutlu.dev.