Armory
Source
Browse
Hooks

backup-before-edit

Create automatic backup of files before any Edit operation for safety. This hook creates a timestamped backup copy (filename.backup.timestamp) of any existing file before Claude modifies it. Provides a safety net to recover previous versions if needed. Only backs up existing files, includes error suppression to handle edge cases gracefully.

Score
Unranked
Evidence
No signals yet
Last commit
Not known
Listed

Install

armory install backup-before-edit --cli claude

writes the file to.claude/hooks/backup-before-editListed as compatible

Configuration
# fetches the hook script into:
.claude/hooks/backup-before-edit
# then register it in your settings.json "hooks" block.

↳ Add the hook entry to settings.json, then restart the harness.

Needs the armory CLI · not on npm yet, build it from cli/ in the repository

What it is

Create automatic backup of files before any Edit operation for safety. This hook creates a timestamped backup copy (filename.backup.timestamp) of any existing file before Claude modifies it. Provides a safety net to recover previous versions if needed. Only backs up existing files, includes error suppression to handle edge cases gracefully.

When to use it

Create automatic backup of files before any Edit operation for safety. This hook creates a timestamped backup copy (filename.backup.timestamp) of any existing file before Claude modifies it. Provides a safety net to recover previous versions if needed. Only backs up existing files, includes error suppression to handle edge cases gracefully.

How to install / invoke

# Wire this hook script into .claude/settings.json
curl -sL https://raw.githubusercontent.com/davila7/claude-code-templates/main/cli-tool/components/hooks/pre-tool/backup-before-edit.json -o .claude/hooks/backup-before-edit.json

Notes

Extracted from davila7/claude-code-templates, pre-tool category.