Files
Holocron/plugins/kyberforge/docs/research/docs/claude-code-plugins/api-reference.md
T
Defame1297andClaude Sonnet 4.6 4f73f54b44 docs(kyberforge): add Claude Code plugins and subagents research
Research from official docs (code.claude.com) and Context7, covering
plugin manifest schema, agent definition frontmatter spec, scope
priority, marketplace distribution, and plugin subagent restrictions.
Foundation for writing an agent-author skill.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-06-27 10:39:41 +00:00

5.0 KiB

topic, source_keys
topic source_keys
api-reference
context7-websites-code-claude
claude-code-plugins-docs
claude-code-subagents-docs

Plugin Manifest Fields (plugin.json)

Field Type Required Description
name string Yes (for namespacing) Unique plugin identifier; prefix for skill names
displayName string No Human-readable name shown in plugin manager
version string No If omitted, git commit SHA is used
description string No Shown in plugin manager
author object No { name, email, url }
homepage string No Documentation URL
repository string No Source repository URL
license string No SPDX license identifier
keywords string[] No Search/discovery tags
skills string No Path to skills directory (default: ./skills/)
agents string[] No Explicit list of agent file paths
hooks string No Path to hooks.json
mcpServers string No Path to MCP server config
lspServers string No Path to .lsp.json
outputStyles string No Path to output styles directory
experimental.themes string No Path to themes directory
experimental.monitors string No Path to monitors.json
dependencies array No Plugin dependencies; string or { name, version }

Agent Frontmatter Fields

Field Type Required Plugin subagent? Description
name string Yes Yes Unique, lowercase + hyphens; hooks receive as agent_type
description string Yes Yes Tells Claude when to delegate; "use proactively" triggers auto-invocation
tools string / list No Yes Allowlist; Agent(t1,t2) restricts spawnable subagent types
disallowedTools string / list No Yes Denylist; applied before tools; supports mcp__* glob patterns
model string No Yes sonnet/opus/haiku/fable alias, full model ID, or inherit
effort string / number No Yes low/medium/high/xhigh/max or numeric
maxTurns integer No Yes Max agentic turns before stopping
permissionMode string No No default/acceptEdits/auto/dontAsk/bypassPermissions/plan
skills list No Yes Skill names to preload into context at startup
mcpServers object / list No No Inline server defs or string references to configured servers
hooks object No No Per-agent PreToolUse/PostToolUse/Stop handlers
memory string No Yes user/project/local; enables MEMORY.md persistence
background boolean No Yes Force background execution (default: false)
isolation string No Yes worktree runs in isolated git worktree
color string No Yes UI color: red/blue/green/yellow/purple/orange/pink/cyan
initialPrompt string No Yes Auto-submitted first user turn when agent is main session thread

Fields marked No in the "Plugin subagent?" column are silently ignored when the agent file lives in a plugin's agents/ directory.

CLI Flags

Flag Description
--plugin-dir <path> Load a plugin directory or .zip archive for this session
--plugin-url <url> Load a plugin from a URL-hosted zip
--agents '<json>' Define session-only subagents as JSON (uses prompt not markdown body)
--agent <name> Run entire session as the named subagent
--disallowedTools 'Agent(name)' Block specific subagents

Multiple --plugin-dir flags are supported for loading multiple plugins.

In-Session Commands

Command Description
/reload-plugins Pick up plugin file changes without restarting the session
/plugin install Install a plugin from a configured marketplace
/plugin marketplace add <source> Add a marketplace source
claude plugin init <name> Scaffold a new plugin under ~/.claude/skills/<name>/
claude plugin validate Run the same lint checks the marketplace submission pipeline runs
/agents Open the agent management UI (Running + Library tabs)
/fork <directive> Spawn a fork subagent inheriting full conversation history
@agent-<name> Invoke a specific subagent for one task
@agent-<plugin>:<name> Invoke a scoped plugin subagent for one task

Environment Variables

Variable Description
CLAUDE_CODE_SUBAGENT_MODEL Override model for all subagents
CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS=1 Remove built-ins in non-interactive/SDK mode
CLAUDE_CODE_FORK_SUBAGENT=1 Enable fork mode (experimental; also forces all spawns background)
CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1 Disable background task functionality
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE Apply to subagent auto-compaction

Subagent Transcript Storage

Subagent transcripts are stored at:

~/.claude/projects/{project}/{sessionId}/subagents/agent-{agentId}.jsonl

Cleanup period is controlled by the cleanupPeriodDays setting (default 30 days).