본문으로 건너뛰기
TakoAPI
스킬로 돌아가기

wip-file-guard

parkertoddbrooks 제작

Coding Agents & IDEs
561clawskills.sh가 보고한 다운로드 수
0조회수
좋아요 0개로그인하면 이 스킬에 좋아요를 누를 수 있습니다
—아직 평가 없음
내 평가

요약

Hook that blocks destructive edits to protected identity files.

설명

이 스킬이 하는 일

A hook that intercepts Write and Edit operations on protected identity files before they execute. Write is always blocked on protected files; Edit is blocked when it removes more than 2 net lines. Works with Claude Code CLI and OpenClaw.

Unlike prompt-based instructions that get erased during context compaction, this hook enforces file protection at the tool call level regardless of agent state.

사용 시점

  • Prevent Claude from overwriting CLAUDE.md during a long session
  • Keep MEMORY.md intact after context compaction resets agent behavior
  • Block accidental deletion of SOUL.md or IDENTITY.md mid-task
  • Protect journal or daily log files from bulk replacement
  • Enforce append-only edits to shared context files in multi-agent setups

예시 워크플로

입력

User asks: 'Rewrite CLAUDE.md with updated instructions'

에이전트
  1. 1

    Agent issues a Write call targeting CLAUDE.md

  2. 2

    Hook intercepts the PreToolUse event and checks the filename against the protected list

  3. 3

    Hook denies the Write operation and returns a message instructing the agent to use Edit instead

  4. 4

    Agent retries with an Edit call

  5. 5

    Hook checks net line removal; if under 2 lines removed, the edit proceeds

출력

Edit is allowed or blocked based on net line change, and CLAUDE.md is never fully overwritten

설치

clawhub install parkertoddbrooks/wip-file-guard

CLI 명령을 실행하거나, 프롬프트를 Claude Code, Cursor, Codex 등 사용하는 코딩 에이전트에 붙여넣으세요.

링크