hooks
✓创建和管理 Claude Code 挂钩,以实现工作流程自动化、验证输入和自定义行为。当用户请求创建挂钩、设置工具使用自动化(PreToolUse、PostToolUse)、添加会话上下文(SessionStart)、验证提示(UserPromptSubmit)、控制停止行为(Stop、SubagentStop)或配置权限处理(PermissionRequest)时使用。
SKILL.md
Create and configure Claude Code hooks to automate workflows, validate inputs, add context, and customize behavior across different events in the Claude Code lifecycle.
MANDATORY FIRST STEP: Before creating any hook, fetch the latest hooks documentation:
This ensures access to the most current hook events, JSON schemas, and best practices.
创建和管理 Claude Code 挂钩,以实现工作流程自动化、验证输入和自定义行为。当用户请求创建挂钩、设置工具使用自动化(PreToolUse、PostToolUse)、添加会话上下文(SessionStart)、验证提示(UserPromptSubmit)、控制停止行为(Stop、SubagentStop)或配置权限处理(PermissionRequest)时使用。 来源:benjaming/ai-skills。
可引用信息
为搜索与 AI 引用准备的稳定字段与命令。
- 安装命令
npx skills add https://github.com/benjaming/ai-skills --skill hooks- 分类
- </>开发工具
- 认证
- ✓
- 收录时间
- 2026-02-05
- 更新时间
- 2026-02-18
快速解答
什么是 hooks?
创建和管理 Claude Code 挂钩,以实现工作流程自动化、验证输入和自定义行为。当用户请求创建挂钩、设置工具使用自动化(PreToolUse、PostToolUse)、添加会话上下文(SessionStart)、验证提示(UserPromptSubmit)、控制停止行为(Stop、SubagentStop)或配置权限处理(PermissionRequest)时使用。 来源:benjaming/ai-skills。
如何安装 hooks?
打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/benjaming/ai-skills --skill hooks 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code 或 Cursor 中使用
这个 Skill 的源码在哪?
https://github.com/benjaming/ai-skills