install-hooks
Skill192 starsChanged 38 days agoMITView on GitHub
Install plugin hooks into project .claude/ for persistent use without plugin loaded
4 other projects use a version of this.
Adopted by
Most recently taken up by
- GitGuardian/agent-skillstheir own version, first seen Oct 13, 2026
- sd0xdev/sd0x-harnessword for word, first seen Oct 6, 2026
- treylom/ThisCodetheir own version, first seen Sep 5, 2026
- rvdbreemen/adr-kittheir own version, first seen Jul 18, 2026
Other versions4 projects use a version of this.
Word for word · 1
- sd0xdev/sd0x-harness★ 192100% same
Edited · 0
None found.
Wrote their own version · 3
- treylom/ThisCode★ 41same name
- rvdbreemen/adr-kit★ 13same name
- GitGuardian/agent-skills★ 12same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository102 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- adrSkill
- agentctl-setupSkill
- architectureSkill
- askSkill
- best-practicesSkill
- bug-fixSkill
- bump-versionSkill
- check-coverageSkill
- claude-healthSkill
- code-exploreSkill
- code-investigateSkill
- codex-architectSkill
- codex-brainstormSkill
- codex-cli-reviewSkill
- codex-code-reviewSkill
- codex-explainSkill
- codex-implementSkill
- codex-review-branchSkill
- codex-review-docSkill
- codex-review-fastSkill
- codex-reviewSkill
- codex-securitySkill
- codex-setupSkill
- codex-test-genSkill
- codex-test-reviewSkill
- contract-decodeSkill
- create-prSkill
- create-requestSkill
- de-ai-flavorSkill
- debugSkill
- deep-analyzeSkill
- deep-exploreSkill
- deep-researchSkill
- dep-auditSkill
- deploy-flowSkill
- dev-security-auditSkill
- doc-refactorSkill
- doc-reviewSkill
- epic-mergeSkill
- feasibility-studySkill
- feature-devSkill
- feature-verifySkill
- fp-briefSkill
- generate-runnerSkill
- gh-stackSkill
- git-investigateSkill
- git-profileSkill
- install-rulesSkill
- install-scriptsSkill
- issue-analyzeSkill
- jiraSkill
- load-pr-reviewSkill
- merge-prepSkill
- necessity-auditSkill
- next-stepSkill
- obsidian-cliSkill
- op-sessionSkill
- orchestrateSkill
- plan-reviewSkill
- The first 60 shown.
The file
Files
Install Hooks
Trigger
- Keywords: install hooks, setup hooks, copy hooks, install-hooks
When NOT to Use
- Installing rules (use
/install-rules) - Installing scripts (use
/install-scripts) - Full project setup (use
/project-setup)
Workflow
Phase 0: Resolve mode; obsolete-set migration (first for non-list invocations; --dry-run forwarded)
Phase 1: Locate plugin hooks dir
Phase 2: Enumerate hook scripts
Phase 3: Determine install set (--all, specific names, or interactive)
Phase 4a: Copy scripts to .claude/hooks/
Phase 4b: Merge hook definitions into settings.json
Phase 4c: Update manifest
Phase 4.5: Backfill CLAUDE.md references
Phase 5: Output reportPhase 0: Obsolete-Set Migration
Resolve the invocation mode first — Phase 0 mutates settings and deletes files, so the
non-mutating modes must never reach it live: with --list, skip Phase 0 entirely (listing is
read-only); with --dry-run, forward the flag so the migration also only reports:
# --list → skip this phase
# --dry-run → append --dry-run to the command below
node "${CLAUDE_PLUGIN_ROOT}/scripts/migrate-hook-lightweighting.js" --repo "$(git rev-parse --show-toplevel)"Otherwise run the shared migration before any copy or merge — it is what removes the retired enforcement-layer files and their registrations (hook-lightweighting § 3.6), and running it first is what prevents the dangerous half-state (scripts-new + hooks-old).
Ordering inside the script is fixed: it deregisters settings entries first and deletes files only after the settings writes succeed; a failed settings write aborts (exit 1) before any deletion. On exit 1, stop the install and surface the report — installing on top of a repo whose deregistration failed reproduces the half-state the migration exists to prevent. Modified obsolete files are kept on disk (registration disabled) and named in the report; include those lines in Phase 5's output.
Arguments
$ARGUMENTS| Argument | Description |
--all | Install all available hooks |
--list | List available hooks without installing |
--dry-run | Show what would be installed, no changes |
--force | Overwrite existing hooks with different content |
--local | Write to settings.local.json instead of settings.json |
hook-names... | Specific hooks to install |
Two-Layer Install
| Layer | Target | Content |
| Scripts | .claude/hooks/*.sh | Executable hook scripts |
| Definitions | settings.json hooks entries | Event → script path mapping |
Script dependencies: a locally installed hook resolves its helper scripts beside its own copy
(.claude/scripts/…), never from the plugin. The whole dependency surface is one checker —
scripts/review-state.js (which requires scripts/lib/tree-digest.js) — read by stop-guard.sh,
user-prompt-review-guard.sh and post-compact-auto-loop.sh (post-skill-auto-loop.sh is
deliberately zero-read: it prints one static gate-order line and consumes nothing). Missing →
every hook still runs and still reminds: it reports change-class facts from live git and claims no
verdict (nothing blocks — the hooks are reminders, hook-lightweighting § 3.2). Installing the
checker via /install-scripts --all (or /project-setup) is what upgrades the reminders from
"changed, verdict unknown" to "changed, reviewed at this tree".
Conflict Handling
| Script Status | Settings Status | Action |
| Missing | Missing | Install both |
| Identical | Present | Skip (up to date) |
| Different | Present | AskUserQuestion |
Output
## Install Hooks Report
| Hook | Script | Settings | Status |
|------|--------|----------|--------|
| post-edit-format | ✅ | ✅ | installed |
| stop-guard | ✅ | ⏭️ | skipped (identical) |
Scripts: N installed | Settings entries: M mergedDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

