Hooks Automation

Configure and automate Claude Code hooks in .claude/settings.json (PreToolUse, PostToolUse, UserPromptSubmit, Stop, SubagentStop, SessionEnd). Use when setting up Claude Code hooks to auto-format files after edits, run pre-commit or safety checks before Bash commands, guard secrets or protected files, save session state on Stop or SessionEnd, or wire optional external CLI and MCP hook runners.

48 stars 6 forksProductivity & Notes Plugin marketplace

Install

Claude Code plugin
/plugin marketplace add frankxai/claude-skills-library

The repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add frankxai/claude-skills-library --skill hooks-automation
Manual install
git clone --depth 1 https://github.com/frankxai/claude-skills-library.git /tmp/claude-skills-library
mkdir -p ~/.claude/skills
cp -r /tmp/claude-skills-library/free-skills/hooks-automation ~/.claude/skills/hooks-automation

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Claude Code Hooks Automation

Configure deterministic lifecycle hooks in `.claude/settings.json` (project) or `~/.claude/settings.json` (user) so Claude Code automatically formats edited files, gates risky shell or Git commands before execution, blocks secret leaks or protected-file writes, and persists session state on completion.

## Trigger Boundaries

- **Activate when**: Setting up or debugging `.claude/settings.json` or `~/.claude/settings.json` `"hooks"`, writing `PreToolUse` / `PostToolUse` / `UserPromptSubmit` / `Stop` / `SubagentStop` / `SessionEnd` scripts, enforcing `exit 2` blocking gates, or returning structured JSON decisions on stdout.
- **Do NOT activate when**: Writing React hooks (`useState`, `useEffect`), Git-only `.git/hooks/` without Claude Code lifecycle integration, or generic webhook endpoints (Stripe/Polar/GitHub HTTP webhooks).

## Native Claude Code Hooks (`settings.json`)

Claude Code executes shell commands registered under the `"hooks"` key in `.claude/settings.json` at specific lifecycle events. Every hook receives a JSON payload on **stdin** and communicates back via **exit codes** and **stdout/stderr**.

### Hook Lifecycle Events

| Event | When It Fires | Common Use Cases |
|---|---|---|
| `PreToolUse` | Before a tool call executes (matches `tool_name` via regex `matcher`) | Block unsafe `Bash` commands, run pre-commit checks before `git commit`, guard secrets and protected files |
Read the full skill on GitHub

Details

Skill name
hooks-automation
Path
free-skills/hooks-automation/SKILL.md
License
MIT
Repo updated
18 November 2026

FAQ

What does the Hooks Automation skill do?

Configure and automate Claude Code hooks in .claude/settings.json (PreToolUse, PostToolUse, UserPromptSubmit, Stop, SubagentStop, SessionEnd). Use when setting up Claude Code hooks to auto-format files after edits, run pre-commit or safety checks before Bash commands, guard secrets or protected files, save session state on Stop or SessionEnd, or wire optional external CLI and MCP hook runners.

How do I install the Hooks Automation skill?

Claude Code plugin: /plugin marketplace add frankxai/claude-skills-library. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Hooks Automation popular?

It lives in frankxai/claude-skills-library, which has 48 GitHub stars and 6 forks.

Related skills

Acos Meta

48

frankxai/claude-skills-library

ACOS self-description and configuration skill. Documents how ACOS works, how to extend it, how to add new skills/commands/agents, and how to debug the hook system. Use when building new ACOS capabilities, understanding the system architecture, or onboarding to ACOS for the first time.

Software Development

Acos Visual Gen

48

frankxai/claude-skills-library

Generate research-grounded visuals using the InfoGenius pipeline. Use when creating infographics, diagrams, educational visuals, or any image that benefits from factual accuracy. Supports 8 visual styles (3D, technical, minimalist, photorealistic, futuristic, vintage, cartoon, standard) and 4 audience levels.

Images, Video & Audio

Agent Harness Construction

48

frankxai/claude-skills-library

Shape an agent's tools, observations, and recovery without adding a second coordinator. Use when defining a tool, a skill, a hook, or a worktree lane.

AI, LLMs & Agents

Hooks Automation

48

frankxai/claude-skills-library

Automated coordination, formatting, and learning from Claude Code operations using intelligent hooks with MCP integration. Includes pre/post task hooks, session management, Git integration, memory coordination, and neural pattern training for enhanced development workflows. Use when configuring Claude Code hooks, automating pre/post-task coordination, or wiring Git and memory hooks.

Productivity & Notes

Frankx Daily Execution

48

frankxai/claude-skills-library

Executes Frank's daily workflow using the FrankX agent system, Starlight Intelligence, and productivity methods. Use when planning Frank's day, running a focused work sprint, or turning intentions into a concrete execution plan.

Productivity & Notes

Memory Prune

48

frankxai/claude-skills-library

Manual reviewable prune of stale memory entries. Lists project_* entries older than 30 days with content preview; Frank decides per-entry [keep | archive | pin]. Keeps MEMORY.md under the auto-load 200-line truncation. Use when MEMORY.md exceeds 180 lines or session-end after a heavy work week.

Productivity & Notes

Browse the most popular Claude skills, all productivity & notes skills, or write your own with the skills generator.