用途:该技能为 Claude Code 提供钩子系统,在操作前后自动执行协调、校验、格式化与学习,并可与 MCP 工具和 swarm 代理协同。
主要能力:pre 钩子(pre-edit、pre-bash、pre-task、pre-search)负责校验、备份、自动分配代理、加载记忆;post 钩子(post-edit、post-bash、post-task、post-search)负责自动格式化、指标统计、记忆存储与模式训练。另有会话钩子(session-start/restore/end、notify)、MCP 集成钩子(mcp-initialized、agent-spawned、task-orchestrated、neural-trained)与记忆协调钩子(memory-write/read/sync)。
使用方式:需先安装 Claude Flow CLI 并在 Claude Code 启用钩子,配置 .claude/settings.json。初始化命令:npx claude-flow init --hooks。常用示例:npx claude-flow hook pre-task --description "Implement authentication";npx claude-flow hook post-edit --file "src/auth.js" --memory-key "auth/login";npx claude-flow hook session-end --session-id "dev-session" --export-metrics。配置通过 settings.json 的 PreToolUse/PostToolUse/SessionStart/SessionEnd 匹配器绑定命令,可设 timeout、async、continueOnError。
适用场景:Claude Code 中的开发流程自动化、代理协调、会话恢复、代码质量校验与跨会话记忆。
限制:前提是安装 claude-flow@alpha 并启用 Claude Code 钩子,MCP 服务与 Git 库为可选;具体平台、收费与价格信息暂未提供。