Skip to content

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.

ComponentTriggerWhat Is Loaded
SkillLLM activates based on name/descriptionFull SKILL.md body
AgentUser or LLM activates the agentFull AGENT.md body
CommandUser invokes the slash commandFull command file content
HookHost event fires matching the event typeHook script executed
MCP serverFirst tool invocation targeting the serverServer process started
LSP serverFirst file matching the language scopeServer 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.