Hooks Automation

Automates pre/post-operation hooks, session management, and memory coordination for Claude Code workflows.

Updated Aug 18, 2026
One-click install
npx skills add https://github.com/wandreandrade2018-maker/claude-config --skill hooks-automation-wandreandrade2018-maker
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Hooks Automation
Source: https://github.com/wandreandrade2018-maker/claude-config/tree/main/.claude/skills/hooks-automation
Command: npx skills add https://github.com/wandreandrade2018-maker/claude-config --skill hooks-automation-wandreandrade2018-maker

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires claude-flow.

What problem does it solve? Manually validating edits, formatting code, tracking session state, and coordinating multiple agents in Claude Code is repetitive and error-prone. This Skill automates those tasks through configurable hooks that run before and after operations, persist context across sessions, and train on successful patterns. ## Core Features & Use Cases - Pre/Post-Operation Hooks: Validate syntax, assign agents, auto-format code, and store edit context in memory around every file edit or bash command. - Session & Memory Management: Start, restore, and end sessions with state persistence, metrics export, and cross-agent memory synchronization via MCP tools. - Git & Quality Integration: Wire hooks into pre-commit, post-commit, and pre-push Git stages for automated quality gates and commit tracking. - Use Case: A team running a multi-agent refactoring swarm uses pre-task hooks to spawn agents, post-edit hooks to format and log every change, and session-end hooks to export metrics and summaries for review. ## Quick Start Ask the AI to initialize the hooks system with claude-flow and 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 default .claude/settings.json with pre-configured hooks. Then add PreToolUse and PostToolUse entries with matchers for tools like Write, Edit, or Bash that invoke claude-flow hook commands.

How do I auto-format code after every edit 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 for memory storage, agent spawning, and neural training. MCP servers are optional; basic hooks work with just the claude-flow CLI installed.

Why are my Claude Code hooks not executing?

Check that .claude/settings.json has valid JSON 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 the hook logs for errors.

Can hooks block edits to sensitive files?

Yes, hooks return JSON responses with a continue flag. A pre-edit hook can return continue: false for protected files like .env.production, blocking the operation until manual approval is given.