Claude Code extension component architecture

Confidence: Certain Updated 2026-05-26 Review by 2026-10-30 Sources 3 Machine-translated Original (JA)
#agent-economy
On this page

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.

ComponentRoleUse caseExample
CLAUDE.mdHolds persistent context, auto-loaded every sessionProject Specs (project conventions, global rules)Use pnpm; test before commit
SkillsReusable capability modules (knowledge, instructions, workflows), loaded on demandReference Docs / Standard Tasks”/deploy to run deployment”
SubagentAn independent sub-Agent. Runs in an isolated context and returns a result summaryContext Isolation / Parallel TasksParse a file and return a conclusion
Agent TeamsMultiple Agents collaborate, sharing a task list and communicating with each otherParallel Research / Complex DevLaunch multiple reviewers
MCPConnects to external systems and tools, accessing external data/actionsExternal Data / ActionsDB query; Slack send
HookAn automation script outside the loop. Triggered on specific eventsDeterministic AutomationRun ESLint after changes

2. Distinctions between components

Skills vs Subagent

AspectSkillsSubagent
EssenceReusable knowledge or flowIndependent execution unit
Core valueReuse content across different tasksContext isolation
Fitting scenarioReference material, standard flowsLarge-scale code analysis or parallel tasks

CLAUDE.md vs Skills

AspectCLAUDE.mdSkills
Loading methodAuto-loaded every sessionLoaded on demand
File referenceSupports @pathSupports @path
Can trigger a flowNoYes
Best useGlobal rulesReusable flows

MCP vs Skill

AspectMCPSkills
EssenceExternal-system connection protocolKnowledge or flow
Capability providedTool interface and data accessUsage and business logic
ExampleSlack, DBCode-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

CombinationBehaviorExample
Skills + MCPMCP provides the connection, Skills define the usageSkills describe the DB schema
Skills + SubagentSkills launch multiple Subagents/audit checks security and performance simultaneously
CLAUDE.md + SkillsGlobal rules + on-demand knowledgeCLAUDE.md defines the API conventions
Hook + MCPHook calls an external systemNotify Slack after a critical file change

5. Context cost

Each extension component consumes the model’s context window.

ComponentLoad timingLoaded contentContext cost
CLAUDE.mdAt session startAll contentEvery request (high)
SkillsAt session start + on invocationDescription + all contentRelatively low
MCP ServersAt session startTool definitionsEvery request (high)
SubagentsAt creationIndependent contextIsolated from the main session
HooksOn triggerNone by defaultZero

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.

  1. 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
  2. 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)
  3. Tiered budget management: user level → project level → Agent level → task level → single invocation, mapped to the component hierarchy
  4. 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