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

拒绝本会话未读取的共享文件(STATUS.md、CLAUDE.md、MEMORY.md 或您命名的文件)的 shell 写入,或者自上次读取以来被其他会话更改的共享文件的 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.