Claude Code has five ways to add behaviour, and each is defined by when it applies. Picking by that behaviour avoids forcing one mechanism to carry every responsibility.1
| Mechanism | What distinguishes it | Use it for |
|---|---|---|
CLAUDE.md | Always loaded | Project-wide rules and constraints |
| Skill | Matched to the request, loaded on demand | Task-specific knowledge and procedures |
| Subagent | Separate execution context | Isolated delegated work or different tool access |
| Hook | Triggered by an event | Repeatable checks or side effects around tool actions |
| MCP server | Supplies external capabilities | Integrations, data sources, tools |
As described in the course.1
Skills extend the current conversation; subagents leave it, work independently, and return a result. Hooks react to events rather than to what a request means. MCP is a capability boundary, not an instruction format.1 Slash commands differ from skills in needing explicit invocation, where skills activate from the intent of an ordinary request.1
The mechanisms combine: permanent rules in CLAUDE.md, review knowledge in a skill, automatic validation in a hook, an isolated review in a subagent, and external services through MCP.1
Keeping them maintainable
The AI-native SDLC playbook recommends a short, reviewed CLAUDE.md holding build and test commands, conventions, architecture, and recurring mistakes, with reusable organization-wide policy in skills, and treats instructions, skills, hooks, and permission rules as reviewed, version-controlled code.2
The GH-600 course describes hooks as policy enforcement that does not depend on the model’s judgment: a pre-tool-use hook can block an unsafe command, a post-action hook can write an audit log, and an error hook can escalate.3 (Its example uses GitHub Copilot agents’ .github/hooks/; Claude Code hooks fill the same role.)
Related
- Source: GitHub Certified: Agentic AI Developer
- Source: The AI-Native SDLC Playbook
- When to delegate: deciding whether work belongs in a subagent.
- Source: Introduction to Claude Code Agent Skills