hook-write-existing-file-guard

Community

Prevent accidental overwrites with safe edits.

Authorxuezhaojun
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Blocks the Write tool from overwriting existing files with content, forcing the LLM to use the Edit tool instead. This prevents accidental full-file rewrites that lose content or introduce regressions.

Core Features & Use Cases

  • Prevents accidental overwrites by enforcing edits instead of rewrites.
  • Supports exemptions patterns (e.g., *.lock, .generated., *.min.js, *.min.css) to allow safe overwrites.
  • Easy configuration to enable or disable overwrite protection and tailor to project needs.

Quick Start

Configure the guard with your exemptions and options, then initialize it to start blocking overwrites.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: hook-write-existing-file-guard
Download link: https://github.com/xuezhaojun/oh-your-opencode/archive/main.zip#hook-write-existing-file-guard

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.