setup-hooks

setup-hooks is a skill for Claude Code, Codex 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 CodeCodex

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

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.

agentmods
npx agentmods add skills/shipwithai/shipwithai-plugins/setup-hooks
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, Codex.

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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00056 $0.00842
Opus 5 $0.00028 $0.00421
Sonnet 5 $0.00011 $0.00168
Haiku 4.5 $0.00006 $0.00084

Measured 3d ago against content hash 2afe4eaec24e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 3d 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.jsonhooks 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. 3d 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 (10 stars, last pushed 21d ago), licensed MIT. It adds 56 tokens to every session and 842 once invoked, about $0.0003 per session on Opus 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

Other skills, from other repositories

agent-workspace-linux

Use when a task needs an isolated hidden Linux desktop or workspace-owned browser: GUI app QA, web/browser/shopping automation, sandboxed app observation, or stale workspace cleanup. Routes agent-workspace-linux MCP tools on demand. Does NOT apply to host desktop/Chrome control, generic MCP setup, or pure code/file…

ilysenko/codex-desktop-linux · 70 tokens

loongsuite-pilot-insight

基于 LoongSuite Pilot / AI Coding Agent 日志生成事件洞察、组织洞察、数据质量、研发效能和 AI Native 使用类 SLS 报表时使用;包含 AI Coding 事件表语义,以及团队报表可选的部门维表、deptuser 组织关系、指标口径和公共 CTE,通常与 sls-dashboard-builder 一起使用。.

alibaba/loongsuite-pilot · 91 tokens

map-fast

Minimal workflow for small, low-risk changes — no planning, no learning.

azalio/map-framework · 17 tokens

codedrobe-theme

Create, inspect, convert, apply, replace, verify, troubleshoot, update, publish, or restore reversible CodeDrobe themes for supported Chromium/Electron AI desktop apps, including OpenAI Codex, Tencent WorkBuddy, QoderWork (CN/global), and TRAE SOLO (global/CN). Use when a user asks to turn an attached or local…

CodeDrobe/skills · 181 tokens

levelup-clarify

Review, accept, reject, or defer Context Directive Records (CDRs) discovered by levelup-init or proposed by levelup-specify. Interactive one-CDR-at-a-time workflow.

tikalk/adlc-team-skills · 43 tokens

clio-webhooks

Receive and verify Clio (Clio Manage) webhooks. Use when setting up Clio webhook handlers, debugging X-Hook-Signature verification, completing the X-Hook-Secret handshake, or handling legal practice events like matter.created, contact.updated, activity.created, or bill events.

hookdeck/webhook-skills · 64 tokens