setup-hooks

setup-hooks is a skill for Claude Code from Sassy-Dog/sassydog-skills. It costs 167 tokens per session (3,377 once invoked), scanned B, original, Apache-2.0.

A repository-specific setup generator for code-formatting and linting hooks that run after an agent edits or writes a file.

In plain words
What is it for?
Use it to generate hook scripts and settings that route changed files to the repository’s available formatters and linters, returning unfixable findings to the agent.
Why use it?
It catches formatting and lint problems immediately, using tools that match the repository’s actual programming stack instead of a one-size-fits-all global rule.

Skill for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: reads .claude/ paths; mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the sassy-dog plugin — 21 skills, 10 agents shipped together

Good fit Use it to generate hook scripts and settings that route changed files to the repository’s available formatters and linters, returning unfixable findings to the agent.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Sassy-Dog/sassydog-skills
Claude Code
/plugin install sassy-dog

Made for: Claude Code.

Or install sassy-dog, the plugin that ships this one along with the rest of its 21 skills, 10 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for setup-hooks

README.md
[![agentmods](https://agentmods.dev/badge/skills/sassy-dog/sassydog-skills/setup-hooks/github.svg)](https://agentmods.dev/skills/sassy-dog/sassydog-skills/setup-hooks)
Your own site
<a href="https://agentmods.dev/skills/sassy-dog/sassydog-skills/setup-hooks"><img src="https://agentmods.dev/badge/skills/sassy-dog/sassydog-skills/setup-hooks/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for setup-hooks

Your own site · 80×15
<a href="https://agentmods.dev/skills/sassy-dog/sassydog-skills/setup-hooks"><img src="https://agentmods.dev/badge/skills/sassy-dog/sassydog-skills/setup-hooks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 167 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,377 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00167 $0.03377
Opus 5 $0.00084 $0.01688
Sonnet 5 $0.00033 $0.00675
Haiku 4.5 $0.00017 $0.00338

Measured 12d ago against content hash be41d1e15fe6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade B, and why

setup-hooks scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (references/templates/sassydog-artifact-guard.template.sh, references/templates/sassydog-post-edit.template.sh, scripts/detect-hook-stack.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

`grep -o 'markdownlint-cli2[^"]*' .claude/hooks/sassydog-post-edit.sh` against the probe's
skills/setup-hooks/SKILL.md · 218 lines

How it starts

The opening of the file, as written. The whole thing — 218 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Setup Hooks

Generator for per-repo Claude Code hooks: inspect the repo's actual stack, render a formatter/linter dispatcher tailored to it, wire it into .claude/settings.json, and reconcile all of it on every re-run. The sibling of setup-config — same philosophy: the plugin ships the generator, the repo owns a generated, refreshable artifact.

Why hooks and not instructions: formatting/lint feedback belongs at the harness layer, firing on every Edit/Write deterministically — not re-taught per session. A repo-specific render beats a global hook because a global one fires uselessly in repos whose stack it doesn't match.

What gets generated

  1. .claude/hooks/sassydog-post-edit.sh — a PostToolUse (Edit|Write) dispatcher rendered from references/templates/sassydog-post-edit.template.sh. It reads the hook event JSON on stdin, extracts the edited file path, and routes by extension to the tools the repo actually has. Contract: formatters fix silently (exit 0); linters with unfixable findings exit 2 so the harness feeds the findings straight back for an immediate fix — defects surface at edit time, not in the PR review loop.
  2. .claude/hooks/sassydog-artifact-guard.sh — a stray-artifact guard rendered from references/templates/sassydog-artifact-guard.template.sh. Stack-agnostic, so it is always generated and has no conditional blocks. It keeps screenshots and other throwaway binaries out of the repo root, where they accumulate unnoticed — invisible to git diff, breaking nothing, and indistinguishable later from a deliberate asset. The sanctioned destination is tmp/, which sassy-dog:repo-cleanup already auto-discards universally, so tidy-repo sweeps it with no per-repo config. Contract: it reports, it never moves or deletes.
  3. The settings entries in .claude/settings.json (or settings.local.json when the user wants personal-only): one hooks.PostToolUse entry per script, plus one hooks.Stop entry for the guard's catch-all scan. See references/settings-merge.md.
  4. A root-anchored /tmp/ line in the target repo's .gitignore — the destination the guard points at. Owned here rather than by setup-config because a guard whose destination is not ignored just relocates the mess; the two must not drift apart.

Read the full file on GitHub · 218 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 218 lines · 167 tokens per session scan B be41d1e15fe6

Subscribe to this mod's changes

setup-hooks is a skill published in the GitHub repository Sassy-Dog/sassydog-skills (0 stars, last pushed 3d ago), licensed Apache-2.0. It adds 167 tokens to every session and 3,377 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

commit

Git commit workflow with precommit hook handling, lint/type checking, README updates, and API reference updates. Use when the user wants to commit changes. Handles precommit hooks that modify files (formatting, linting) by re-staging and retrying. Runs ruff lint and pyright type checks on staged Python files, and…

ReflexioAI/claude-smart · 122 tokens

update-pr

Update an existing pull request with new changes. Use when the user wants to update a PR, push follow-up changes to a PR, refresh a PR description, or sync a PR with latest commits. Triggers on: update pr, update-pr, update the pr, push to pr, refresh pr, sync pr, update pull request.

ReflexioAI/claude-smart · 71 tokens

codex-setup

Initialize sd0x-dev-flow infrastructure for Codex CLI and other non-Claude agents. Generates AGENTS.md, installs the commit-msg hook, copies runner scripts. The pre-push gate is opt-in via --with-push-gate. Use when setting up a new project or after updating skills.

sd0xdev/sd0x-harness · 65 tokens

smart-rebase

Smart partial rebase for squash-merge repositories. Auto-detect which commits to keep/drop when base branch was squash-merged into target. Use when: user says 'rebase', 'partial rebase', 'base already merged', 'smart rebase', or /smart-rebase. Not for: simple git rebase (the developer runs it — Claude never executes…

sd0xdev/sd0x-harness · 131 tokens

next-step

Change-aware next step advisor. Use when: user asks what to do next, workflow progression is unclear, session just started with dirty worktree. Not for: executing the suggested command (user decides), auto-loop decisions (hooks handle that). Output: findings-based suggestions or session summary with commit seed.

sd0xdev/sd0x-harness · 63 tokens

resolving-merge-conflicts

Use when a git merge or rebase reports conflicts and the operation is in progress.

romiluz13/cc10x · 25 tokens