From github
Searches GitHub repositories for code via /search-code using queries and advanced syntax. Returns snippets with repo, file path, line numbers, and context.
npx claudepluginhub thebushidocollective/han --plugin githubThis skill uses the workspace's default tool permissions.
github:search-code - Search for code across GitHub repositories
Searches code across GitLab projects using semantic (Duo-enabled) or keyword search. Returns snippets with file paths, line numbers, context, project links, and relevance scores.
Searches GitHub for code examples, libraries, and implementation patterns. Useful standalone or in research sessions for finding existing solutions.
Enhances codebase searches via semantic query parsing, regex patterns, AST analysis, symbol lookups, and optimized grep/ripgrep with relevance ranking and context.
Share bugs, ideas, or general feedback.
github:search-code - Search for code across GitHub repositories
/search-code [arguments]
Search for code across GitHub repositories
Search for code, files, or implementations across GitHub repositories.
/search-code [query]
This command helps you find relevant code across repositories.
search_codeUser: /search-code JWT token validation
Claude: Searching for "JWT token validation"...
Found 4 relevant code snippets:
### 1. my-org/auth-service - src/middleware/validateToken.ts
```typescript
export function validateJWT(token: string): UserPayload {
try {
const decoded = jwt.verify(token, process.env.JWT_SECRET);
return decoded as UserPayload;
} catch (error) {
throw new UnauthorizedError('Invalid token');
}
}
async function verifyToken(req: Request): Promise<boolean> {
const token = req.headers.authorization?.split(' ')[1];
if (!token) return false;
return await jwt.verify(token, publicKey, { algorithms: ['RS256'] });
}
Would you like to see more results or explore any of these files?
## Search Syntax
GitHub code search supports advanced syntax:
- **Exact phrase**: `"function authenticate"`
- **File type**: `language:typescript`
- **Path filter**: `path:src/auth`
- **Repository**: `repo:owner/repo-name`
- **Organization**: `org:my-org`
- **Extension**: `extension:ts`
### Examples
authenticate language:typescript
validate path:src/middleware
JWT repo:my-org/auth-service
async function org:my-org language:javascript
## Tips
- Use specific keywords for better results
- Filter by language to reduce noise
- Search across an organization with `org:`
- Combine with path filters to narrow scope
- Use quotes for exact phrases
- Review multiple implementations for patterns
## Related Commands
- `/review-pr`: Review PRs that modify found code
- `/create-issue`: File issues for problems found
- `/create-pr`: Create PR to fix or improve code