[FEATURE] Support for Plugin Dependencies and Shared Resources
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Summary
Add support for plugin dependencies and shared resource libraries to the Claude Code plugin system, enabling plugins to declare dependencies on other plugins or common libraries.
Motivation
Current Limitation
Today, plugins are completely independent units. If multiple plugins need the same agents, hooks, or utilities, each plugin must duplicate these resources. This leads to:
- File duplication - Same agent definitions copied across multiple plugins
- Maintenance burden - Updates must be applied to all copies
- Inconsistency risk - Copies can drift out of sync
- Storage waste - duplicated agents in the marketplace
Real-World Example
Our marketplace has 11 plugins. We had to copy 32 agents across 7 plugins because:
@code-archaeologistis used by: epcc-workflow, documentation, architecture, tdd-workflow, performance@security-revieweris used by: epcc-workflow, architecture, tdd-workflow, security@test-generatoris used by: epcc-workflow, documentation, architecture, tdd-workflow, testing
Without dependencies: Copy 32 agents = duplication
With dependencies: 1 common-core plugin = no duplication
Pros: Simple, no changes needed
Cons: Maintenance burden, inconsistency risk
Verdict: ❌ Not scalable as marketplace grows
2. Documentation-Only Dependencies
Tell users "install common-core first"
Pros: No code changes
Cons: ❌ Not enforced, easy to miss, poor UX
Verdict: ❌ Unreliable
3. Monolithic Plugins
Make each plugin completely self-contained
Pros: Always works
Cons: ❌ Massive duplication (current solution)
Verdict: ✅ Good short-term, ❌ bad long-term
Related Issues
- Plugin system scalability
- Marketplace organization
- Plugin development experience
Proposed Solution
Proposed Solution
1. Plugin Dependencies in Manifest
Add dependencies field to plugin.json:
{
"name": "epcc-workflow",
"version": "1.0.0",
"dependencies": {
"common-core": "^1.0.0",
"security-core": "^2.1.0"
},
"agents": ["agents/"],
"commands": ["commands/"]
}
2. Common Resource Plugins
Allow plugins to declare themselves as libraries:
{
"name": "common-core",
"version": "1.0.0",
"type": "library",
"description": "Common agents used across multiple plugins",
"agents": ["agents/"],
"exports": {
"agents": [
"code-archaeologist",
"system-designer",
"business-analyst"
]
}
}
3. Automatic Dependency Resolution
When installing a plugin:
/plugin install epcc-workflow@claude-code-plugins
# Claude Code automatically:
✓ Resolving dependencies...
✓ Installing common-core@1.0.0
✓ Installing security-core@2.1.0
✓ Installing epcc-workflow@1.0.0
✓ All dependencies satisfied
4. Shared Resource Directory Structure
~/.claude/plugins/
├── epcc-workflow@1.0.0/
│ ├── commands/
│ └── .claude-plugin/plugin.json # declares dependencies
├── common-core@1.0.0/
│ ├── agents/
│ │ ├── code-archaeologist.md
│ │ └── system-designer.md
│ └── .claude-plugin/plugin.json # type: "library"
Plugins can reference shared agents:
# From epcc-workflow commands
@code-archaeologist # Resolves from common-core dependency
Benefits
For Plugin Authors
- ✅ DRY principle - Define agents once, reuse everywhere
- ✅ Easier maintenance - Update one file, all plugins benefit
- ✅ Smaller plugins - Plugins only contain unique resources
- ✅ Clear dependencies - Explicit dependency graph
For Users
- ✅ Automatic installation - Dependencies installed transparently
- ✅ Faster installs - Shared resources downloaded once
- ✅ Consistency - Same agent version across all plugins
- ✅ Better reliability - Fewer missing dependency errors
For Marketplace
- ✅ Scalability - More plugins without N² duplication
- ✅ Quality - Centralized, well-tested common resources
- ✅ Organization - Clear separation of concerns
Design Considerations
Dependency Resolution
- Semver support -
"^1.0.0","~2.1.0",">=1.5.0" - Circular dependency detection - Fail with clear error
- Version conflicts - Choose highest compatible version
- Peer dependencies - Optional for flexibility
Performance
- Lazy loading - Only load dependencies when needed
- Caching - Shared resources cached for speed
- Parallel installs - Install dependencies concurrently
Backwards Compatibility
- Optional feature - Plugins without dependencies still work
- Graceful degradation - Fall back to bundled resources if dependency unavailable
- Migration path - Clear documentation for converting existing plugins
Alternative Solutions
Alternative Approaches Considered
1. Continue with Duplication (Current)
Pros: Simple, no changes needed
Cons: Maintenance burden, inconsistency risk
Verdict: ❌ Not scalable as marketplace grows
2. Documentation-Only Dependencies
Tell users "install common-core first"
Pros: No code changes
Cons: ❌ Not enforced, easy to miss, poor UX
Verdict: ❌ Unreliable
3. Monolithic Plugins
Make each plugin completely self-contained
Pros: Always works
Cons: ❌ Massive duplication (current solution)
Verdict: ✅ Good short-term, ❌ bad long-term
Related Issues
- Plugin system scalability
- Marketplace organization
- Plugin development experience
Priority
Medium - Would be very helpful
Feature Category
Configuration and settings
Use Case Example
Real-World Example:
[AWS Advanced Agent Patterns] (https://github.com/aws-samples/anthropic-on-aws/tree/main/advanced-claude-code-patterns)
Our proposed marketplace has 11 plugins. We had to copy 32 agents across 7 plugins because:
@code-archaeologistis used by: epcc-workflow, documentation, architecture, tdd-workflow, performance@security-revieweris used by: epcc-workflow, architecture, tdd-workflow, security@test-generatoris used by: epcc-workflow, documentation, architecture, tdd-workflow, testing
Without dependencies: Copy 32 agents = duplication
With dependencies: 1 common-core plugin = no duplication
Pros: Simple, no changes needed
Cons: Maintenance burden, inconsistency risk
Verdict: ❌ Not scalable as marketplace grows
2. Documentation-Only Dependencies
Tell users "install common-core first"
Pros: No code changes
Cons: ❌ Not enforced, easy to miss, poor UX
Verdict: ❌ Unreliable
3. Monolithic Plugins
Make each plugin completely self-contained
Pros: Always works
Cons: ❌ Massive duplication (current solution)
Verdict: ✅ Good short-term, ❌ bad long-term
Examples from Other Systems
NPM/Node.js
{
"dependencies": {
"lodash": "^4.17.21"
},
"peerDependencies": {
"react": ">=16.0.0"
}
}
Python pip
install_requires=[
'requests>=2.25.0',
'numpy~=1.20.0'
]
VSCode Extensions
{
"extensionDependencies": [
"ms-python.python"
]
}
18 Comments
I would argue this is a work around, not a solution. In my opinion the solution would use the same @ reference already implemented but be context aware of the marketplace.
I tested this and, unless I am missing something, You cannot reference things at the market place root from a plugin due to the schema requirement that the plugin paths start with ./. see error below.
⎿ Failed to load all marketplaces. Errors: test-marketplace: Invalid schema:
plugins.0.skills.0: Invalid input: must start with "./",
"plugins": [
{
"name": "test",
"source": "./plugins/test",
"description": "test",
"strict": false,
"commands": [
"./hello.md"
],
"skills": [
"../dep.md"
]
},
Edit: I figured out how to reference, it requires raising the source path. It does not work with @ reference but does work with "use skill X". Still feels like a workaround, its not awesome.
thank you @jawhnycooke...I was just about to file a feature request before I found yours
Regarding the dependencies block
The current structure:
While this follows the familiar npm/PyPI pattern, it assumes a single centralized marketplace. To support multiple Claude Code Marketplaces/Plugins, including private/internal registries, I'd suggest a more flexible structure:
This approach would:
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
Building on what @smar-sean-sekora suggests, I might also add that local referenced plugins should probably not have a version. I'd probably consider the reference similar to github actions, where references to remote repos can use a tag or sha or branch.
I'd forsee some basic issues here though: when you have dependencies, how do you ensure those dependencies do their thing before you need to (eg hook ordering).
One thing that made me think about this was the potential for a plugin that contains a bunch of supporting rules, and an mcp server that syncs those rules in to the .claude folder for an org to use to sync rules. (the mcp server doesn't do anything, it just uses the execution to kick off the syncing process and potentially watch for updates on long running sessions)
To this end, I wanted to make a plugin that handled the basic ideas of the syncing and mcp server with no rules, and another plugin that depended on that other plugin to sync it's rules.
To help mitigate issues, perhaps plugins should opt in to being used as a dependency by stating in their schema that they take inputs, which then lets the depend-_er_ define the dependency and then pass it's own info to the other plugin.
As I type this, while "dependencies" feels like the right term, the actuality is that this feels a bit more like github actions. Having the following as the schema would enact the above ideas:
The update to the schema for the plugins that can be depended on could look like:
What if we use a git submodule placed inside the your own plugin folder, then it would look something like:
``
``"plugins": [
{
"name": "test",
"source": "./plugins/test",
"description": "test",
"strict": false,
"commands": [
"./hello.md"
],
"skills": [
"./{submodulename}/dep.md"
]
},
Then, for updating it is not hard to set an action that auto-update submodules.
Did someone tried a workaround like this? Would that work?
Cross marketplace dependencies feel like an unstoppable pandoras box of complexity, constant bugs, and unpredictable behavior. It's hard to look at the constant problems with npm (and even python, pre-uv) and say "Yes that's a successful pattern we should be duplicating!"
Within a single market place though, seems fine. Would be nice to have some way of sharing resources across plugins within strict mode without resorting to symlinks.
I landed here looking how to require an NPM package of Skills from the WordPress AI project, https://github.com/WordPress/agent-skills from within a Claude Code plugin.
I can see the value in allowing for plugins to have dependencies other than Claude Plugins, as folks create LLM abstracted Skills and Agents as packages.
I feel like @smar-sean-sekora comment above would help achieve this.
My entire organization is avoiding the use of plugins because MCPs are currently not managed as shared resources, which can create a lot of context window waste, especially with large numbers of plugins and MCPs.
Reducing redundancy should at least be rather simple for remotely deployed MCPs, given that the URL can determine redundancy.
I'd love to see this implemented even in minimal form.
+1, I have shared utilities packaged as plugins which I'd love to use as dependencies for other plugins.
+1, this would help here as well.
+1, it would be nice to have a core plugin with skills that other higher level plugins can depend on. This can ofcourse be done manually at the moment, but requires engineers to know the dependency tree and enable/disable other plugins accordingly.
Until the plugin system supports formal dependencies, here are patterns for sharing resources between plugins:
Workaround 1 — Shared skills directory:
Create a shared library as a separate "plugin" that only contains skills:
Each plugin references shared skills by name in their SKILL.md instructions.
Workaround 2 — Symlinks for shared files:
Workaround 3 — Monorepo-style plugin with multiple skills:
Instead of multiple interdependent plugins, create one plugin with multiple skills:
Skills within the same plugin can reference each other naturally.
Workaround 4 — CLAUDE.md as the dependency resolver:
This looks to be already documented and available: https://code.claude.com/docs/en/plugin-dependencies.md
Anyone tested it ?
Seems like they added it on apr 28:
https://code.claude.com/docs/en/changelog#2-1-121
https://code.claude.com/docs/en/plugin-dependencies
I haven't tried it yet
I built a small tool: npx @lucassantana/sharekit install <user> pulls a CLAUDE.md + skills from a <user>/sharekit-profile repo, previews a diff, backs up, rollbacks. File-based (no service), so a team keeps one profile repo as the shared source.
Not Anthropic-affiliated, just scratching the same itch
[github.com/LucasSantana-Dev/sharekit](github.com/LucasSantana-Dev/sharekit)