Claude Code hook

Harmony Claude Code

完整的 Claude Code 配置集合(agents, skills, hooks, commands, rules, MCPs)。源自 Anthropic 黑客松获胜者的实战配置,助力中文工程师高效理解与使用 Claude Code。

43 stars 8 forksHooks Plugin marketplace Source

Install

Inside Claude Code
/plugin marketplace add codelably/harmony-claude-code

Found in the project README. Check it for setup steps after installing.

From source
git clone https://github.com/codelably/harmony-claude-code.git

From the README

Harmony Claude Code

来自 Anthropic 黑客松获胜者的 Claude Code 配置全集定制。

包含生产级的智能体(Agents)、技能(Skills)、钩子(Hooks)、命令(Commands)、规则(Rules)以及 MCP 配置。这些配置源自 10 个多月在构建真实产品过程中的高强度日常使用与演进。加入了鸿蒙应用开发规范和专用智能体等。

🌐 跨平台支持

该插件现已全面支持 Windows、macOS 和 Linux。所有钩子和脚本均已使用 Node.js 重写,以确保最大兼容性。

包管理器检测

插件会自动检测你偏好的包管理器(npm, pnpm, yarn, 或 bun),优先级如下:

1. 环境变量:CLAUDE_PACKAGE_MANAGER
2. 项目配置:.claude/package-manager.json
3. package.json:packageManager 字段
4. 锁文件:根据 package-lock.json, yarn.lock, pnpm-lock.yaml, 或 bun.lockb 检测
5. 全局配置:~/.claude/package-manager.json
6. 兜底方案:第一个可用的包管理器

设置你偏好的包管理器:

或者在 Claude Code 中使用 /setup-pm 命令。

📦 内容清单

本仓库是一个 Claude Code 插件

🛠️ 生态工具

技能创建器(Skill Creator)

有两种方式可以从你的仓库生成 Claude Code 技能:

选项 A:本地分析(内置)

使用 /skill-create 命令进行本地分析,无需外部服务:

这会在本地分析你的 Git 历史并生成 SKILL.md 文件。

选项 B:GitHub App(高级版)

适用于高级功能(10k+ 提交、自动 PR、团队共享):

安装 GitHub App | ecc.tools

两种选项都会创建:
- SKILL.md 文件 - 可直接用于 Claude Code 的技能
- 直觉集合 (Instinct collections) - 用于 continuous-learning-v2
- 模式提取 - 从你的提交历史中学习

🧠 持续学习 v2 (Continuous Learning v2)

基于“直觉(Instinct)”的学习系统会自动学习你的模式:

详见 skills/continuous-learning-v2/ 完整文档。

📋 运行要求

Claude Code CLI 版本

最低版本:v2.1.0 或更高

由于插件系统处理钩子(Hooks)方式的变更,此插件需要 Claude Code CLI v2.1.0+。

检查你的版本:

重要:钩子自动加载行为
⚠️ 致贡献者: 请勿在 .claude-plugin/plugin.json 中添加 "hooks" 字段。这是通过回归测试强制执行的。

按照约定,Claude Code v2.1+ 会自动加载任何已安装插件中的 hooks/hooks.json。如果在 plugin.json 中显式声明,会导致重复检测错误:

历史背景: 此问题在本仓库中引发了多次修复/回滚循环(#29, #52, #103)。由于 Claude Code 版本间的行为变更导致了混淆,我们现在通过回归测试来防止此问题再次引入。

📥 安装

🔧 手动安装(推荐)

将钩子(Hooks)添加到 settings.json

将 hooks/hooks.json 中的钩子内容复制到你的 ~/.claude/settings.json。

配置 MCP

将 mcp-configs/mcp-servers.json 中所需的 MCP 服务器配置复制到你的 ~/.claude.json。

重要提示: 请将 YOUR_*_HERE 占位符替换为你真实的 API 密钥。

🎯 核心概念

智能体 (Agents)

子智能体(Subagents)负责处理具有特定范围的委派任务。示例:

技能 (Skills)

技能是可被命令或智能体调用的工作流定义:

钩子…
Read the full README on GitHub

How hooks work

  • Hooks are shell commands Claude Code runs at fixed points: before or after a tool call, when you submit a prompt, when Claude stops, on notifications and at session start.
  • They are set in the hooks section of ~/.claude/settings.json (or .claude/settings.json for a project), or come bundled in a plugin.
  • A hook can block a tool call, add context, or run a formatter or test. Read the scripts before you install them: they run on your machine with your permissions.
Claude Code docs

Details

Type
Hooks
Language
JavaScript
License
MIT
Last updated
26 February 2026

FAQ

What is Harmony Claude Code?

完整的 Claude Code 配置集合(agents, skills, hooks, commands, rules, MCPs)。源自 Anthropic 黑客松获胜者的实战配置,助力中文工程师高效理解与使用 Claude Code。 It is a hook for Claude Code, from codelably/harmony-claude-code on GitHub.

How do I install Harmony Claude Code?

Run /plugin marketplace add codelably/harmony-claude-code inside Claude Code, then follow the setup in the README.

Is Harmony Claude Code popular?

codelably/harmony-claude-code has 43 GitHub stars and 8 forks. It was last updated on 26 February 2026.

More hooks

Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.