code-research
Code Research
Use github_codebase_search to explore external open-source repositories and understand their implementation details.
When To Use
- The user asks how an open-source library or framework implements something.
- You need to understand an external dependency's internals before integrating with it.
- The user wants to compare how different repos solve a problem.
- You need to find usage examples or patterns in a public GitHub repo.
Steps
- Identify the GitHub repository (e.g.
vercel/next.js,facebook/react). - Break the user's question into multiple focused search angles (e.g. entry points, data flow, config, tests).
- Fire multiple
github_codebase_searchcalls in parallel — one per angle. Do not run them sequentially. - Read and cross-reference the returned files/sections from all queries.
- Summarize findings with concrete file paths and code references.
Parallel Queries
Always decompose the research into 2-4 concurrent searches. For example, to understand how a repo handles authentication:
- Query 1: "Find the authentication middleware and session handling"
- Query 2: "Find the login/signup API routes and handlers"
- Query 3: "Find the auth configuration and token validation"
Run all queries at the same time to minimize latency.
Query Template
"Find how