Hooks Automation

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

1|Updated Jun 3, 2026
One-click install
npx skills add https://github.com/KentwareDemo/RuView --skill hooks-automation-kentwaredemo
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: Hooks Automation
Source: https://github.com/KentwareDemo/RuView/tree/main/.claude/skills/hooks-automation
Command: npx skills add https://github.com/KentwareDemo/RuView --skill hooks-automation-kentwaredemo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires claude-flow.

What problem does it solve? Manually managing agent assignment, code formatting, session state, and cross-session memory in Claude Code workflows is repetitive and error-prone. This Skill automates those tasks through configurable hooks that run before and after operations, keeping coordination state consistent across agents and sessions. ## Core Features & Use Cases - Pre/Post-Operation Hooks: Validate syntax, auto-assign agents, format code, and train neural patterns around file edits, bash commands, tasks, and searches. - Session & Memory Management: Start, restore, and end sessions with persisted context, metrics export, and a three-phase memory coordination protocol shared across swarm agents. - Git & MCP Integration: Wire hooks into pre-commit/post-commit quality gates and coordinate with MCP tools like claude-flow for agent spawning and memory storage. - Use Case: A team running multi-agent refactoring configures post-edit hooks so every file change is auto-formatted, stored in coordination memory, and used to train patterns, while a session-end hook exports metrics and a summary report. ## Quick Start Set up the hooks system by running npx claude-flow init --hooks and then ask Claude 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 and command documentation. You can then edit the PreToolUse and PostToolUse matchers to bind hook commands to specific tools like Edit, Bash, or Task.

How do I 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 and can also store the edit in coordination memory.

What is the difference between pre-task and post-task hooks?▼

The pre-task hook runs before a task to auto-spawn agents, load memory, and optimize swarm topology. The post-task hook runs afterward to analyze performance, store decisions, export neural learnings, and generate a completion report.

Can Claude Code hooks integrate with Git commits?▼

Yes, you can call hook commands from .git/hooks scripts or husky. A pre-commit hook can validate syntax and format staged files, while a pre-push hook can run tests and enforce quality thresholds before allowing the push.

Why are my Claude Code hooks not executing?▼

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

How do Claude Code hooks share memory between agents?▼

Hooks store state through MCP memory tools using namespaced keys under coordination, following a status, progress, complete three-phase protocol. Other agents read these keys via session-restore or memory-sync hooks to stay synchronized.