Install
openclaw skills install wip-file-guardHook that blocks destructive edits to protected identity files. For Claude Code CLI and OpenClaw.
openclaw skills install wip-file-guardHook 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.