hook-creator

Create and configure Claude Code lifecycle hooks for event-driven shell commands.

8|Updated Jul 26, 2026
One-click install
npx skills add https://github.com/joonlab/joonlab-claudecode-setting-for-share --skill hook-creator-joonlab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hook-creator
Source: https://github.com/joonlab/joonlab-claudecode-setting-for-share/tree/main/claude/skills/hook-creator
Command: npx skills add https://github.com/joonlab/joonlab-claudecode-setting-for-share --skill hook-creator-joonlab

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq, and includes references (resource) components.

What problem does it solve?

This skill solves the lack of automated control over agent actions, allowing you to enforce rules, log activity, and trigger custom workflows during the Claude Code lifecycle.

Core Features & Use Cases

  • Lifecycle Event Management: Execute custom shell commands at specific points like PreToolUse, PostToolUse, or SessionStart.
  • Safety & Validation: Automatically block edits to sensitive files like .env or validate JSON content before writing.
  • Workflow Automation: Trigger auto-formatting (e.g., Prettier, Black) or desktop notifications immediately after tool execution.

Quick Start

Use the hook-creator skill to configure a post-tool-use hook that automatically runs prettier on all typescript files after they are edited.

Frequently Asked Questions about hook-creator

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

FAQPage Schema
How do I automate actions during the Claude Code lifecycle?

You can automate agent behavior by configuring lifecycle hooks that execute custom shell commands at specific points like PreToolUse, PostToolUse, or SessionStart. This enables event-driven workflows without manual intervention.

Can I block edits to sensitive files like .env in Claude Code?

Yes, you can configure PreToolUse hooks to automatically validate file paths and block edits to sensitive files like .env. This enforces safety rules and prevents unauthorized modifications during agent execution.

How do I trigger auto-formatting after a tool edits a file?

You can set up a PostToolUse hook to trigger auto-formatting tools like Prettier or Black immediately after tool execution. This ensures all edited files conform to your formatting standards automatically.

Do I need jq to configure lifecycle hooks for Claude Code?

Yes, jq is required for JSON processing when configuring lifecycle hooks. You also need shell access to define the event-driven command execution that intercepts and modifies agent behavior.

What are lifecycle hooks in Claude Code used for?

Lifecycle hooks are used to intercept and modify agent behavior by executing custom shell commands at specific events. They apply to automated logging, file protection, environment initialization, and post-execution formatting tasks.

How do I log agent activity automatically during Claude Code sessions?

You can log agent activity by creating lifecycle hooks that execute logging commands at PreToolUse or PostToolUse events. This captures tool usage and agent actions automatically throughout the session.