setup-hooks

setup-hooks is a skill for Claude Code from ShipWithAI/shipwithai-plugins. It costs 56 tokens per session (842 once invoked), scanned A, original, MIT.

A setup command for configuring project hooks, which are automatic actions triggered by events such as formatting code, stopping a task, or running tests. It writes these settings to .claude/settings.json.

In plain words
What is it for?
Use it to add automatic formatting, linting, or test-on-stop hooks, with optional flags such as a specific formatter or test runner.
Why use it?
It avoids manually wiring common quality checks and only suggests hooks for tools detected in the project or explicitly named by the user.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: reads .claude/ paths.

Part of the shipwithai-starter plugin — 13 skills, 4 commands, 1 agent shipped together

Good fit Use it to add automatic formatting, linting, or test-on-stop hooks, with optional flags such as a specific formatter or test runner.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shipwithai/shipwithai-plugins/setup-hooks
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ShipWithAI/shipwithai-plugins --skill setup-hooks
Clone the repo
git clone --depth 1 https://github.com/ShipWithAI/shipwithai-plugins

Made for: Claude Code.

Or install shipwithai-starter, the plugin that ships this one along with the rest of its 13 skills, 4 commands, 1 agent.

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/shipwithai/shipwithai-plugins/setup-hooks/github.svg)](https://agentmods.dev/skills/shipwithai/shipwithai-plugins/setup-hooks)
Your own site
<a href="https://agentmods.dev/skills/shipwithai/shipwithai-plugins/setup-hooks"><img src="https://agentmods.dev/badge/skills/shipwithai/shipwithai-plugins/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/shipwithai/shipwithai-plugins/setup-hooks"><img src="https://agentmods.dev/badge/skills/shipwithai/shipwithai-plugins/setup-hooks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 842 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00056 $0.00842
Opus 5.5 $0.00022 $0.00337
Sonnet 5.5 $0.00011 $0.00168
Haiku 4.5 $0.00006 $0.00084

Measured 2mo ago against content hash 2afe4eaec24e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

setup-hooks scanned grade A with 0 findings 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 2mo ago.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/starter/skills/setup-hooks/SKILL.md · 107 lines

How it starts

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

/setup-hooks

Configures .claude/settings.json → hooks section.

Mode Detection

Read .claude/starter-context.json if it exists
  → Exists: use fields stack.detected_tools, hooks_selected — skip detect + confirm
  → Does not exist (standalone): detect tools → suggest from catalog → confirm

Argument Handling

If flags are provided, skip auto-detection and only suggest hooks for the specified tools:

  • --formatter <name>: only suggest hook for that formatter (e.g. --formatter black)
  • --test <name>: only suggest hook for that test runner (e.g. --test pytest)

Flags can be combined: /setup-hooks --formatter prettier --test jest

Tool Detection

Load hooks-catalog.json. For each entry, detect presence in order:

  1. files: check whether any listed filename/glob exists in the project root
  2. packageJson: read package.json, check key under devDependencies or dependencies
  3. binary: run which <binary> — pass if exit code is 0

Only suggest a hook if the tool passes at least one of the three checks.

If no tools are detected: inform the user, suggest using flags to specify tools manually.

Suggest & Confirm

Suggest hooks one at a time. Show a preview before confirming:

PostToolUse hook:

"This hook will run prettier --write $FILE every time Claude uses the Edit tool on .js|ts|jsx|tsx|css|md files. Enable it?"

Stop hook:

"This hook will run npm test every time Claude finishes a session. Enable it?"

If the user declines: record as skipped, continue to the next hook.

After all hooks are processed, show a summary:

"Enabled: prettier-on-edit, eslint-fix-on-edit. Skipped: jest-on-stop."

Output Format

If .claude/settings.json does not exist: create it with { "hooks": {} }.

Merge into .claude/settings.json — do not overwrite the permissions section:

{
  "permissions": { "...existing..." },
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit",
        "hooks": [
          {
            "type": "command",
            "command": "case \"$CLAUDE_TOOL_INPUT_PATH\" in *.js|*.ts|*.jsx|*.tsx|*.css|*.md) npx prettier --write \"$CLAUDE_TOOL_INPUT_PATH\";; esac"
          }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "npm test"
          }
        ]
      }
    ]
  }
}

Read the full file on GitHub · 107 lines

Files

What ships with it

2 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. 2mo ago First seen · 107 lines · 56 tokens per session scan A 2afe4eaec24e

Subscribe to this mod's changes

setup-hooks is a skill published in the GitHub repository ShipWithAI/shipwithai-plugins (9 stars, last pushed 2mo ago), licensed MIT. It adds 56 tokens to every session and 842 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

setup-hooks compared with skills from other repositories

setup-hooks next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
setup-hooksShipWithAI/shipwithai-pluginsSkill92mo agoMITA56Claude Code
connectgreenpolo/cc-multi-cli-pluginSkill19610d agoApache-2.0A11Claude Code
review-depthjszmajda/lidSkill118todayMITA93Claude Code
hook-templateclaude-world/director-mode-liteSkill8020d agoMITA39Claude Code
check-environmentclaude-world/director-mode-liteSkill8020d agoMITA44Claude Code
agentsclaude-world/director-mode-liteSkill8020d agoMITA29Claude Code
handoff-geminiclaude-world/director-mode-liteSkill8020d agoMITA71Claude Code