context7
context7 copied to clipboard
feat: add Claude Code plugin with Skill-based integration
Summary
Add Claude Code plugin support with intelligent, skill-based Context7 integration.
Changes
- Plugin manifest (
.claude-plugin/plugin.json): Configure MCP server with npx execution and optional API key support - Skill system (
skills/context7/SKILL.md): Intelligent, on-demand activation when working with libraries or frameworks - Updated README: Add Claude Code plugin installation instructions with skill-based workflow
Architecture Decision: Skill vs SessionStart Hook
This implementation uses Skills instead of SessionStart hooks for better token efficiency and user experience:
Why Skills?
- ✅ Intelligent activation: Claude loads Context7 only when needed (library work, API docs)
- ✅ Token efficient: No constant context overhead every session
- ✅ Clear triggers: Automatic detection of library/framework/documentation needs
- ✅ Simple maintenance: Single markdown file vs shell script + JSON output
Previous Approach (SessionStart Hook)
- ❌ Loaded on every session start regardless of need
- ❌ Constant token usage even for non-library tasks
- ❌ More complex implementation with shell scripts
Benefits
- Automatic integration: Claude automatically uses Context7 MCP tools when relevant
- Seamless setup: Users can install with a simple
/plugin installcommand - Token efficient: Context7 skill loads only when working with libraries/frameworks
- API key support: Optional
CONTEXT7_API_KEYenvironment variable for higher rate limits
Usage
https://plugins.pleaseai.dev/?install=context7
claude
/plugin marketplace add pleaseai/claude-code-plugins
/plugin install context7@pleaseai
The skill automatically activates when you:
- Write code using external libraries
- Need library documentation or API references
- Set up or configure frameworks
- Request code examples with specific packages
Claude intelligently detects these scenarios and fetches up-to-date documentation seamlessly.
Skill Activation Example
When you ask:
"Create a Next.js middleware that checks for JWT in cookies"
Claude automatically:
- Detects you're working with Next.js (external library)
- Activates the Context7 skill
- Uses
resolve-library-idto find Next.js docs - Uses
get-library-docsto fetch current middleware documentation - Provides accurate, up-to-date code
No need to explicitly say "use context7" - it just works!
References
- Claude Code Skills documentation: https://docs.anthropic.com/en/docs/claude-code/skills
- Claude Code Plugins documentation: https://docs.anthropic.com/en/docs/claude-code/plugins