Hooks Automation

Automates pre/post-operation hooks for Claude Code with formatting, memory coordination, and neural pattern training.

Updated Jul 16, 2026
One-click install
npx skills add https://github.com/pjherron/hypoc --skill hooks-automation-pjherron
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: Hooks Automation
Source: https://github.com/pjherron/hypoc/tree/main/hypoc/skills/hooks-automation
Command: npx skills add https://github.com/pjherron/hypoc --skill hooks-automation-pjherron

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires claude-flow.

What problem does it solve? Manually coordinating agent assignments, code formatting, session state, and cross-session memory in Claude Code workflows is repetitive and error-prone. This Skill automates those tasks through configurable pre/post-operation hooks integrated with MCP tools. ## Core Features & Use Cases - Pre/Post-Operation Hooks: Validate syntax, auto-assign agents, format code, and store edit context automatically before and after file edits, bash commands, tasks, and searches. - Session & Memory Management: Persist session state, restore context across sessions, and synchronize coordination memory across swarm agents. - Neural Pattern Training: Continuously learn from successful edits and tasks to improve future agent coordination. - Use Case: A team running multi-agent refactoring configures post-edit hooks so every file change is auto-formatted, logged to shared memory, and used to train coordination patterns, while session-end hooks export metrics and summaries. ## Quick Start Initialize the hooks system by running npx claude-flow init --hooks, then ask the AI to configure pre-edit and post-edit hooks in .claude/settings.json for automatic formatting and memory storage.

Frequently Asked Questions about Hooks Automation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up hooks in Claude Code?▼

Run npx claude-flow init --hooks to generate a .claude/settings.json with pre-configured hooks. Then customize the PreToolUse and PostToolUse matchers to run commands like npx claude-flow hook pre-edit or post-edit on file operations.

How to auto-format code after edits in Claude Code?▼

Add a PostToolUse hook matching Write, Edit, and MultiEdit that runs npx claude-flow hook post-edit with the --auto-format flag. It applies language-specific formatters such as Prettier, Black, or gofmt automatically.

Does claude-flow hooks work with MCP servers?▼

Yes, hooks integrate with MCP tools like claude-flow, ruv-swarm, and flow-nexus. Hooks such as mcp-initialized, agent-spawned, and neural-trained persist swarm configuration and coordination state through MCP memory tools.

Why are my Claude Code hooks not executing?▼

Check that .claude/settings.json has valid syntax, the matcher patterns match your tool names, and the claude-flow CLI is in your PATH. Enable debug mode with CLAUDE_FLOW_DEBUG=true and review logs in .claude-flow/logs/.

Can hooks block edits to protected files?▼

Yes, a pre-edit hook can return a JSON response with continue set to false to block operations on protected files like .env.production. You can configure a check-protected hook in PreToolUse to enforce manual approval.