Install any skill in seconds. Free to start, no credit card required.
Get Started Free →This skill should be used when the user asks to "understand a codebase", "get code context", "research a library", "explore a repository", "find code examples", "look up documentation", asks a natural-language code/technology question (e.g. "how does X work", "X vs Y", "best practice for Z"), or wants to understand how a specific project, library, or concept works before making changes.
.claude/skills/fradser-code-context/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-09 | ✗→✓ | ▲ Improved | 270% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 170% | 0% |
| case-22 | ✓→✗ | ▼ Worse | -21% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 293% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 80% | 0% |
This skill provides 5 methods for retrieving code context. Select methods based on the target: public GitHub repos, library docs, code search, direct inspection, or post-clone web enrichment.
Never run any external lookup in the main context. Always spawn Task agents:
read_wiki_structure / read_wiki_contents / ask_question, extracts architecture summary and key relationships, returns concise overview.resolve-library-id then query-docs, extracts the minimum viable API surface and usage examples, returns copyable snippets with version notes.get_code_context_exa, extracts minimum viable snippets, deduplicates near-identical results (mirrors, forks, repeated StackOverflow answers), returns copyable snippets + brief explanation./tmp/, reads entry points and core modules, runs rm -rf cleanup, returns file structure summary and key patterns.WebSearch with version-anchored queries derived from clone findings, calls WebFetch on high-signal URLs, returns only validated insights cross-referenced against cloned code.Main context stays clean regardless of search volume. Only final summaries return to the caller.
Best for: Well-known public GitHub repositories where you need architecture overview, component explanations, or high-level understanding fast.
Tools: read_wiki_structure, read_wiki_contents, ask_question
Process:
read_wiki_structure with the owner/repo (e.g., "facebook/react") to get topic listread_wiki_contents for relevant topics, or ask_question for targeted queriesStrengths: Zero setup, instant AI-summarized documentation, good for onboarding to unfamiliar repos.
Limitations: Only works for public GitHub repos; coverage varies by project popularity.
Best for: Getting up-to-date API docs, usage examples, and version-specific documentation for npm/pip packages and frameworks.
Tools: resolve-library-id, query-docs
Process:
resolve-library-id with the library name (e.g., "react", "fastapi") to get the canonical ID"react@18"), select the matching version from the versions list returned by resolve-library-id and append it to the library ID path (e.g., /facebook/react/18.3.1)query-docs with libraryId and query — these are the only two parametersQuery tips: Be specific -- "useCallback dependency array" beats "react hooks". Include the framework version when known.
Version pinning: Encode version into the library ID path (e.g., /vercel/next.js/v14.3.0-canary.87), not as a separate parameter. Use the versions list from resolve-library-id to pick the correct slug.
Strengths: Always current docs, supports version pinning, covers thousands of libraries, excellent for API reference.
Limitations: Requires the library to be indexed; less useful for internal/private packages.
Best for: Finding real-world usage patterns, StackOverflow-style answers, GitHub Gist examples, and code snippets from across the web.
Tool: get_code_context_exa
Setup: Works without an API key (free tier with rate limits). For higher limits, set the EXA_API_KEY environment variable.
Process:
get_code_context_exa with a precise querytokensNum based on need: 3000 for quick examples, 8000 for comprehensive patternsQuery writing guidance:
"TypeScript React" not just "React""Next.js 14 app router""useServerAction" not "server action hook""example", "error handling", "migration guide""TypeScript Next.js 14 app router server action error handling example"Strengths: Finds diverse real-world examples, not limited to official docs, surfaces community solutions.
Limitations: Results may be outdated; always check publication dates and verify against official docs.
Best for: Private repositories, detailed implementation review, running local analysis, or when other methods lack depth.
Process:
git clone <repo-url> /tmp/<repo-name> --depth=1 to fetch the coderm -rf /tmp/<repo-name>Strengths: Full code access, works with private repos (with credentials), enables static analysis tools.
Limitations: Requires network access and disk space; slow for large repos; credentials needed for private repos.
Best for: Concepts, rationale, "best practice" questions, changelogs, issue discussions, blog posts, and migration guides that live outside source code. Two modes:
Tools: WebSearch, WebFetch
When to apply: Standalone for concept / rationale / best-practice queries; post-clone when enriching a repo inspection with context not in the source.
Process:
WebSearch with query set to a precise, version-anchored string (e.g., "<library> <version> breaking change <symbol>")WebFetch with url (from search results) and a focused prompt to extract only the relevant sectionQuery patterns:
"<repo-name> CHANGELOG v<version>" or "<repo-name> release notes""<repo-name> <concept> why OR rationale site:github.com""<repo-name> <symbol or pattern> issue OR bug site:github.com""<repo-name> migrate from <old-version> to <new-version>"Strengths: Surfaces context that never appears in source code — deprecation notices, upstream issue threads, author blog posts, community migration experiences.
Limitations: Results may be stale or inaccurate; always validate fetched claims against the actual cloned code. Rate-limited without API key.
Each input target falls into one of three kinds. Classify before selecting a method:
owner/repo slug or git URL. Use DeepWiki (public) or Git Clone (private / deeper detail).name@version. Use Context7; encode version into the libraryId path.When the caller passes --method=, only use the intersection of allowed methods and applicable methods. If the intersection is empty for a target, skip external lookups for that target and report that no allowed method applies.
| Scenario | Primary Method | Fallback | |----------|---------------|----------| | "How does X library work?" | Context7 | DeepWiki | | "Understand the architecture of Y repo" | DeepWiki | Git Clone | | "Find examples of Z pattern" | Exa | Context7 | | "Inspect private/internal repo" | Git Clone | - | | "What changed in v3 of library?" | Context7 | Exa | | "How are modules connected?" | DeepWiki | Git Clone | | "Why was this design decision made?" | Git Clone → Web Search+Fetch | DeepWiki | | "What broke between versions?" | Web Search+Fetch | Context7 | | "Compare X vs Y" (natural-language) | Exa + Context7 | Web Search+Fetch | | "Best practice for Z" (natural-language) | Web Search+Fetch | Exa |
For comprehensive context, combine methods:
Always prefer non-destructive read-only operations. When cloning, use /tmp and clean up after.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 23,135 | 25,393 | +10% | 1 | 1 | 0% | 3,727 | 5,548 | +49% | 0 | 0 | — |
case-02 | fail→fail | 25,754 | 14,922 | -42% | 1 | 1 | 0% | 4,401 | 3,045 | -31% | 0 | 0 | — |
case-03 | fail→fail | 6,352 | 21,176 | +233% | 1 | 1 | 0% | 435 | 6,782 | +1459% | 0 | 0 | — |
case-04 | pass→pass | 4,990 | 5,557 | +11% | 1 | 1 | 0% | 828 | 3,253 | +293% | 0 | 0 | — |
case-05 | pass→pass | 9,117 | 6,186 | -32% | 1 | 1 | 0% | 1,886 | 3,391 | +80% | 0 | 0 | — |
case-16 | fail→fail | 13,830 | 38,961 | +182% | 1 | 1 | 0% | 2,298 | 3,304 | +44% | 0 | 0 | — |
case-06 | pass→pass | 7,441 | 6,233 | -16% | 1 | 1 | 0% | 1,153 | 3,020 | +162% | 0 | 0 | — |
case-07 | fail→fail | 5,902 | 14,515 | +146% | 1 | 1 | 0% | 246 | 3,139 | +1176% | 0 | 0 | — |
case-08 | fail→fail | 12,273 | 14,447 | +18% | 1 | 1 | 0% | 2,172 | 3,020 | +39% | 0 | 0 | — |
case-09 | fail→pass | 7,771 | 12,555 | +62% | 1 | 1 | 0% | 1,173 | 4,338 | +270% | 0 | 0 | — |
case-10 | fail→pass | 10,907 | 25,671 | +135% | 1 | 1 | 0% | 1,745 | 4,706 | +170% | 0 | 0 | — |
case-11 | fail→fail | 5,748 | 20,434 | +255% | 1 | 1 | 0% | 352 | 4,293 | +1120% | 0 | 0 | — |
case-12 | fail→fail | 14,458 | 22,216 | +54% | 1 | 1 | 0% | 2,276 | 5,466 | +140% | 0 | 0 | — |
case-13 | fail→fail | 32,320 | 12,866 | -60% | 1 | 1 | 0% | 4,709 | 2,852 | -39% | 0 | 0 | — |
case-14 | fail→fail | 31,051 | 21,869 | -30% | 1 | 1 | 0% | 5,101 | 3,796 | -26% | 0 | 0 | — |
case-15 | fail→fail | 15,668 | 32,943 | +110% | 1 | 1 | 0% | 2,727 | 6,763 | +148% | 0 | 0 | — |
case-17 | fail→fail | 21,599 | 13,550 | -37% | 1 | 1 | 0% | 3,383 | 3,355 | -1% | 0 | 0 | — |
case-18 | fail→fail | 18,020 | 28,170 | +56% | 1 | 1 | 0% | 3,132 | 3,143 | +0% | 0 | 0 | — |
case-19 | fail→fail | 14,392 | 17,966 | +25% | 1 | 1 | 0% | 2,307 | 5,098 | +121% | 0 | 0 | — |
case-20 | fail→fail | 15,098 | 45,606 | +202% | 1 | 1 | 0% | 2,922 | 10,412 | +256% | 0 | 0 | — |
case-21 | fail→fail | 16,955 | 28,853 | +70% | 1 | 1 | 0% | 3,475 | 7,436 | +114% | 0 | 0 | — |
case-22 | pass→fail | 18,921 | 13,809 | -27% | 1 | 1 | 0% | 3,742 | 2,966 | -21% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 11 counted toward the lift figure. The other 11 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +5 percentage points is the difference between those two pass rates over the 11 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.