返回播客Claude
Claude Code skills
Skills 与其他 Claude Code 功能的对比
Claw Code offers several customization options.
Claude Code 提供了多种自定义选项。
Skills, claw.md, sub aents, hooks, MCP servers.
Skills、CLAUDE.md、子智能体、hooks、MCP 服务器。
They solve different problems.
它们解决不同的问题。
Knowing when to use each prevents you from building the wrong thing.
知道何时使用哪个,能避免你构建错误的东西。
So, let's run them down.
那我们来逐一介绍。
Cloud.md loads into every conversation always.
CLAUDE.md 在每次对话中始终加载。
So, if you want claude to use TypeScript strict mode in this project, then put it in your cloud.
所以,如果你想让 Claude 在这个项目中使用 TypeScript 严格模式,就把它写进 CLAUDE.md 文件。
MD file skills load on demand.
MD 文件加载完毕。Skills 按需加载。
When Claude matches a request, your PR review checklist doesn't need to be in the context when you're writing a new code.
当 Claude 匹配到请求时,你的 PR 审查清单不需要在编写新代码时出现在上下文里。
It activates when you ask for a review.
它会在你请求审查时激活。
So, use Claude MD for project-wise standards that always apply constraints like never modify the database schema, framework preferences, and coding style.
所以,使用 Claude MD 来设置始终生效的项目级规范,比如禁止修改数据库 schema、框架偏好和代码风格。
Then use skills for task specific expertise, knowledge that's only relevant sometimes, and detailed procedures that would clutter every conversation.
然后用 Skills 来处理特定任务的专业知识,那些只在特定时候才相关的知识,以及会让每次对话都变得杂乱的详细流程。
Skills add knowledge to your current conversation.
Skills 为你当前的对话添加知识。
When a skill activates, its instructions join the existing context.
当某个 Skill 激活时,它的指令会加入现有的上下文。
Sub aents run in a separate context.
子智能体在独立的上下文中运行。
They receive a task, work on it independently, and return results.
它们接受任务,独立处理,然后返回结果。
They're isolated from your main conversation.
它们与你的主对话相互隔离。
Use sub agents when you want to delegate a task to a separate execution context.
当你想把任务委派给独立执行上下文时,使用子智能体。
You need different tool access that the main conversation does.
子智能体可以使用与主对话不同的工具访问权限。
You want isolation between delegated work and your main context.
你希望委派的工作与主上下文之间保持隔离。
Use skills when you want to enhance cla's knowledge for the current task.
当你想增强 Claude 处理当前任务的知识时,使用 Skills。
The expertise applies throughout a conversation.
这些专业知识在整个对话过程中持续生效。
Hooks fire on events.
Hooks 在事件触发时执行。
A hook might run a llinter every time Claude saves a file or validate input before certain tool calls.
Hook 可以在 Claude 每次保存文件时运行 linter,或在特定工具调用前验证输入。
They're all event driven, while skills, they're request driven.
Hooks 是事件驱动的,而 Skills 是请求驱动的。
They activate based on what you're asking.
Skills 根据你的请求内容激活。
So use hooks for operations that should run on every file save, validation before specific tool calls, or automated side effects of clause actions.
所以,对于需要在每次文件保存时运行的操作、特定工具调用前的验证,或 Claude 操作的自动化副作用,使用 hooks。
Then use skills for knowledge that informs how claw handles requests, guidelines that affect clause reasoning.
然后用 Skills 来处理影响 Claude 处理请求方式的知识,以及影响 Claude 推理的指导方针。
A typical setup might include a claw.md file for always on project standards, skills for task specific expertise, hooks for automated operations.
典型的配置可能包括:一个用于始终生效的项目规范的 CLAUDE.md 文件,用于特定任务专业知识的 Skills,以及用于自动化操作的 hooks。
Each handles its own specialty.
每个功能各司其职。
Don't force everything into skills when another option fits best.
不要在其他选项更合适时,把所有东西都塞进 Skills。
You can use multiple at a time.
你可以同时使用多个。
Skills provide automatic task specific expertise.
Skills 提供自动化的特定任务专业知识。
CloudMD is for always on instructions.
CLAUDE.md 用于始终生效的指令。
Sub aents run in isolated context.
子智能体在隔离的上下文中运行。
[music]
[音乐]
Hooks fire on events.
Hooks 在事件触发时执行。
MCP provides external tools.
MCP 提供外部工具。
Use skills when you have knowledge that Claude should apply automatically when the topic is relevant and combine them with other features for comprehensive customization.
当你拥有 Claude 在相关主题时应自动应用的知识时,使用 Skills,并将它们与其他功能结合,实现全面的自定义。