# How the Claude-Code Plugin Dependency System Works: A Deep Dive into sap-gen-code and sap-dev-core

> Understand the Claude-Code plugin dependency system. Learn how sap-gen-code and sap-dev-core interact via manifest files and runtime enforcement for seamless plugin integration.

- Repository: [Anthropic/claude-plugins-community](https://github.com/anthropics/claude-plugins-community)
- Tags: deep-dive
- Published: 2026-09-12

---

**The Claude-Code plugin dependency system uses a manifest-driven approach where [`.claude-plugin/marketplace.json`](https://github.com/anthropics/claude-plugins-community/blob/main/.claude-plugin/marketplace.json) declares dependencies, the installer recursively resolves prerequisite plugins before installation, and the MCP server enforces these requirements at runtime.**

The **anthropics/claude-plugins-community** repository powers the Claude-Code plugin ecosystem through a centralized marketplace manifest. Understanding how this Claude-Code plugin dependency system resolves requirements like **sap-gen-code** depending on **sap-dev-core** ensures your development environment remains stable and your AI-assisted workflows execute without runtime errors.

## How Dependencies Are Declared in the Manifest

The dependency chain originates in [`.claude-plugin/marketplace.json`](https://github.com/anthropics/claude-plugins-community/blob/main/.claude-plugin/marketplace.json). Each plugin entry contains metadata that explicitly or implicitly signals requirements to the marketplace loader.

**Explicit dependency fields** appear as `dependsOn` arrays (or similar schema fields) within individual entries. When present, the marketplace loader parses these fields to build an installation graph.

**Implicit declaration** occurs through descriptive text. For example, the **sap-gen-code** entry states: *"Companion to `sap-dev-core` (install that first…)"*. While the manifest structure supports formal dependency arrays, many plugins currently rely on this human-readable convention within the `description` field.

```json
// Entry from .claude-plugin/marketplace.json
{
  "name": "sap-gen-code",
  "description": "ABAP code generation pipeline … Companion to sap-dev-core (install that first …).",
  "source": {
    "source": "git-subdir",
    "url": "https://github.com/sapdev-ai/sap-dev.git",
    "path": "plugins/sap-gen-code",
    "ref": "main"
  }
}

```

The **sap-dev-core** entry provides the foundational utilities:

```json
{
  "name": "sap-dev-core",
  "description": "Core SAP development utilities … shared resources used by all other sap-dev plugins.",
  "source": {
    "source": "git-subdir",
    "url": "https://github.com/sapdev-ai/sap-dev.git",
    "path": "plugins/sap-dev-core",
    "ref": "main"
  }
}

```

## The Installation and Resolution Process

When you execute the installation command, the Claude-Code CLI performs recursive dependency resolution guaranteed to satisfy prerequisites before dependent plugins.

The installer follows this sequence:

1. **Lookup**: Queries [`.claude-plugin/marketplace.json`](https://github.com/anthropics/claude-plugins-community/blob/main/.claude-plugin/marketplace.json) for the requested plugin metadata
2. **Dependency detection**: Examines the entry for `dependsOn` fields or parses description-based hints
3. **Recursive installation**: Clones and installs each dependency first, pulling from the external repository (e.g., `sap-dev.git`)
4. **Final installation**: Copies the requested plugin sub-directory (e.g., `plugins/sap-gen-code`) into the local `.claude-plugin/` tree only after all requirements are satisfied

```bash

# Install the core dependency first

claude install sap-dev-core

# Then install the dependent plugin

claude install sap-gen-code

```

The system pulls code from external Git repositories using the `git-subdir` source type, ensuring you always receive the version specified by the `ref` field (typically `main`).

## Shared Resources and Runtime Enforcement

Core plugins like **sap-dev-core** expose shared utilities through standardized directories: `shared/tables/` and `shared/scripts/`. Dependent plugins import these resources at runtime, allowing **sap-gen-code** to invoke ABAP generation utilities defined in the core.

The **MCP server** validates these relationships on every request. If you attempt to run **sap-gen-code** without **sap-dev-core** present, the server returns:

```

Missing required plugin `sap-dev-core`

```

This enforcement prevents execution of dependent plugins when their shared code bases are unavailable, ensuring pipeline integrity. The runtime loader automatically initializes core plugins before any dependent plugin code executes, making shared tables and scripts available in the correct scope.

## Working Example: sap-gen-code and sap-dev-core

Consider the practical workflow for SAP development. The **sap-dev-core** plugin establishes the foundational ABAP utilities and shared resource tables. **sap-gen-code** extends this foundation with specific generation pipelines.

Without the dependency system, **sap-gen-code** would fail when attempting to import from `shared/scripts/` or access tables defined in the core. The manifest-driven approach ensures:

- **sap-dev-core** clones into `.claude-plugin/sap-dev-core/` first
- Shared resources become available in the local filesystem
- **sap-gen-code** installs only after the core is fully initialized
- Runtime imports resolve correctly when generation commands execute

This architecture allows the **anthropics/claude-plugins-community** repository to host complex plugin families where specialized tools build upon common foundations without code duplication.

## Summary

- The Claude-Code plugin dependency system is driven by [`.claude-plugin/marketplace.json`](https://github.com/anthropics/claude-plugins-community/blob/main/.claude-plugin/marketplace.json), which lists every plugin and its requirements.
- Dependencies are declared through explicit `dependsOn` arrays or implicit description hints referencing prerequisite plugins.
- Installation is recursive: the CLI resolves and installs core plugins like **sap-dev-core** before dependents like **sap-gen-code**.
- Shared resources reside in `shared/tables/` and `shared/scripts/` directories within core plugins.
- The MCP server enforces dependencies at runtime, preventing execution and returning specific error messages when required plugins are missing.

## Frequently Asked Questions

### How does Claude-Code detect missing plugin dependencies before runtime?

The installer queries [`.claude-plugin/marketplace.json`](https://github.com/anthropics/claude-plugins-community/blob/main/.claude-plugin/marketplace.json) during the `claude install` command. It builds a dependency graph from `dependsOn` fields or parses dependency hints in the description text, then recursively installs prerequisites before the requested plugin. This guarantees that core utilities are present before dependent code attempts to import them.

### Can I install sap-gen-code without sap-dev-core if I don't need the shared features?

No. The MCP server enforces strict dependency requirements at runtime. Even if you manually copy **sap-gen-code** into the plugins directory, the server validates dependencies on each request and will return a "Missing required plugin `sap-dev-core`" error, preventing any execution until the core plugin is installed.

### Where does the plugin dependency system store shared resources?

Core plugins like **sap-dev-core** store shared utilities in standardized subdirectories: `shared/tables/` for data definitions and `shared/scripts/` for executable utilities. When the installer processes **sap-dev-core**, it clones the repository sub-directory (`plugins/sap-dev-core`) into your local `.claude-plugin/` tree, making these resources available for import by dependent plugins like **sap-gen-code**.

### What happens if two plugins require different versions of the same core dependency?

The current manifest format in [`marketplace.json`](https://github.com/anthropics/claude-plugins-community/blob/main/marketplace.json) uses Git references (the `ref` field, typically `main`) rather than semantic versioning. All dependent plugins point to the same repository URL and reference, ensuring consistency. The installer pulls the latest commit from the specified branch for all plugins in the dependency chain, preventing version conflicts within the Claude-Code plugin ecosystem.