
archive-first
v2.2.0: PreToolUse hooks now protect both archive/ and archived/ directory conventions. Regex anchored on trailing slash to avoid false positives on git archive / tar archive.tar. Toggle protection with archived-lock/archived-unlock.
- version
- 2.2.0
Install
/plugin install archive-first@psychquant-claude-pluginsRun it inside Claude Code after adding the marketplace with /plugin marketplace add PsychQuant/psychquant-claude-plugins.
Contents
Discovered from sourceCommands 3
Archive-First: Create Backup
Archive the specified directory (or current project) as a regression baseline before AI-assisted reorganization.
Steps
-
Determine the target directory:
- If
$ARGUMENTSis provided, use it as the target path - If no arguments, use the current working directory
- If
-
Create the archived copy:
mkdir -p ./archived cp -r <target> ./archived/<dirname>-$(date +%Y%m%d-%H%M%S) -
Confirm to the user:
- Show the archived path
- Show the number of files copied
- Remind them that PreToolUse hooks will block destructive commands on
archived/
Archive-First: Lock
Enable the PreToolUse hooks that block destructive commands on archived/ paths.
Steps
-
Remove the disabled flag:
rm -f ~/.cache/archive-first/disabled -
Confirm to the user that protection is active.
Archive-First: Unlock
Temporarily disable the PreToolUse hooks to allow operations on archived/ paths.
Steps
-
Create the disabled flag:
mkdir -p ~/.cache/archive-first && touch ~/.cache/archive-first/disabled -
Confirm to the user that protection is disabled.
-
Remind them to re-enable with
/archive-first:archived-lockwhen done.
Hooks 1
Sponsors
Details
- Marketplace
- PsychQuant/psychquant-claude-plugins
- Source
- plugins/archive-first
- Author
- Che Cheng
- Category
- Productivity
More from PsychQuant/psychquant-claude-plugins
All 42- batch-ocrv0.1.0
- bestocrv0.1.0
- che-apple-devv1.2.0
- che-apple-mail-mcpv2.0.1
- che-apple-notes-mcpv0.2.1
- che-archive-linesv1.0.0
- che-axiom-systemsv1.0.0
- che-biblatex-mcpv0.4.0
- che-bot-toolkitv0.1.0
- che-creative-suitev0.1.0
- che-dropbox-ignorev2.1.0
- che-duckdb-mcpv2.3.0
- che-ical-mcpv1.7.0
- che-latex-mcpv0.7.0
- che-pixel-mcpv0.1.0
- che-svg-mcpv0.1.0
- che-telegram-mcpv1.0.0
- che-things-mcpv1.7.1
- che-word-mcpv1.17.0
- che-xcode-mcpv1.0.1
- che-zotero-mcpv1.0.2
- claude-config-guidev1.0.0
- claude-switchv1.0.0
- cli-toolsv1.0.0