/gitlab:search-codefrom gitlab
Searches for code across your GitLab instance using semantic or keyword search. Returns file paths, line numbers, project names, and context.
Ships in gitlab. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
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
What SKILL.md sets; muted values are Claude Code's defaults
7 skills in this plugin
/create-issueCreate a new issue in a GitLab project/create-mrCreate a new merge request in a GitLab project/load-mr-contextLoad MR context for the current branch using GitLab MCP tools/monitor-pipelineMonitor a GitLab pipeline or job until completion, reporting status changes and failures in real-time/review-mrGet comprehensive review of a GitLab merge request/view-pipelineView CI/CD pipeline status for a merge request or projectnpx claudepluginhub thebushidocollective/han --plugin gitlabOther plugins' skills for the same job