Hooks Automation

Hooks Automation is a skill for Claude Code from ruvnet/ruflo. It costs 46 tokens per session (7,622 once invoked), scanned C, a copy of Hooks Automation, MIT.

An automation system that runs actions before and after coding operations through hooks, which are automatic steps triggered by events. It can manage sessions, formatting, Git checks, shared memory, and learned patterns.

In plain words
What is it for?
Use it to prepare and assign work, format and analyze results, restore session context, synchronize agent knowledge, verify commits, and learn from successful operations.
Why use it?
It removes repeated setup, cleanup, validation, and context-saving work from everyday coding tasks. It also helps preserve useful session state between coding sessions.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: mentions Claude Code; installed under .agents/ (shared by several agents).

Part of the claude-flow plugin — 134 skills, 52 commands, 11 agents, 4 hooks shipped together

Good fit Use it to prepare and assign work, format and analyze results, restore…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ruvnet/ruflo/hooks-automation
About the project

Ruflo is an execution and coordination layer for Claude Code and Codex that equips AI coding agents with tools, memory, control loops, sandboxes, and collaboration mechanisms. Developers use it to organize specialized agents into swarms, coordinate workflows, retain knowledge across sessions, and communicate across machines. The catalogue entries are Ruflo’s skills, commands, agents, hooks, and plugin components.

ruvnet/ruflo · 70,734 stars · on GitHub · cognitum.one

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 ruvnet/ruflo --skill hooks-automation
Clone the repo
git clone --depth 1 https://github.com/ruvnet/ruflo

Made for: Claude Code.

Or install claude-flow, the plugin that ships this one along with the rest of its 134 skills, 52 commands, 11 agents, 4 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 Hooks Automation

README.md
[![agentmods](https://agentmods.dev/badge/skills/ruvnet/ruflo/hooks-automation.svg)](https://agentmods.dev/skills/ruvnet/ruflo/hooks-automation)
Your own site
<a href="https://agentmods.dev/skills/ruvnet/ruflo/hooks-automation"><img src="https://agentmods.dev/badge/skills/ruvnet/ruflo/hooks-automation.svg" alt="Measured on agentmods" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,622 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod 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.00046 $0.07622
Opus 5 $0.00023 $0.03811
Sonnet 5 $0.00009 $0.01524
Haiku 4.5 $0.00005 $0.00762

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

Security

Grade C, and why

Hooks Automation scanned grade C 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 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

npx claude-flow hook pre-bash -c "rm -rf /tmp/cache"
Origin

This is a copy

100% identical to Hooks Automation — 92 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.agents/skills/hooks-automation/SKILL.md · 1,202 lines

How it starts

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

Hooks Automation

Intelligent automation system that coordinates, validates, and learns from Claude Code operations through hooks integrated with MCP tools and neural pattern training.

What This Skill Does

This skill provides a comprehensive hook system that automatically manages development operations, coordinates swarm agents, maintains session state, and continuously learns from coding patterns. It enables automated agent assignment, code formatting, performance tracking, and cross-session memory persistence.

Key Capabilities:

  • Pre-Operation Hooks: Validate, prepare, and auto-assign agents before operations
  • Post-Operation Hooks: Format, analyze, and train patterns after operations
  • Session Management: Persist state, restore context, generate summaries
  • Memory Coordination: Synchronize knowledge across swarm agents
  • Git Integration: Automated commit hooks with quality verification
  • Neural Training: Continuous learning from successful patterns
  • MCP Integration: Seamless coordination with swarm tools

Prerequisites

Required:

  • Claude Flow CLI installed (npm install -g claude-flow@alpha)
  • Claude Code with hooks enabled
  • .claude$settings.json with hook configurations

Optional:

  • MCP servers configured (claude-flow, ruv-swarm, flow-nexus)
  • Git repository for version control
  • Testing framework for quality verification

Quick Start

Initialize Hooks System

# Initialize with default hooks configuration
npx claude-flow init --hooks

This creates:

  • .claude$settings.json with pre-configured hooks
  • Hook command documentation in .claude$commands$hooks/
  • Default hook handlers for common operations

Basic Hook Usage

# Pre-task hook (auto-spawns agents)
npx claude-flow hook pre-task --description "Implement authentication"

# Post-edit hook (auto-formats and stores in memory)
npx claude-flow hook post-edit --file "src$auth.js" --memory-key "auth$login"

# Session end hook (saves state and metrics)
npx claude-flow hook session-end --session-id "dev-session" --export-metrics

Read the full file on GitHub · 1,202 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. 3d ago First seen · 1,202 lines · 46 tokens per session scan C ed9559802718

Subscribe to this mod's changes

Hooks Automation is a skill published in the GitHub repository ruvnet/ruflo (70,734 stars, last pushed yesterday), licensed MIT. It adds 46 tokens to every session and 7,622 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). It is 100% identical to Hooks Automation, differing in 92 lines, and is treated as a copy.

Related

Other skills, from other repositories

output-conventions

Shared deliverable-as-file output conventions for all BetterCallClaude commands. Defines the bcc-output folder structure, file naming, and chat summary template.

fedec65/bettercallclaude · 34 tokens

compare-harnesses

Diff two scaffolded harnesses (ADR-031). Reports manifest meta drift + host list + per-file fingerprint changes (added/removed/changed). Exits 0 IDENTICAL, 1 DRIFT, 2 missing manifest. Use --bundle for the ADR-031 schema-1 JSON envelope.

ruvnet/metaharness · 66 tokens

diag-harness

Kernel-version skew check (ADR-027). Reports manifest surface + manifest kernel + installed kernel + verdict (match/patch-diff/minor-diff/major-diff). Exits 1 on minor/major skew with a copy-pasteable npm install @metaharness/[email protected] next step. Exits 2 if no .harness/manifest.json at path.

ruvnet/metaharness · 85 tokens

repo-genome

7-section readiness scorecard for a LOCAL repo. Reports repo type + agent topology + MCP risk + test confidence + release readiness + recommended harness plan + scorecard. Exit 0 ready, 1 needs-work, 2 blocked. --json for the 6-field scorecard, --bundle for the ADR-031 schema-1 envelope.

ruvnet/metaharness · 73 tokens

score-harness

5-dimension scorecard (0-100, grade A/B/C/F) for a scaffolded harness. Dimensions: Repo understanding (25%), Agent usefulness (25%), MCP safety (20%), Test coverage (15%), Publish readiness (15%). Emits a 6-field badges block (score + mcpRisk + 4 booleans) ready for the harness README. Exit 0 A/B, 1 C, 2 F.

ruvnet/metaharness · 0 tokens

upgrade-harness

Drift detection + apply for a scaffolded harness. Re-renders the template with the same vars, computes added/removed/changed file plan, and applies with Git-style conflict markers or .rej files. Default is dry-run.

ruvnet/metaharness · 51 tokens