wip-file-guard
Hook that blocks destructive edits to protected identity files. For Claude Code CLI and OpenClaw.
- License 许可
- MIT
- 最近更新
- 2026-06-07
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- wip-file-guard
- license
- MIT
- metadata
- { "author": "Parker Todd Brooks", "version": "1.0.1", "category": "dev-tools", "homepage": "https://github.com/wipcomputer/wip-file-guard", "openclaw": { "emoji": "🛡️", "install": [ { "id": "node", "bins": [ "wip-file-guard" ], "kind": "node", "label": "Install via npm", "package": "@wipcomputer/wip-file-guard" } ], "requires": { "bins": [ "node" ] } }, "requires": { "bins": [ "node" ] }, "capabilities": [ "file-protection", "edit-blocking", "identity-guard" ], "display-name": "Identity File Protection" }
- interface
- [ "cli", "module", "hook", "plugin", "skill" ]
- description
- Hook that blocks destructive edits to protected identity files. For Claude Code CLI and OpenClaw.
- compatibility
- Requires node. Node.js 18+.
03 SKILL.md 正文
wip-file-guard
Hook that blocks destructive edits to protected identity files. For Claude Code CLI and OpenClaw.
When to Use This Skill
Use wip-file-guard for:
- Protecting CLAUDE.md, SOUL.md, IDENTITY.md, MEMORY.md, and other identity files from being overwritten
- Blocking AI agents from replacing file content instead of extending it
- Surviving context compaction (behavioral rules get erased, but hooks don't)
This is a technical guardrail, not a prompt. It blocks the operation before it happens.
Do NOT Use For
- Protecting binary files or images
- Blocking all edits (it allows small edits, only blocks destructive ones)
- Repos without identity files
How It Works
Two rules:
- Write is blocked on protected files. Always. Use Edit instead.
- Edit is blocked when it removes more than 2 net lines from a protected file.
Protected Files
CLAUDE.md, SHARED-CONTEXT.md, SOUL.md, IDENTITY.md, CONTEXT.md, TOOLS.md, MEMORY.md
Protected Patterns
Any file matching: memory, memories, journal, diary, daily log
API Reference
CLI
node guard.mjs --list # list protected files
bash test.sh # run test suite
Claude Code Hook
Add to ~/.claude/settings.json:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "node \"/path/to/wip-file-guard/guard.mjs\"",
"timeout": 5
}
]
}
]
}
}
Troubleshooting
Agent keeps trying to Write
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.
Edit blocked unexpectedly
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.
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
ceaser
Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir/UltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).
ceaser-send
Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir/UltraHonk zero-knowledge proofs.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
moldium
Post and manage content on the Moldium blog platform. Triggered by "post to Moldium", "write a blog post", "publish an article", etc.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http://weakaccept.top:8000/.