Claude Code
| Target id | Package | Ship with |
|---|---|---|
claude-code |
@oiap/exporter-claude-code |
oiap sync (git install) or install-agent-plugin |
npx oiap build oiap.plugin.ts --target claude-code --out dist/claude-codenpx install-agent-plugin <owner>/<repo> --plugin <plugin-id> --agent claude-codeClaude Code target exporter for Open Interoperable Agent Plugins.
This package lowers OIAP plugin primitives into a Claude Code plugin directory.
The generated bundle follows Claude’s plugin layout: .claude-plugin/plugin.json
at the plugin root, with skills/, commands/, agents/, hooks/hooks.json,
.mcp.json, and settings.json as root-level plugin files when those surfaces
are present.
import { definePlugin, hook, allow } from "@oiap/core";import { exportClaudeCode } from "@oiap/exporter-claude-code";
const plugin = definePlugin({ manifest: { id: "hello-claude", name: "Hello Claude", version: "0.0.0", description: "Small Claude Code exporter smoke plugin.", categories: ["example"], supportedTargets: ["claude-code"], }, hooks: [hook.beforeTool("allow-all", () => allow())],});
const bundle = exportClaudeCode(plugin);Most authors should use the CLI instead of importing the exporter directly:
bun run oiap build ./oiap.plugin.ts --target claude-code --out ./build/claudeThe exporter renders valid Claude hook configuration that calls the generated
.oiap/runtime/runner.mjs raw-JS hook runtime. Portable function handlers are
bundled into .oiap/runtime/hooks.mjs; non-portable target-module hooks are
reported as degraded metadata.
Install paths
Section titled “Install paths”Where install-agent-plugin and installPlugin() write the bundle, from the target profile. --out <dir> overrides them.
| Scope | Path |
|---|---|
| Local (default) | ./.claude/plugins/<plugin-id> |
Global (--global) |
~/.claude/plugins/<plugin-id> |
Support matrix
Section titled “Support matrix”From the platform support matrix (see its legend).
| Profile | Package | Rules | Skills | Commands | Hooks | Agents | MCP | Runtime | Policy |
|---|---|---|---|---|---|---|---|---|---|
| core | Y | Y | Y | Y | Y | Y | Y | P | P |
Platform notes
Section titled “Platform notes”High-fidelity native package target. Verify plugin package metadata, skills, commands, subagents, hooks, MCP, settings, binaries, and policy-related settings against current docs.