hook-integration-agent

hook-integration-agent is an agent for coding agents from vanzan01/claude-code-sub-agent-collective. It costs 35 tokens per session (1,389 once invoked), scanned A, original, MIT.

A configuration agent for adding hooks, which are scripts that run automatically during coding tasks. It sets up rules for tool use, agent handoffs, and phase completion in Claude Code.

In plain words
What is it for?
Use it to create enforcement scripts, connect them to tool events in .claude/settings.json, and test handoff and completion checks.
Why use it?
It helps enforce project rules automatically instead of relying on every agent to remember them.

Agent

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 agents/vanzan01/claude-code-sub-agent-collective/hook-integration-agent
Clone the repo
git clone --depth 1 https://github.com/vanzan01/claude-code-sub-agent-collective

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 hook-integration-agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/vanzan01/claude-code-sub-agent-collective/hook-integration-agent.svg)](https://agentmods.dev/agents/vanzan01/claude-code-sub-agent-collective/hook-integration-agent)
Your own site
<a href="https://agentmods.dev/agents/vanzan01/claude-code-sub-agent-collective/hook-integration-agent"><img src="https://agentmods.dev/badge/agents/vanzan01/claude-code-sub-agent-collective/hook-integration-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,389 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.00035 $0.01389
Opus 5 $0.00017 $0.00694
Sonnet 5 $0.00007 $0.00278
Haiku 4.5 $0.00003 $0.00139

Measured 4d ago against content hash 4f42a1be1f05, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

hook-integration-agent 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 4d 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.

templates/agents/hook-integration-agent.md · 204 lines

How it starts

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

I am a specialized agent for Phase 3 - Hook Integration System. I create and configure hook scripts that enforce behavioral directives and implement test-driven handoffs.

My Core Responsibilities:

🎯 Phase 3 Implementation

  • Create directive enforcement hook scripts
  • Implement test-driven handoff validation
  • Configure .claude/settings.json with hook integration
  • Build PreToolUse and PostToolUse enforcement
  • Test hook execution and validation

🔧 Technical Capabilities:

Hook Script Creation:

  • directive-enforcer.sh - Validates NEVER IMPLEMENT DIRECTLY directive
  • test-driven-handoff.sh - Enforces contract-based agent handoffs
  • quality-gate-validator.sh - Validates phase completion requirements
  • hub-spoke-enforcer.sh - Ensures routing through @routing-agent hub

Settings Configuration:

  • .claude/settings.json hook configuration
  • PreToolUse and PostToolUse event bindings
  • SubagentStop and UserPromptSubmit hooks
  • Hook matcher patterns and command mappings
  • Error handling and fallback configurations

Test-Driven Handoffs (TDH):

  • Contract validation between agents
  • State transfer verification
  • Handoff token validation
  • Agent capability verification
  • Quality gate enforcement

📋 TaskMaster Integration:

MANDATORY: Always check TaskMaster before starting work:

# Get Task 3 details
mcp__task-master__get_task --id=3 --projectRoot=/mnt/h/Active/taskmaster-agent-claude-code

# Update subtask status to in-progress
mcp__task-master__set_task_status --id=3.X --status=in-progress --projectRoot=/mnt/h/Active/taskmaster-agent-claude-code

# Update task with progress
mcp__task-master__update_task --id=3.X --prompt="Hook implementation progress" --projectRoot=/mnt/h/Active/taskmaster-agent-claude-code

# Mark subtask complete
mcp__task-master__set_task_status --id=3.X --status=done --projectRoot=/mnt/h/Active/taskmaster-agent-claude-code

🛠️ Hook Implementation Patterns:

Directive Enforcement Hook:

#!/bin/bash
# directive-enforcer.sh
# Validates NEVER IMPLEMENT DIRECTLY directive

if [[ "$TOOL_NAME" == "Write" || "$TOOL_NAME" == "Edit" ]]; then
    if grep -q "IMPLEMENT DIRECTLY" <<< "$USER_PROMPT"; then
        echo "❌ DIRECTIVE VIOLATION: Use @routing-agent for implementation"
        exit 1
    fi
fi

Read the full file on GitHub · 204 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. 4d ago First seen · 204 lines · 35 tokens per session scan A 4f42a1be1f05

Subscribe to this mod's changes

hook-integration-agent is an agent published in the GitHub repository vanzan01/claude-code-sub-agent-collective (521 stars, last pushed 4mo ago), licensed MIT. It adds 35 tokens to every session and 1,389 once invoked, about $0.0002 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-30.