custom-hooks

custom-hooks is a skill for Claude Code from joris887/exosuit. It costs 23 tokens per session (1,215 once invoked), scanned A, original, MIT.

A project-specific hook setup workflow. Hooks are scripts that run when events such as tool use or a new session occur.

In plain words
What is it for?
Creating and registering scripts for session starts, tool calls, submitted prompts, stopping, and worktree changes, with optional tool-name filters.
Why use it?
It helps enforce project rules automatically and can either block selected actions or show warnings.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions subagents; positional $N argument.

Part of the exosuit plugin — 46 skills, 1 command, 9 agents, 10 hooks shipped together

Good fit Creating and registering scripts for session starts, tool calls, submitted prompts, stopping, and worktree changes, with optional tool-name filters.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/joris887/exosuit/custom-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 joris887/exosuit --skill custom-hooks
Clone the repo
git clone --depth 1 https://github.com/joris887/exosuit

Made for: Claude Code.

Or install exosuit, the plugin that ships this one along with the rest of its 46 skills, 1 command, 9 agents, 10 hooks.

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 custom-hooks

README.md
[![agentmods](https://agentmods.dev/badge/skills/joris887/exosuit/custom-hooks/github.svg)](https://agentmods.dev/skills/joris887/exosuit/custom-hooks)
Your own site
<a href="https://agentmods.dev/skills/joris887/exosuit/custom-hooks"><img src="https://agentmods.dev/badge/skills/joris887/exosuit/custom-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 custom-hooks

Your own site · 80×15
<a href="https://agentmods.dev/skills/joris887/exosuit/custom-hooks"><img src="https://agentmods.dev/badge/skills/joris887/exosuit/custom-hooks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,215 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.00023 $0.01215
Opus 5.5 $0.00009 $0.00486
Sonnet 5.5 $0.00005 $0.00243
Haiku 4.5 $0.00002 $0.00121

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

Security

Grade A, and why

custom-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 3mo 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.

.claude/skills/custom-hooks/SKILL.md · 143 lines

How it starts

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


custom-hooks

Creating a custom hook: $ARGUMENTS

Supported Hook Events

Present available Claude Code hook events:

Event When It Fires Can Block? Input Fields
SessionStart Once at session start No session data
PreToolUse Before any tool call Yes (exit 2) tool_name, tool_input
PostToolUse After any tool call No tool_name, tool_input, tool_output
Stop When model wants to stop Yes (exit 2) last_assistant_message
UserPromptSubmit When user submits prompt No user_prompt
SubagentStop When a subagent completes No last_assistant_message
WorktreeCreate When a worktree is created No —
WorktreeRemove When a worktree is removed No —

Matchers (for PreToolUse and PostToolUse): Filter by tool name — Bash, Edit, Write, Read, Glob, Grep, or combinations with | (e.g., Edit|Write).

1. Understand Requirements

Parse $ARGUMENTS to determine:

  • Event type: Which hook event to listen to
  • Purpose: What the hook should do
  • Blocking vs Advisory: Should it block (exit 2) or just warn (exit 0)?

If unclear, ask:

  • "Should this hook block the action or just warn?"
  • "Should it fire on specific tools only, or all tools?"
  • "Should it run on subagents too?"

2. Generate Hook Script

Create a POSIX shell script following the framework's hook conventions:

#!/bin/sh
# [Event] handler: [description].
# [Blocking|Advisory] — [behavior summary].
# POSIX-compliant — no bash required.
#
# Input:  JSON on stdin ([relevant fields])
# Output: exit 0 = allow, exit 2 = block (message on stderr)

HOOKS_DIR="$(cd "$(dirname "$0")" && pwd)"

# --- JSON field extraction ---
extract_json_string() {
    _field="$1"
    if command -v jq >/dev/null 2>&1; then
        jq -r ".$_field // empty"
    else
        sed -n 's/.*"'"$_field"'"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' | head -1
    fi
}

# Read stdin once
INPUT=$(cat)

# --- Hook logic ---
# [Custom logic here]

exit 0

Read the full file on GitHub · 143 lines

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. 3mo ago First seen · 143 lines · 23 tokens per session scan A 8929ca9c4e48

Subscribe to this mod's changes

custom-hooks is a skill published in the GitHub repository joris887/exosuit (12 stars, last pushed 28d ago), licensed MIT. It adds 23 tokens to every session and 1,215 once invoked, about $0.0001 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

custom-hooks compared with skills from other repositories

custom-hooks next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
custom-hooksjoris887/exosuitSkill1228d agoMITA23Claude Code
build-teaql-appteaql/teaql-agent-kitSkill2.8k21d agoMITA112Codex
context-exclusionteaql/teaql-agent-kitSkill2.8k21d agoMITA41Claude Code
eval-agentsFlorianBruniaux/claude-code-ultimate-guideSkill7.6kyesterdayCC-BY-SA-4.0A80Claude Code
land-and-deployFlorianBruniaux/claude-code-ultimate-guideSkill7.6kyesterdayCC-BY-SA-4.0A41Claude Code
source-command-methodology-advisorFlorianBruniaux/claude-code-ultimate-guideSkill7.6kyesterdayCC-BY-SA-4.0A27Claude Code, Codex
methodology-advisorFlorianBruniaux/claude-code-ultimate-guideSkill7.6kyesterdayCC-BY-SA-4.0A61Claude Code