From gitlab
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.
npx claudepluginhub thebushidocollective/han --plugin gitlabThis skill uses the workspace's default tool permissions.
gitlab:search-code - Search for code across your GitLab instance
Searches GitHub repositories for code via /search-code using queries and advanced syntax. Returns snippets with repo, file path, line numbers, and context.
Explores internal code implementations, patterns, and architecture across organization repositories using Glean code search tools.
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.
gitlab:search-code - Search for code across your GitLab instance
/search-code [arguments]
Search for code across your GitLab instance
Search for code, files, or implementations across your GitLab instance using semantic or keyword search.
/search-code [query]
This command helps you find relevant code across all accessible projects.
User: /search-code How is JWT token validation implemented?
Claude: Searching for JWT token validation implementations...
Found 4 relevant code snippets:
### 1. auth-service/src/middleware/validateToken.ts (Relevance: 95%)
```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'] });
}
const validateAuthToken = (token: string) => {
const payload = jwt.decode(token, { complete: true });
return payload?.exp && payload.exp > Date.now() / 1000;
};
Would you like to see more results or explore any of these implementations?
### Keyword Search
User: /search-code authentication middleware
Claude: Searching for "authentication middleware"...
Found 7 results across 4 projects:
export const authenticationMiddleware = async// Authentication middleware for protected routesclass AuthenticationMiddleware {// Main authentication checkconst authMiddleware = (req, res, next) => {Would you like to see the full context for any of these files?
## Arguments
- `query` (required): Natural language description or search keywords
- For semantic search: "How do we handle user permissions?"
- For keyword search: "redis cache implementation"
## Search Types
### Semantic Search (GitLab.com only)
Best for:
- Understanding how something works
- Finding implementations by concept
- Discovering related code
- Architectural questions
Examples:
- "How are database migrations handled?"
- "Where do we validate API requests?"
- "Show me error handling patterns"
### Keyword Search (All instances)
Best for:
- Finding specific function or class names
- Locating files by name
- Searching for exact text matches
- Finding configuration values
Examples:
- "validateUserInput function"
- "config.yml database"
- "TODO: fix memory leak"
## Tips
- Use natural language for semantic search
- Be specific with your queries
- Combine with other commands for deeper analysis
- Use quotes for exact phrase matching in keyword search
- Refine your query if results aren't relevant
- Check multiple projects for consistency
- Consider privacy when searching across all projects
## Advanced Usage
### Search with Scope
User: /search-code Find all test files that test authentication, scope:tests
Claude: Searching test files for authentication tests...
### Search in Specific Project
User: /search-code Redis caching implementation in project auth-service
Claude: Limiting search to auth-service project...
### Search by File Type
User: /search-code Database connection configuration in YAML files
Claude: Searching YAML files for database configuration...
## Related Commands
- `/view-issue`: View related issues after finding code
- `/create-issue`: Create issue for bugs found during search
- `/review-mr`: Review implementations found in search results