
Hooks Automation
Automate Claude Code pre/post hooks, session persistence, git quality gates, and MCP-coordinated swarm workflows with neural pattern learning.
Overview
Hooks Automation is a journey-wide agent skill that coordinates Claude Code operations through pre/post hooks, MCP tools, session memory, and git automation—usable whenever a solo builder needs reliable agent workflows b
Install
npx skills add https://github.com/ruvnet/ruflo --skill hooks-automationWhat is this skill?
- Pre-operation hooks for validate, prepare, and auto-assign swarm agents
- Post-operation hooks for format, analyze, and train patterns after edits
- Session management with persisted state, context restore, and summaries
- Git integration hooks with quality verification on commits
- MCP integration plus neural training from successful coding patterns
Adoption & trust: 631 installs on skills.sh; 58.5k GitHub stars; 0/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your Claude Code sessions lose context, skip formatting, and manually re-assign work because nothing automatically validates, records, or learns from each operation.
Who is it for?
Advanced solo builders running Claude Flow with MCP who want hands-off session hygiene and swarm coordination across long agent sessions.
Skip if: Beginners on a single short chat task with no Claude Flow install, or teams that forbid git hooks and shell automation in their environment.
When should I use this skill?
Automating Claude Code operations, coordinating hooks with MCP, session management, git integration, or neural pattern training for development workflows.
What do I get? / Deliverables
Hooks run around every operation so agents stay assigned, repos stay formatted, sessions persist, and successful patterns train into repeatable automation.
- Configured pre/post hook pipeline
- Session state and summary artifacts
- Git-integrated quality verification on commits
Recommended Skills
Journey fit
Useful at every journey phase - explore requirements and options before committing to a direction.
Where it fits
Register pre-hooks that assign the right swarm agent before a large refactor starts.
Post-hooks format diffs and block commits that fail automated quality checks.
Restore yesterday’s session summary and memory before continuing a production bugfix.
Persist exploratory spikes so context survives when you return after research breaks.
How it compares
Agent workflow orchestration via hooks—not a lint-only skill or a standalone code-review checklist without session persistence.
Common Questions / FAQ
Who is hooks automation for?
Developers using Claude Code with Claude Flow who need automated pre/post task hooks, MCP swarm coordination, and cross-session memory.
When should I use hooks automation?
Use it during Build when wiring agent-tooling, during Ship when enforcing git quality gates, and during Operate when restoring long sessions for incident fixes or iteration.
Is hooks automation safe to install?
Check the Security Audits panel on this page; the skill automates git and shell hooks—review what runs on commit and which MCP tools receive repository access.
SKILL.md
READMESKILL.md - Hooks Automation
# 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 ```bash # 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 ```bash # 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 ``` --- ## Complete Guide ### Available Hooks #### Pre-Operation Hooks Hooks that execute BEFORE operations to prepare and validate: **pre-edit** - Validate and assign agents before file modifications ```bash npx claude-flow hook pre-edit [options] Options: --file, -f <path> File path to be edited --auto-assign-agent Automatically assign best agent (default: true) --validate-syntax Pre-validate syntax before edit --check-conflicts Check for merge conflicts --backup-file Create backup before editing Examples: npx claude-flow hook pre-edit --file "src$auth$login.js" npx claude-flow hook pre-edit -f "config$db.js" --validate-syntax npx claude-flow hook pre-edit -f "production.env" --backup-file --check-conflicts ``` **Features:** - Auto agent assignment based on file type - Syntax validation to prevent broken code - Conflict detection for concurrent edits - Automatic file backups for safety **pre-bash** - Check command safety and resource requirements ```bash npx claude-flow hook pre-bash --command <cmd> Options: --command, -c <cmd> Command to validate --check-safety Verify command safety (default: true) --estimate-resources Estimate resource usage --require-confirmation Request user confirmation for risky commands Examples: npx claude-flow hook pre-bash -c "rm -rf /tmp/cache" npx claude-flow hook pre-bash --command "docker build ." --estimate-resources ``` **Features:** - Command safety validation - Resource requirement estimation - Destructive co