Lazy Loading
D.4 Lazy Loading
Section titled “D.4 Lazy Loading”Description: Only package metadata is loaded at session startup. Full component content (SKILL.md bodies, AGENT.md bodies, command files) is deferred until the component is actually invoked. This minimizes startup time and context token consumption.
Requires: A host-level mechanism to index component metadata (name, description, type) separately from component content, and to load full content on demand at invocation time.
Ideal behavior: At session start, the host reads only frontmatter or manifest-level metadata for each installed component. When a skill is activated, the full SKILL.md body is loaded. When a command is invoked, the full command file is read. MCP and LSP servers start their processes only on first relevant invocation.
| Component | Trigger | What Is Loaded |
|---|---|---|
| Skill | LLM activates based on name/description | Full SKILL.md body |
| Agent | User or LLM activates the agent | Full AGENT.md body |
| Command | User invokes the slash command | Full command file content |
| Hook | Host event fires matching the event type | Hook script executed |
| MCP server | First tool invocation targeting the server | Server process started |
| LSP server | First file matching the language scope | Server process started |
Current behavior: Some hosts load skill frontmatter at startup and defer SKILL.md body loading until invocation. This partial lazy loading is host-native behavior, not something ccpkg controls. Other component types do not have equivalent deferred loading in most hosts. ccpkg packages should be structured to take advantage of whatever lazy loading the host provides, but MUST NOT depend on it. Check the host’s adoption specification capabilities.lazy_loading field for current support status.