Version: 0.3.0
Retrieve code context for any repo, library, or natural-language query via 5 methods: DeepWiki, Context7, Exa, git clone, and web search+fetch.
claude plugin install code-context@frad-dotclaudeCode Context accepts arbitrary input — a natural-language question, a repo slug, a library name, or several of these at once — and routes each target to the right method(s). It isolates external lookups in agent contexts to keep the main conversation clean, returning only synthesized summaries.
Best for: Public GitHub repositories requiring architecture overview, component explanations, or high-level understanding.
MCP Tools: read_wiki_structure, read_wiki_contents, ask_question
Process:
- Call
read_wiki_structurewith owner/repo (e.g.,"facebook/react") - Call
read_wiki_contentsfor relevant topics, orask_questionfor targeted queries
Strengths: Zero setup, instant AI-summarized documentation.
Limitations: Only works for public GitHub repos; coverage varies by popularity.
Best for: Getting up-to-date API docs, usage examples, and version-specific documentation for npm/pip packages.
MCP Tools: resolve-library-id, query-docs
Process:
- Call
resolve-library-idwith library name (e.g.,"react","fastapi") - Call
query-docswithlibraryIdand query
Version pinning: Encode version into library ID path: /facebook/react/18.3.1
Strengths: Always current docs, supports version pinning, covers thousands of libraries.
Limitations: Requires the library to be indexed; less useful for internal packages.
Best for: Finding real-world usage patterns, StackOverflow answers, GitHub Gist examples.
MCP Tool: get_code_context_exa
Setup: Works without API key (free tier). Set EXA_API_KEY for higher limits.
Query tips:
- Include language:
"TypeScript React" - Include version:
"Next.js 14 app router" - Use exact identifiers:
"useServerAction" - Add pattern type:
"example","error handling"
Strengths: Finds diverse real-world examples beyond official docs.
Limitations: Results may be outdated; verify publication dates.
Best for: Private repositories, detailed implementation review, or when other methods lack depth.
Process:
git clone <repo-url> /tmp/<repo-name> --depth=1- Read key files: entry points, configuration, core modules
- Use Glob/Grep to analyze structure and patterns
- Clean up:
rm -rf /tmp/<repo-name>
Strengths: Full code access, works with private repos.
Limitations: Requires network/disk space; slow for large repos.
Best for: Enriching clone findings with changelogs, issue discussions, migration guides.
Tools: WebSearch, WebFetch
When to use: After completing Method 4. Gives you the why and what changed.
Query patterns:
- Changelogs:
"<repo> CHANGELOG v<version>" - Design rationale:
"<repo> <concept> why OR rationale site:github.com" - Migration:
"<repo> migrate from <old> to <new>"
Strengths: Surfaces context never in source code.
Limitations: Results may be stale; always validate against actual code.
User-invoked command accepting arbitrary input — a natural-language question, a repo slug, a library name, or several targets at once.
# Natural-language question (single quoted target)
/get-context "对比 zustand vs jotai 状态管理"
/get-context "React 19 server actions 错误处理"
# Library or repo
/get-context react
/get-context facebook/react
# Multiple targets at once
/get-context facebook/react zustand
# Restrict methods (comma-separated; default: all)
/get-context "React 19 server actions 错误处理" --method=context7,exa
/get-context facebook/react --method=deepwiki
# Auto-detect from local dependencies
/get-context--method= accepts deepwiki,context7,exa,clone,web,all (comma-separated). The agent classifies each target (repo / library / natural-language) and routes it through the allowed methods, noting any gap when the allowed set can't cover a target.
Spawns isolated lookup agent that executes the full workflow.
@context-researcher How does Zustand manage state under the hood?The agent explores local context first, selects methods based on gaps, executes lookups, and returns a synthesized summary.
Internal knowledge skill loaded by the context-researcher agent. Provides method selection guidance and query standards.
| Scenario | Primary | Fallback |
|---|---|---|
| "How does X library work?" | Context7 | DeepWiki |
| "Understand Y repo architecture" | DeepWiki | Git Clone |
| "Find examples of Z pattern" | Exa | Context7 |
| "Inspect private/internal repo" | Git Clone | - |
| "What changed in v3?" | Context7 | Exa |
| "How are modules connected?" | DeepWiki | Git Clone |
| "Why was this design decision?" | Git Clone → Web Search | DeepWiki |
| "Compare X vs Y" (natural-language) | Exa + Context7 | Web Search |
| "Best practice for Z" (natural-language) | Web Search | Exa |
code-context/
├── .claude-plugin/
│ └── plugin.json # Manifest (skills: [./skills/code-context], commands: [./skills/get-context])
├── agents/
│ └── context-researcher.md # Isolated research agent
├── skills/
│ ├── code-context/ # Knowledge skill (internal)
│ │ └── SKILL.md # Method selection guide
│ └── get-context/ # User-invocable command
│ └── SKILL.md # Command workflow
├── .mcp.json # MCP server configuration
└── README.md
The plugin uses these MCP servers (configured in .mcp.json):
- deepwiki-code-context: Repo documentation and architecture
- context7-code-context: Library documentation lookup
- exa-code-context: Web-wide code search
- Claude Code CLI
- MCP servers configured (see
.mcp.json) - Network access for external lookups
- Local first: Always check local context (package.json, imports) before external lookups
- Isolated execution: External lookups run in agent context to keep main conversation clean
- Combine methods: For comprehensive context, use DeepWiki → Context7 → Exa → Clone
- Verify sources: Cross-reference fetched content against actual code
MIT
Frad LEE (fradser@gmail.com)