一键导入
wipfile-guard
Hook that blocks destructive edits to protected identity files. For Claude Code CLI and OpenClaw.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Hook that blocks destructive edits to protected identity files. For Claude Code CLI and OpenClaw.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | WIP.file-guard |
| version | 1.0.1 |
| description | Hook that blocks destructive edits to protected identity files. For Claude Code CLI and OpenClaw. |
| homepage | https://github.com/wipcomputer/wip-file-guard |
| metadata | {"category":"dev-tools","capabilities":["file-protection","edit-blocking","identity-guard"],"dependencies":[],"interface":"Claude Code Hook","requires":{"binaries":["node"]}} |
| openclaw | {"emoji":"🛡️","install":{"env":[]}} |
| author | {"name":"Parker Todd Brooks"} |
Hook that blocks destructive edits to protected identity files. For Claude Code CLI and OpenClaw.
Use wip-file-guard for:
This is a technical guardrail, not a prompt. It blocks the operation before it happens.
Two rules:
CLAUDE.md, SHARED-CONTEXT.md, SOUL.md, IDENTITY.md, CONTEXT.md, TOOLS.md, MEMORY.md
Any file matching: memory, memories, journal, diary, daily log
node guard.mjs --list # list protected files
bash test.sh # run test suite
Add to ~/.claude/settings.json:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "node \"/path/to/wip-file-guard/guard.mjs\"",
"timeout": 5
}
]
}
]
}
}
The deny message tells the agent to re-read the file and use Edit instead. If the agent ignores it, it's likely post-compaction and has lost context. The hook will keep blocking.
Check the net line removal. Edits that remove more than 2 lines from a protected file are blocked. Small edits (adding or replacing 1-2 lines) are allowed.