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
Related
Discovery
Keep reading
Read next
- Coinbase CDP · developer platform · AI agent on-chain wallet infrastructure This entry sits under AI Agent payment protocol overview · seven-protocol survey. Read it against x402 · AI agent payment protocol that revived HTTP 402 for peer / contrast context and payme... agent-economy/coinbase-cdp-developer-platform
- Crossmint agent SDK · NFT and wallet abstraction for AI agents This entry sits under AI Agent payment protocols seven-protocol overview. Read it against Privy embedded wallet and Coinbase CDP for peer wallet stacks, embedded wallet consolidation for mar... agent-economy/crossmint-agent-sdk
- Embedded-wallet custody bankruptcy mechanics · what happens to end-user funds if Privy / Stripe / Coinbase CDP / AWS Bedrock fails End-user funds in an embedded wallet are on-chain at an address the user controls jointly with the provider, not on the provider's balance sheet. If Privy, Stripe (the Privy parent), Coinbas... agent-economy/embedded-wallet-custody-bankruptcy-mechanics
Links here
- Agent Payment Infrastructure Research Report This entry sits under AI agent payment protocols overview: seven-protocol map. Read it against paid skill-market monetization for peer / contrast context and payments index for the broader s... agent-economy/2026-04-08_agent-payment-infrastructure-research
- Agent-driven market data interpretation pipeline · feed → LLM → signal → trading system The 2026 agent-driven market data pipeline is a four-stage compound: (1) ingest raw market data from Bloomberg, Reuters / Refinitiv, Nikkei, exchange direct feeds, regulator releases, corpor... agent-economy/agent-driven-market-data-interpretation-pipeline
- AI agent legal and tax liability framework · who is liable, how is agent income taxed As of mid-2026, no major financial regulator (US SEC / CFTC / FinCEN, UK FCA, Japan FSA, Singapore MAS, EU ESMA / EBA) has formally granted AI agents independent legal personhood, and no maj... agent-economy/agent-legal-tax-liability-framework
- Agent Payment Protocol four-way comparison matrix 2026 · AP2 / x402 / Skyfire / Nevermined plus ERC-7715 + Lit PKP This entry sits under agent-economy index. Read it against AI Agent 決済プロトコル全体図 · 7プロトコル俯瞰 for the broader seven-protocol landscape, agent protocol mainnet adoption 2026 for production-readin... agent-economy/agent-payment-protocol-four-way-comparison-2026
- Agent Protocol Mainnet Adoption · 2026-05 Production-Readiness Snapshot As of May 2026, the agent-payment protocol stack has bifurcated sharply between mainnet-shipped infrastructure and testnet / consortium-only specs. The production-live tier is dominated by x... agent-economy/agent-protocol-mainnet-adoption-2026