github-code-search
jaredpalmer/claude-plugins
grep.app을 사용하여 수백만 개의 저장소에 걸쳐 GitHub 코드를 검색해 보세요. 코드 패턴, 구현 방식, 예제를 찾거나 공개 코드베이스에서 기능이 어떻게 구현되었는지 파악해야 할 때 유용합니다. (프로젝트)
...모든 것을 확장하십시오github-code-search 소개
'github-code-search' 스킬을 사용하면 grep.app 서비스를 통해 수백만 개의 공개 GitHub 저장소를 검색할 수 있습니다. 이 스킬은 방대한 오픈소스 코드 풀 내에서 코드 패턴, 구현 방식 및 예제를 찾을 수 있는 강력하고 효율적인 방법을 제공합니다. grep.app MCP 서버를 활용하여, 사용자는 다른 프로젝트에서 특정 기능을 어떻게 구현했는지, 또는 다양한 저장소에서 라이브러리와 API가 어떻게 사용되는지 확인하는 등 구체적인 코드 패턴을 검색할 수 있습니다. 이 스킬은 학습 목적, 기존 구현 분석, 특정 코드 패턴의 예제 수집 등 어떤 용도이든 GitHub 코드를 쉽고 효율적으로 조회할 수 있는 방법을 제공합니다.
이 스킬의 주요 기능으로는 검색, 필터링 및 결과 처리를 위해 로컬에서 TypeScript 코드를 실행할 수 있는 기능이 포함되어 있어, 더 효율적인 검색이 가능하고 토큰 사용량을 줄일 수 있습니다. 내장된 TypeScript 검색 스크립트는 언어 필터링, 결과 제한, 정규식 사용 등 다양한 옵션을 통해 검색을 수행할 수 있는 사용하기 쉬운 명령줄 인터페이스를 제공합니다. 사용자는 사용자 정의 필터링 및 처리를 위해 인라인 TypeScript를 작성하여 맞춤형 검색을 수행할 수도 있습니다. 또한, 이 스킬은 curl과 같은 간단한 도구를 사용하여 빠르게 검색할 수 있는 직접 API를 제공하므로, 고급 사용자와 초보자 모두에게 유연성을 제공합니다.
이 스킬은 개발자, 연구원 및 오픈소스 프로젝트 분석에 관여하는 모든 사람에게 이상적입니다. 코드 구현이나 예제를 찾거나, 코딩 패턴을 분석하거나, 모범 사례를 연구하고자 하는 분들에게 안성맞춤입니다. 특히 재사용 가능한 코드 스니펫을 찾거나, 오픈소스 프로젝트에서 기능이 어떻게 구현되는지 탐구하거나, 공개 저장소 내 라이브러리 및 API 사용에 대한 통찰력을 얻고자 하는 개발자에게 이 스킬은 매우 유용합니다.
자주 묻는 질문
이 스킬을 사용하여 특정 코드 스니펫을 검색하려면 어떻게 해야 하나요?
포함된 TypeScript 검색 스크립트를 사용하여 특정 코드 스니펫을 검색할 수 있습니다. 원하는 검색 쿼리와 언어 또는 저장소와 같은 선택적 필터를 지정하여 스크립트를 실행하세요. 예를 들어, 다음 명령어를 사용하여 TypeScript 파일에서 'use cache'를 검색할 수 있습니다. 'bun run skills/github-code-search/scripts/search.ts "use cache" --lang=TypeScript'.
특정 저장소 내에서 검색할 수 있나요?
예, '--repo' 플래그 뒤에 소유자/저장소 이름을 지정하여 특정 저장소 내에서 검색할 수 있습니다. 예를 들어, 'vercel/next.js' 저장소 내에서 검색하려면 다음 명령어를 사용하세요: 'bun run skills/ github-code-search /scripts/search.ts "cacheLife" --repo=vercel/next.js'.
이 스킬을 사용하기 위한 설정 요건은 무엇인가요?
이 스킬을 사용하려면 grep.app MCP 서버가 구성되어 있어야 합니다. 'claude mcp add --transport http grep https://mcp.grep.app' 명령어를 사용하여 서버를 추가할 수 있습니다. '/mcp'를 실행하여 구성을 확인하면 'grep'이 목록에 표시되어야 합니다.
인라인 TypeScript 옵션은 어떻게 작동하나요?
인라인 TypeScript 옵션을 사용하면 사용자 지정 검색 및 필터링이 가능합니다. grep.app API를 호출하는 TypeScript 코드를 작성한 후, 결과를 로컬에서 처리하여 필요에 따라 데이터를 필터링하거나 변환할 수 있습니다. 이를 통해 여러 쿼리 결과를 결합하거나 리포지토리 이름으로 필터링하는 등 고급 사용 사례에 더 큰 유연성을 제공합니다.
GitHub Code Search via grep.app
Overview
This skill enables searching across millions of public GitHub repositories using the grep.app service. It uses a code mode pattern where you write and execute TypeScript code to query the grep.app MCP server, filter results locally, and return only relevant findings.
When to Use
- Find implementations of specific patterns (e.g., "how do other projects implement OAuth2?")
- Search for usage examples of APIs or libraries
- Analyze architectural patterns across codebases
- Find code snippets matching regex patterns
- Research best practices by examining popular repositories
Setup Requirements
The grep.app MCP server must be configured. Add it with:
claude mcp add --transport http grep https://mcp.grep.app
Verify with /mcp - you should see grep listed.
Code Mode Pattern
Instead of calling MCP tools directly (which loads all tool definitions into context), this skill uses code execution for efficiency:
- Write TypeScript code that calls the grep MCP server
- Execute the code via Bash with
bunornpx tsx - Filter and process results in the execution environment
- Return only relevant findings to minimize token usage
This approach reduces token usage by 90%+ compared to direct tool calls with large result sets.
Implementation
Option 1: Use the bundled search script (recommended)
A ready-to-use TypeScript search script is included:
bun run skills/github-code-search/scripts/search.ts "query" [--lang=Language] [--repo=owner/repo] [--limit=N] [--regexp]
Examples:
# Search for "use cache" in TypeScript filesbun run skills/github-code-search/scripts/search.ts "use cache" --lang=TypeScript --limit=5# Search in a specific repositorybun run skills/github-code-search/scripts/search.ts "cacheLife" --repo=vercel/next.js --limit=10# Use regex patternsbun run skills/github-code-search/scripts/search.ts "async.*await" --regexp --lang=TypeScript
Output format (JSON):
{ "query": "cacheLife", "options": { "language": "TypeScript", "limit": 3 }, "total": 2931, "results": [ { "repo": "vercel/next.js", "path": "packages/next/src/server/use-cache/cache-life.ts", "url": "https://github.com/vercel/next.js/blob/canary/packages/next/src/server/use-cache/cache-life.ts", "matches": [{ "lineNumber": 5, "content": "export type »CacheLife« = {" }] } ]}The » and « markers indicate where the search term was matched.
Option 2: Inline TypeScript (for custom processing)
For more complex searches with custom filtering, write inline TypeScript:
// Execute with: bun -e "..."const response = await fetch( 'https://grep.app/api/search?q=useOptimistic&l=TypeScript')const data = await response.json()// Process results locally - this is the efficiency gain!const filtered = data.hits.hits .filter((hit: any) => hit.repo.includes('react')) .slice(0, 5) .map((hit: any) => ({ repo: hit.repo, path: hit.path }))console.log(JSON.stringify(filtered, null, 2))
Quick Search (Direct API)
For simple searches, use curl directly:
curl -s "https://grep.app/api/search?q=useOptimistic+hook&l=TypeScript" | jq '.hits.hits[:5] | .[] | {repo: .repo.raw, path: .path.raw}'
Parameters
| Parameter | Description | Example |
|---|---|---|
q | Search query (required). Supports regex with regexp:true | "use cache", async.*await |
l | Language filter | TypeScript, Python, Go |
r | Repository filter | vercel/next.js, facebook/react |
regexp | Enable regex mode | true |
Example Queries
Find "use cache" implementations in Next.js projects
curl -s "https://grep.app/api/search?q=%22use%20cache%22&l=TypeScript" | jq '.hits.hits[:10] | .[] | {repo: .repo.raw, path: .path.raw}'
Search for error handling patterns
curl -s "https://grep.app/api/search?q=catch.*error.*log®exp=true&l=TypeScript" | jq '.hits.total'
Find implementations in a specific repo
curl -s "https://grep.app/api/search?q=cacheLife&r=vercel/next.js" | jq '.hits.hits[] | {path: .path.raw, lines: .content.lines}'
Best Practices
- Start broad, then narrow: Begin with a general query, then add language/repo filters
- Use regex for patterns: Enable
regexp=truefor complex pattern matching - Limit results locally: Process and filter in code before returning to save tokens
- Cache common searches: Store results for frequently-used queries
- Respect rate limits: The grep.app API has rate limits; batch queries when possible
Integration with MCP Tools
If the grep MCP server is configured, you can also use it via MCP tools:
// Via MCP (if mcp__grep__search is available)mcp__grep__search({ query: 'authentication middleware', language: 'TypeScript', useRegexp: false,})
However, the code mode approach (curl + jq or TypeScript script) is preferred for:
- Large result sets that need filtering
- Complex post-processing logic
- Chaining multiple searches
- Minimizing context window usage
Troubleshooting
- No results: Try broadening the query or removing filters
- Rate limited: Wait a few seconds and retry, or use the MCP server which may have higher limits
- Timeout: Large queries may timeout; add more specific filters
github-code-search 설치
스킬 파일을 다운로드하여 .claude/skills/ 디렉터리에 압축을 풀어주세요.
ZIP 다운로드저장소를 클론하고 스킬 파일을 프로젝트에 복사하세요.
git clone https://github.com/jaredpalmer/claude-plugins/blob/main/skills/github-code-search/SKILL.md # Copy SKILL.md to your .claude/skills/ directory
복사





집
