Claude Code extension component architecture
On this page
- Wiki route
- 1. The 6 extension components
- 2. Distinctions between components
- Skills vs Subagent
- CLAUDE.md vs Skills
- MCP vs Skill
- 3. Plugins & Marketplace
- 4. Component hierarchy and merge rules
- Combination usage examples
- 5. Context cost
- Potential connection to the agent payment layer (under consideration)
- Related
Wiki route
This entry sits under AI Agent payment protocols overview · a 7-protocol survey. Read it with ERC-7715 overview · Wallet Permissions and AI Agent auto-payment for adjacent context and AP2 · Google Agent Payments Protocol overview for the broader system boundary.
[!info] TL;DR Source: 5 architecture diagrams received from 2026-04-16 (the WeChat official account “童童的 AI 创业圈”). The following is the full textualization of the image content.
1. The 6 extension components
Claude Code’s Agentic Loop (Plan → Act → Observe → Reflect) acquires capabilities through 6 types of extension components.
| Component | Role | Use case | Example |
|---|---|---|---|
| CLAUDE.md | Holds persistent context, auto-loaded every session | Project Specs (project conventions, global rules) | Use pnpm; test before commit |
| Skills | Reusable capability modules (knowledge, instructions, workflows), loaded on demand | Reference Docs / Standard Tasks | ”/deploy to run deployment” |
| Subagent | An independent sub-Agent. Runs in an isolated context and returns a result summary | Context Isolation / Parallel Tasks | Parse a file and return a conclusion |
| Agent Teams | Multiple Agents collaborate, sharing a task list and communicating with each other | Parallel Research / Complex Dev | Launch multiple reviewers |
| MCP | Connects to external systems and tools, accessing external data/actions | External Data / Actions | DB query; Slack send |
| Hook | An automation script outside the loop. Triggered on specific events | Deterministic Automation | Run ESLint after changes |
2. Distinctions between components
Skills vs Subagent
| Aspect | Skills | Subagent |
|---|---|---|
| Essence | Reusable knowledge or flow | Independent execution unit |
| Core value | Reuse content across different tasks | Context isolation |
| Fitting scenario | Reference material, standard flows | Large-scale code analysis or parallel tasks |
CLAUDE.md vs Skills
| Aspect | CLAUDE.md | Skills |
|---|---|---|
| Loading method | Auto-loaded every session | Loaded on demand |
| File reference | Supports @path | Supports @path |
| Can trigger a flow | No | Yes |
| Best use | Global rules | Reusable flows |
MCP vs Skill
| Aspect | MCP | Skills |
|---|---|---|
| Essence | External-system connection protocol | Knowledge or flow |
| Capability provided | Tool interface and data access | Usage and business logic |
| Example | Slack, DB | Code-review flow |
They are usually combined: MCP provides the connection, Skills define the usage.
3. Plugins & Marketplace
Components can be packaged as a Plugin for distribution.
Plugin
├── Skills
├── Hooks
├── Subagents
└── MCP Servers
↓
Marketplace (package and distribute extension features)
Skills use namespaces (e.g. /my-plugin:review) to avoid collisions.
4. Component hierarchy and merge rules
Components stack in 4 layers (additive):
User level
↓
Project level
↓
Plugin level
↓
Managed policy level
The CLAUDE.md files of all layers are loaded and merged into the conversation context. Conflict resolution: more specific rules take precedence.
Combination usage examples
| Combination | Behavior | Example |
|---|---|---|
| Skills + MCP | MCP provides the connection, Skills define the usage | Skills describe the DB schema |
| Skills + Subagent | Skills launch multiple Subagents | /audit checks security and performance simultaneously |
| CLAUDE.md + Skills | Global rules + on-demand knowledge | CLAUDE.md defines the API conventions |
| Hook + MCP | Hook calls an external system | Notify Slack after a critical file change |
5. Context cost
Each extension component consumes the model’s context window.
| Component | Load timing | Loaded content | Context cost |
|---|---|---|---|
| CLAUDE.md | At session start | All content | Every request (high) |
| Skills | At session start + on invocation | Description + all content | Relatively low |
| MCP Servers | At session start | Tool definitions | Every request (high) |
| Subagents | At creation | Independent context | Isolated from the main session |
| Hooks | On trigger | None by default | Zero |
A balance between capability and cost is required. Tips: set disable-model-invocation: true and the Skill is loaded only on manual invocation, with zero cost.
Potential connection to the agent payment layer (under consideration)
The following are early-stage associations, subjects for future consideration.
- Provide payment capability as an MCP Server: any Agent calls Agent Payment Infrastructure Research Report via the MCP protocol (check_balance, authorize_payment, get_price, dispute). The lower layer depends on ERC-4337 Overview · Application-Layer Implementation of Account Abstraction
- Monetizing the Marketplace: after becoming Skill marketplace monetization, it can be used as the backend for billing/payment (for the choice of payment currency, see USD Stablecoin Interchange Market)
- Tiered budget management: user level → project level → Agent level → task level → single invocation, mapped to the component hierarchy
- Financial cost tracking: similar to context-cost tracking, track the financial cost of each Skill invocation (how much was spent, whether it is worth it)
These directions are unconfirmed, recorded only.
Textualization compiled · 2026-04-16