# Automate Claude Code Hooks

Manual hook setup can be inconsistent across Claude Code projects. This skill guides automated hook configuration for tasks, sessions, memory, and Git workflows.

## Install

```bash
npx skillstore add ruvnet/hooks-automation
```

## Metadata

- Status: approved
- Slug: ruvnet-hooks-automation
- Skillstore revision: r1
- Version status: missing
- Tree hash: 4c703c0cfdbbae2496d93f147c97c3f58792ab06423e3e192eda0e595ec30e60
- Author: ruvnet
- GitHub username: ruvnet
- License: MIT
- Repository: https://github.com/ruvnet/claude-flow/tree/main/.claude/skills/hooks-automation
- Ref: dbe0e719813583400773166a0621f8a9b8185c72
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: confirmation\_required
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, filesystem
- Quality score: 38
- Quality tier: warning
- Public page: https://skillstore.pages.dev/skills/ruvnet-hooks-automation
- Manifest: https://skillstore.pages.dev/api/skills/ruvnet-hooks-automation/manifest

## Capabilities

- Explains pre-operation and post-operation Claude Flow hook commands.
- Shows Claude Code settings examples for tool, task, and session hooks.
- Describes memory coordination patterns for multi-agent workflows.
- Provides Git hook examples for commit, push, and quality checks.
- Documents troubleshooting steps for hook execution and performance issues.

## Use Cases

- Standardize Project Hooks: Create a repeatable hook plan for formatting, validation, and session state in one repository.
- Coordinate Agent Workflows: Use task and memory hooks to keep multi-agent Claude Code work aligned across sessions.
- Add Git Quality Gates: Adapt the documented Git hook patterns for pre-commit checks, post-commit metrics, and push validation.

## Prompt Templates

### Plan Basic Hooks

```
Help me plan basic Claude Code hooks for this repository. Focus on pre-edit validation, post-edit formatting, and session summaries.
```

### Review Hook Settings

```
Review my Claude Code hook settings for safety, missing timeouts, and unnecessary command execution. Suggest a safer configuration.
```

### Design Agent Coordination

```
Design a hook workflow that coordinates backend, frontend, and test agents with memory keys and session restore steps.
```

### Harden Git Automation

```
Create a hardened Git hook automation plan for commits and pushes. Include command review, secret protection, and failure handling.
```

## Limitations

- Requires Claude Flow CLI and compatible Claude Code hook support.
- Does not install or verify hooks without user-approved local commands.
- Command examples need local review before use in sensitive repositories.
- MCP behavior depends on configured servers and available permissions.

## Best Practices

- Review every shell command before enabling it in automatic hooks.
- Add timeouts, manual approval, and clear failure behavior for risky operations.
- Keep memory keys organized by project, session, task, and agent role.

## Anti Patterns

- Do not run templated tool parameters in shell commands without escaping.
- Do not allow hooks to copy or log secret environment files by default.
- Do not enable broad automatic hooks before testing them in a disposable repository.

## Security Audit

- Audited at: 2026-07-20T03:51:00.095\+00:00
- Summary: Static findings largely match Markdown code formatting and documented CLI examples rather than executable files. However, the supplied automatic hook configurations interpolate tool-controlled values into shell commands without safe argument handling, creating a high-confidence command-injection risk. The skill also recommends a globally installed floating alpha dependency.

## Stats

- Views: 304
- Downloads: 11
- Favorites: 0
- Popularity score: 0
