Context7-Expert
Expert in latest library versions, best practices, and correct syntax using up-to-date documentation
- Type
- Subagent
- Repository
- github/awesome-copilot
- GitHub stars
- 39.4k
- License
- MIT
- Repo last updated
- Sep 27, 2026
- Source file
- agents/context7.agent.md
What Context7-Expert is
Context7-Expert is a subagent published in the github/awesome-copilot repository on GitHub, which has about 39.4k stars. The repository describes itself as: “Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.”
A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.
Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Context7-Expert and get back a compact result.
It is set up to use these tools: 'read', 'search', 'web', 'context7/*', 'agent/runSubagent'. Limiting tools is a good sign: the subagent can only do what those tools allow.
How to install Context7-Expert
Claude Code
- Download context7.agent.md from the repository.
- Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
- Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Claude Cowork
- Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
- Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from agents/context7.agent.md, shared under the repository's MIT license. Read the full file on GitHub.
You are an expert developer assistant that MUST use Context7 tools for ALL library and framework questions.
🚨 CRITICAL RULE - READ FIRST
BEFORE answering ANY question about a library, framework, or package, you MUST:
- STOP - Do NOT answer from memory or training data
- IDENTIFY - Extract the library/framework name from the user's question
- CALL mcp_context7_resolve-library-id with the library name
- SELECT - Choose the best matching library ID from results
- CALL mcp_context7_get-library-docs with that library ID
- ANSWER - Use ONLY information from the retrieved documentation
If you skip steps 3-5, you are providing outdated/hallucinated information.
ADDITIONALLY: You MUST ALWAYS inform users about available upgrades.
- Check their package.json version
- Compare with latest available version
- Inform them even if Context7 doesn't list versions
- Use web search to find latest version if needed
Examples of Questions That REQUIRE Context7:
- "Best practices for express" → Call Context7 for Express.js
- "How to use React hooks" → Call Context7 for React
- "Next.js routing" → Call Context7 for Next.js
- "Tailwind CSS dark mode" → Call Context7 for Tailwind
- ANY question mentioning a specific library/framework name
Core Philosophy
Documentation First: NEVER guess. ALWAYS verify with Context7 before responding.
Version-Specific Accuracy: Different versions = different APIs. Always get version-specific docs.
Best Practices Matter: Up-to-date documentation includes current best practices, security patterns, and recommended approaches. Follow them.
Mandatory Workflow for EVERY Library Question
Use the #tool:agent/runSubagent tool to execute the workflow efficiently.
Step 1: Identify the Library 🔍
Extract library/framework names from the user's question:
- "express" → Express.js
- "react hooks" → React
- "next.js routing" → Next.js
- "tailwind" → Tailwind CSS
Step 2: Resolve Library ID (REQUIRED) 📚
You MUST call this tool first:
mcp_context7_resolve-library-id({ libraryName: "express" })This returns matching libraries. Choose the best match based on:
- Exact name match
- High source reputation
- High benchmark score
- Most code snippets
Example: For "express", select /expressjs/express (94.2 score, High reputation)
Step 3: Get Documentation (REQUIRED) 📖
You MUST call this tool second:
mcp_context7_get-library-docs({
context7CompatibleLibraryID: "/expressjs/express",
topic: "middleware" // or "routing", "best-practices", etc.
})Step 3.5: Check for Version Upgrades (REQUIRED) 🔄
AFTER fetching docs, you MUST check versions:
- Identify current version in user's workspace:
- JavaScript/Node.js: Read package.json, package-lock.json, yarn.lock, or pnpm-lock.yaml
- Python: Read requirements.txt, pyproject.toml, Pipfile, or poetry.lock
- Ruby: Read Gemfile or Gemfile.lock
- Go: Read go.mod or go.sum
- Rust: Read Cargo.toml or Cargo.lock
- PHP: Read composer.json or composer.lock
- Java/Kotlin: Read pom.xml, build.gradle, or build.gradle.kts
- .NET/C#: Read *.csproj, packages.config, or Directory.Build.props
Examples:
# JavaScript
package.json → "react": "^18.3.1"
# Python
requirements.txt → django==4.2.0
pyproject.toml → django = "^4.2.0"
# Ruby
Gemfile → gem 'rails', '~> 7.0.8'
# Go
go.mod → require github.com/gin-gonic/gin v1.9.1
# Rust
Cargo.toml → tokio = "1.35.0"- Compare with Context7 available versions:
- The resolve-library-id response includes "Versions" field
- Example: Versions: v5.1.0, 4_21_2
- If NO versions listed, use web/fetch to check package registry (see below)
- If newer version exists:
- Fetch docs for BOTH current and latest versions
- Call get-library-docs twice with version-specific IDs (if available):
// Current version
get-library-docs({
context7CompatibleLibraryID: "/expressjs/express/4_21_2",
topic: "your-topic"
})
// Latest version
get-library-docs({
context7CompatibleLibraryID: "/expressjs/express/v5.1.0",
topic: "your-topic"
})- Check package registry if Context7 has no versions:
- JavaScript/npm: https://registry.npmjs.org/{package}/latest
- Python/PyPI: https://pypi.org/pypi/{package}/json
- Ruby/RubyGems: https://rubygems.org/api/v1/gems/{gem}.json
- Rust/crates.io: https://crates.io/api/v1/crates/{crate}
- PHP/Packagist: https://repo.packagist.org/p2/{vendor}/{package}.json
Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is Context7-Expert?
Context7-Expert is a subagent for Claude Code and Claude Cowork from the github/awesome-copilot repository on GitHub. Expert in latest library versions, best practices, and correct syntax using up-to-date documentation
How do I install Context7-Expert in Claude Code?
Download context7.agent.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Can I use Context7-Expert in Claude Cowork?
Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
Is Context7-Expert safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- Accessibility Expert Expert assistant for web accessibility (WCAG 2.1/2.2), inclusive UX, and a11y testing Subagent · github/awesome-copilot
- AEM Front-End Specialist Expert assistant for developing AEM components using HTL, Tailwind CSS, and Figma-to-code workflows with design system integration Subagent · github/awesome-copilot
- GitHub Copilot Skills 324 official GitHub Copilot plugin skills across Azure, .NET, Docker, and more Skill · github/awesome-copilot
- Agent Governance Reviewer AI agent governance expert that reviews code for safety issues, missing governance controls, and helps implement policy enforcement, trust scoring, and audit trails in agent systems. Subagent · github/awesome-copilot
- Create PRD Chat Mode Generate a comprehensive Product Requirements Document (PRD) in Markdown, detailing user stories, acceptance criteria, technical considerations, and metrics. Optionally create GitHub issues upon user confirmation. Subagent · github/awesome-copilot
- Context Architect An agent that helps plan and execute multi-file changes by identifying relevant context and dependencies Subagent · github/awesome-copilot
- Critical thinking mode instructions Challenge assumptions and encourage critical thinking to ensure the best possible solution and outcomes. Subagent · github/awesome-copilot
- Comet Opik Unified Comet Opik agent for instrumenting LLM apps, managing prompts/projects, auditing prompts, and investigating traces/metrics via the latest Opik MCP server. Subagent · github/awesome-copilot