Agent skill
github-codebase-search
Semantic search for public GitHub repos without cloning. Use when the user wants to understand how an external library or framework works internally, investigate upstream bugs, trace code paths in a repo they haven't cloned, or search GitHub source code by intent. Do NOT use for local codebase questions (use codebase-search), documentation lookup (use context7), or private repos.
Install this agent skill to your Project
npx add-skill https://github.com/trancong12102/agentskills/tree/main/github-codebase-search
SKILL.md
github-codebase-search
Semantic search for public GitHub repositories powered by MorphLLM — an RL-trained subagent that runs parallel grep+read calls against the GitHub API to answer natural language questions about code. No cloning required.
Requires MORPH_API_KEY environment variable.
When to Use
- Understanding how a library or framework works internally (e.g., "how does Next.js resolve middleware?")
- Investigating upstream bugs or behavior in open-source dependencies
- Learning from reference implementations in well-known repos
- Tracing code paths in a repo you haven't cloned locally
- Exploring how an OSS project is structured or architected
When NOT to Use
- Questions about the local codebase — use codebase-search
- Private repositories (GitHub API access required)
- Simple documentation lookup — use context7
- Simple GitHub UI browsing (viewing READMEs, issues, PRs)
Decision Rule
Is the code on GitHub and not cloned locally? Use github-codebase-search. Is it in the local repo? Use codebase-search.
| Task | Tool |
|---|---|
| How does Next.js resolve API routes? | github-codebase-search |
| How does our auth middleware work? | codebase-search |
| How does Prisma handle migrations internally? | github-codebase-search |
| Where is the database config in our repo? | codebase-search |
| What does React's reconciler do with fibers? | github-codebase-search |
| What does the React docs say about useEffect? | context7 |
Workflow
DO NOT read script source code. Run scripts directly and use --help for usage.
Run a Semantic Search
python3 scripts/github-codebase-search.py search "<natural language query>" --repo <owner/repo>
query— a natural language question about the code--repo— GitHub repository inowner/repoformat (e.g.,vercel/next.js)--url— alternative: full GitHub URL (e.g.,https://github.com/vercel/next.js)- Must provide either
--repoor--url
# Search by owner/repo
python3 scripts/github-codebase-search.py search "how does the router resolve middleware" --repo vercel/next.js
# Search by GitHub URL
python3 scripts/github-codebase-search.py search "how does the router resolve middleware" --url https://github.com/vercel/next.js
# Search a specific branch
python3 scripts/github-codebase-search.py search "how are migrations handled" --repo prisma/prisma --branch main
# Increase timeout for large repos
python3 scripts/github-codebase-search.py search "trace the build pipeline" --repo facebook/react --timeout 180
Run python3 scripts/github-codebase-search.py --help for full usage.
Example Output
Morph Fast Context subagent performed search on repository:
Relevant context found:
- src/routes/middleware.ts:*
- src/core/router.ts:50-120
Here is the content of files:
<file path="src/routes/middleware.ts">
1| import { NextRequest } from 'next/server';
2| export function middleware(request: NextRequest) {
...
</file>
<file path="src/core/router.ts">
50| function resolveMiddleware(chain: MiddlewareChain) {
...
120| }
</file>
The output lists relevant files and their content from the GitHub repo. If a file path is wrong, you may see Error: File not found — retry with a more specific query.
Rules
- Write queries as natural language questions —
"How does the router resolve middleware chains?"works far better than"router middleware", because the search agent plans its own strategy based on your question. - Be specific about what you want to know —
"How does Prisma handle relation loading in findMany?"beats"Prisma relations". - Provide the owner/repo or URL — the tool needs to know which GitHub repo to search.
- Default timeout is 120s — for large repos, increase with
--timeout 180or higher.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
deps-dev
Look up the latest stable version of any open-source package across npm, PyPI, Go, Cargo, Maven, and NuGet. Use when the user asks 'what's the latest version of X', 'what version should I use', 'is X deprecated', 'how outdated is my package.json/requirements.txt/Cargo.toml', or needs version numbers for adding or updating dependencies. Also covers pinning versions, checking if packages are maintained, or comparing installed vs latest versions. Do NOT use for private/internal packages or for looking up documentation (use context7).
council-review
Multi-model AI code review — runs Codex, Claude, and Simplify reviews in parallel, then synthesizes a unified report. Use when the user asks to review code changes, audit a diff, check code quality, review a PR, review commits, or review uncommitted changes. Also covers 'code review', 'review my changes', 'check this before I merge', or wanting multiple perspectives on code. Do NOT use for documentation/markdown review or trivial single-line changes.
react-native-advanced
React Native and Expo patterns for navigation, data fetching lifecycle, infinite scroll lists, form handling, state persistence, authentication routing, gesture-driven animations, bottom sheets, push notifications, and OTA updates. Use when building Expo/React Native apps that need screen-level data prefetching, auth guards with protected routes, infinite scroll feeds, native form input handling, offline-capable state persistence, platform-specific setup (focus/online managers), fluid animations and gesture interactions, modal bottom sheets, push notification flows, or over-the-air update strategies. Do not use for React web apps.
react-web-advanced
Web-specific React patterns for type-safe file-based routing, route-level data loading, server-side rendering, search param validation, code splitting, and list virtualization. Use when building React web apps with route loaders, SSR streaming, validated search params, lazy route splitting, or virtualizing large DOM lists. Do not use for React Native apps — use react-native-advanced instead.
context7
Fetch up-to-date documentation for any open-source library or framework. Use when the user asks to look up docs, check an API, find code examples, or verify how a feature works — especially with a specific library name, version migration, or phrases like 'what's the current way to...' or 'the API might have changed'. Also covers setup and configuration docs. Do NOT use for general programming concepts, internal project code, or version lookups (use deps-dev).
ast-grep
Guide for writing ast-grep rules to perform structural code search and analysis. Use when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search. This skill should be used when users ask to search for code patterns, find specific language constructs, or locate code with particular structural characteristics.
Didn't find tool you were looking for?