Coordinates, formats, and learns from Claude Code operations via pre/post hooks, session management, Git integration, and memory coordination with MCP tools.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-skills-library:hooks-automationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Intelligent automation system that coordinates, validates, and learns from Claude Code operations through hooks integrated with MCP tools and neural pattern training.
Intelligent automation system that coordinates, validates, and learns from Claude Code operations through hooks integrated with MCP tools and neural pattern training.
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:
Required:
npm install -g claude-flow@alpha).claude/settings.json with hook configurationsOptional:
# Initialize with default hooks configuration
npx claude-flow init --hooks
This creates:
.claude/settings.json with pre-configured hooks.claude/commands/hooks/# 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
The full hook catalog and deep guides live in references/ and load only when needed:
references/hooks-reference.md — every pre/post/MCP/session hook with options, examples, and features.references/configuration.md — .claude/settings.json hook configuration.references/coordination.md — MCP tool integration, the memory coordination protocol, and hook response formats.references/git-and-agents.md — Git hook integration and the multi-agent coordination workflow.references/custom-and-examples.md — writing custom hooks and real-world end-to-end examples.Enable debug mode for troubleshooting:
# Enable debug output
export CLAUDE_FLOW_DEBUG=true
# Test specific hook with verbose output
npx claude-flow hook pre-edit --file "test.js" --debug
# Check hook execution logs
cat .claude-flow/logs/hooks-$(date +%Y-%m-%d).log
# Validate configuration
npx claude-flow hook validate-config
.claude/settings.json syntaxnpx claude-flow init --hooks - Initialize hooks systemnpx claude-flow hook --list - List available hooksnpx claude-flow hook --test <hook> - Test specific hooknpx claude-flow memory usage - Manage memorynpx claude-flow agent spawn - Spawn agentsnpx claude-flow swarm init - Initialize swarmThis skill works seamlessly with:
npx claudepluginhub frankxai/claude-skills-library --plugin claude-skills-libraryConfigures Claude Code hooks for lifecycle events like PreToolUse, SessionStart, and automation use cases such as formatting enforcement and permission control.
Analyzes a codebase and recommends tailored Claude Code automations (hooks, subagents, skills, plugins, MCP servers). Useful when setting up Claude Code or optimizing workflows.
Orchestrates AI coding workflows with self-correction loops, pre-flight discipline rules, and cross-agent support for Claude Code and other agents.