Hooks Automation
Automated coordination, formatting, and learning from Claude Code operations using intelligent hooks with MCP integration. Includes pre/post task hooks, session management, Git integration, memory coordination, and neural pattern training for enhanced development workflows.
Install / Use
npx skills add spencermarx/open-code-review --skill hooks-automationInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
AutomationSupported Platforms
Our assessment of Hooks Automation
Hooks Automation scores 86/100 on our quality scale, 1762nd of 2,771 Automation skills we index.
Its SKILL.md is 31 KB long, well organised into 107 sections with 45 code examples: a thorough specification that gives an agent plenty to work with.
It has 368 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated about 4 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
- Our last check on 2026-11-02 found the source still online.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 98/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
ReviewOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review judged it risky: The skill instructs the agent to install and run the unverified third-party npm package `claude-flow@alpha` and to pass every tool's parameters (file paths, bash commands, search queries) into it via hooks.
AI review: risky
- The skill instructs the agent to install and run the unverified third-party npm package `claude-flow@alpha` and to pass every tool's parameters (file paths, bash commands, search queries) into it via hooks.
- It provides `.claude/settings.json` configurations that add `PreToolUse` and `PostToolUse` hooks automatically invoking external commands before/after every Write, Edit, Bash, Task, and Grep operation, effectively proxying normal agent oper
- The hooks enable auto-spawning agents, automated memory writes, and neural pattern training with minimal user confirmation, weakening normal oversight and potentially exfiltrating project context.
AI review by kimi-k2.7-code on 2026-10-07. Automated pattern scan on 2026-10-07. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
Hooks Automation compared with similar skills
All 4 of these similar skills score higher than Hooks Automation; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| Hooks Automation (this skill)by spencermarx | 86 | 368 | 4mo ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 113.3k | 12d ago | CLAUDE.md |
| hyperframesby heygen-com | 100 | 87.1k | today | CLAUDE.md |
| rufloby ruvnet | 100 | 82.1k | today | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 80.2k | today | CLAUDE.md |
Frequently asked questions
- How do I install Hooks Automation?
- Run
npx skills add spencermarx/open-code-review --skill "Hooks Automation". The install tabs above show the steps for each supported agent. - Which AI agents does Hooks Automation work with?
- It is written for Claude Code, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is Hooks Automation safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review judged it risky: The skill instructs the agent to install and run the unverified third-party npm package
claude-flow@alphaand to pass every tool's parameters (file paths, bash commands, search queries) into it via hooks. It is Apache-2.0-licensed and scores 98/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand. - Is Hooks Automation still maintained?
- The repository was last updated about 4 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
Skill content
View source on GitHubname: Hooks Automation description: Automated coordination, formatting, and learning from Claude Code operations using intelligent hooks with MCP integration. Includes pre/post task hooks, session management, Git integration, memory coordination, and neural pattern training for enhanced development workflows.
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.jsonwith 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.jsonwith 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
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
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
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 command confirmation
- Permission checks
pre-task - Auto-spawn agents and prepare for complex tasks
npx claude-flow hook pre-task [options]
Options:
--description, -d <text> Task description for context
--auto-spawn-agents Automatically spawn required agents (default: true)
--load-memory Load relevant memory from previous sessions
--optimize-topology Select optimal swarm topology
--estimate-complexity Analyze task complexity
Examples:
npx claude-flow hook pre-task --description "Implement user authentication"
npx claude-flow hook pre-task -d "Continue API dev" --load-memory
npx claude-flow hook pre-task -d "Refactor codebase" --optimize-topology
Features:
- Automatic agent spawning based on task analysis
- Memory loading for context continuity
- Topology optimization for task structure
- Complexity estimation and time prediction
pre-search - Prepare and optimize search operations
npx claude-flow hook pre-search --query <query>
Options:
--query, -q <text> Search query
--check-cache Check cache first (default: true)
--optimize-query Optimize search pattern
Examples:
npx claude-flow hook pre-search -q "authentication middleware"
Features:
- Cache checking for faster results
- Query optimization
- Search pattern improvement
Post-Operation Hooks
Hooks that execute AFTER operations to process and learn:
post-edit - Auto-format, validate, and update memory
npx claude-flow hook post-edit [options]
Options:
--file, -f <path> File path that was edited
--auto-format Automatically format code (default: true)
--memory-key, -m <key> Store edit context in memory
--train-patterns Train neural patterns from edit
--validate-output Validate edited file
Examples:
npx claude-flow hook post-edit --file "src/components/Button.jsx"
npx claude-flow hook post-edit -f "api/auth.js" --memory-key "auth/login"
npx claude-flow hook post-edit -f "utils/helpers.ts" --train-patterns
Features:
- Language-specific auto-formatting (Prettier, Black, gofmt)
- Memory storage for edit context and decisions
- Neural pattern training for continuous improvement
- Output validation with linting
post-bash - Log execution and update metrics
npx claude-flow hook post-bash --command <cmd>
Options:
--command, -c <cmd> Command that was executed
--log-output Log command output (default: true)
--update-metrics Update performance metrics
--store-result Store result in memory
Examples:
npx claude-flow hook post-bash -c "npm test" --update-metrics
Features:
- Command execution logging
- Performance metric tracking
- Result storage for analysis
- Error pattern detection
post-task - Performance analysis and decision storage
npx claude-flow hook post-task [options]
Options:
--task-id, -t <id> Task identifier for tracking
--analyze-performance Generate performance metrics (default: true)
--store-decisions Save task decisions to memory
--export-learnings Export neural pattern learnings
--generate-report Create task completion report
Examples:
npx claude-flow hook post-task --task-id "auth-implementation"
npx claude-flow hook post-task -t "api-refactor" --analyze-performance
npx claude-flow hook post-task -t "bug-fix-123" --store-decisions
Features:
- Execution time and token usage measurement
- Decision and implementation choice recording
- Neural learning pattern export
- Completion report generation
post-search - Cache results and improve patterns
npx claude-flow hook post-search --query <query> --results <path>
Options:
--query, -q <text> Original search query
--results, -r <path> Results file path
--cache-results Cache for future use (default: true)
--train-patterns Improve search patterns
Examples:
npx claude-flow hook post-search -q "auth" -r "results.json" --train-patterns
Features:
- Result caching for faster subsequent searches
- Search pattern improvement
- Relevance scoring
MCP Integration Hooks
Hooks that coordinate with MCP swarm tools:
mcp-initialized - Persist swarm configuration
npx claude-flow hook mcp-initialized --swarm-id <id>
Features:
- Save swarm topology and configuration
- Store agent roster in memory
- Initialize coordination namespace
agent-spawned - Update agent roster and memory
npx claude-flow hook agent-spawned --agent-id <id> --type <type>
Features:
- Register agent in coordination memory
- Update agent roster
- Initialize agent-specific memory namespace
task-orchestrated - Monitor task progress
npx claude-flow hook task-orchestrated --task-id <id>
Features:
- Track task progress through memory
- Monitor agent assignments
- Update coordination state
neural-trained - Save pattern improvements
npx claude-flow hook neural-trained --pattern <name>
Features:
- Export trained neural patterns
- Update coordination models
- Share learning across agents
Memory Coordination Hooks
memory-write - Triggered when agents write to coordination memory
Features:
- Validate memory key format
- Update cross-agent indexes
- Trigger dependent hooks
- Notify subscribed agents
memory-read - Triggered when agents read from coordination memory
Features:
- Log access patterns
- Update popularity metrics
- Preload related data
- Track usage statistics
memory-sync - Synchronize memory across swarm agents
npx claude-flow hook memory-sync --namespace <ns>
Features:
- Sync memory state across agents
- Resolve conflicts
- Propagate updates
- Maintain consistency
Session Hooks
session-start - Initialize new session
npx claude-flow hook session-start --session-id <id>
Options:
--session-id, -s <id> Session identifier
--load-context Load context from previous session
--init-agents Initialize required agents
Features:
- Create session directory
- Initialize metrics tracking
- Load previous context
- Set up coordination namespace
session-restore - Load previous session state
npx claude-flow hook session-restore --session-id <id>
Options:
--session-id, -s <id> Session to restore
--restore-memory Restore memory state (default: true)
--restore-agents Restore agent configurations
Examples:
npx claude-flow hook session-restore --session-id "swarm-20241019"
npx claude-flow hook session-restore -s "feature-auth" --restore-memory
Features:
- Load previous session context
- Restore memory state and decisions
- Reconfigure agents to previous state
- Resume in-progress tasks
session-end - Cleanup and persist session state
npx claude-flow hook session-end [options]
Options:
--session-id, -s <id> Session identifier to end
--save-state Save current session state (default: true)
--export-metrics Export session metrics
--generate-summary Create session summary
--cleanup-temp Remove temporary files
Examples:
npx claude-flow hook session-end --session-id "dev-session-2024"
npx claude-flow hook session-end -s "feature-auth" --export-metrics --generate-summary
npx claude-flow hook session-end -s "quick-fix" --cleanup-temp
Features:
- Save current context and progress
- Export session metrics (duration, commands, tokens, files)
- Generate work summary with decisions and next steps
- Cleanup temporary files and optimize storage
notify - Custom notifications with swarm status
npx claude-flow hook notify --message <msg>
Options:
--message, -m <text> Notification message
--level <level> Notification level (info|warning|error)
--swarm-status Includ
Truncated for display — read the full file on GitHub.
Related Skills
Agent-Reach
113.3kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
hyperframes
87.1kAI video you can actually edit. HyperFrames is a free, open-source AI video editor. Describe any video and get a real project you can change down to the frame.
ruflo
82.1k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
headroom
80.2kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
