- One Tip a Week
- Posts
- One Tip a Week: GitHub Code Search
One Tip a Week: GitHub Code Search
This week’s tip of the week is GitHub’s Code Search. It was in beta or alpha last year, but it’s now available to everyone. Anytime I’ve shown this to most people, they’re unaware of this awesomeness.
GitHub Code Search is not just for finding repos or issues. It’s ridiculously powerful for digging into code across millions of public repos (and your own private ones).
You can search for exact strings, regex patterns, and even filter by language, path, or symbol. For example:

GitHub Code Search providing search results for lang:TypeScript path:utils/ "<T extends"
It’s also great for API spelunking too. Search for fetch(
across projects to see how others are using it, or hunt for common patterns and anti-patterns.
Try it here: GitHub Code Search
Full syntax guide: GitHub Search Cheatsheet
Bonus: If you're using AI coding assistants with Model Context Protocol (MCP) support (like Claude, Cursor, or VS Code), the GitHub MCP server includes this same code search functionality via the repository tool search_code
tool with these options:
order
: Sort order for results (string, optional)page
: Page number for pagination (min 1) (number, optional)perPage
: Results per page for pagination (min 1, max 100) (number, optional)query
: Search query using GitHub's powerful code search syntax. Examples:content:Skill language:Java org:github
,NOT is:archived language:Python OR language:go
,repo:github/github-mcp-server
. Supports exact matching, language filters, path filters, and more. (string, required)sort
: Sort field ('indexed' only) (string, optional)
That’s it! Short and sweet. Until the next one!