Skip to content
Back to skills

Code Search

ASecurity

Token-efficient codebase exploration using MCP-first approach. Locates functions, classes, patterns, and traces dependencies with 80-90% token savings. Use when searching code, finding implementations, or tracing call chains.

  • 666 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added February 8, 2026
toolspythonapidocumentation

Works with

  • api
  • mcp

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill code-search --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Code Search?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Code Search
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-code-search/badge)](https://www.skillsdirectory.com/skills/majiayu000-code-search)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: code-search
description: Token-efficient codebase exploration using MCP-first approach. Locates functions, classes, patterns, and traces dependencies with 80-90% token savings. Use when searching code, finding implementations, or tracing call chains.
---

# Code Search

Explores codebases efficiently using MCP tools before falling back to file reads.

## When to Use

- Finding functions, classes, or patterns
- Understanding feature implementation
- Tracing dependencies and call chains
- Architecture boundary verification
- Gathering context for documentation

## MCP Workflow

```
# 1. Check past context
claude-mem.search(query="<keyword>", project="<project>")

# 2. Get file overview
serena.get_symbols_overview(relative_path="target/directory")

# 3. Find symbol (signature only first)
serena.find_symbol(name_path="ClassName", depth=1, include_body=False)

# 4. Get body only when needed
serena.find_symbol(name_path="ClassName/method", include_body=True)

# 5. Trace dependencies
serena.find_referencing_symbols(name_path="ClassName/method")

# 6. Framework patterns
context7.get-library-docs("<framework>", topic="<topic>")
```

## Search Patterns

### By Name
```
serena.find_symbol("*Service", include_kinds=[5])      # Classes
serena.find_symbol("UserService/create", include_body=True)  # Method
```

### By Pattern (TOKEN CRITICAL - Always Scope!)

```python
# WRONG - Will return 20k+ tokens:
serena.search_for_pattern("@Cacheable|@cached")

# CORRECT - Scoped and limited:
serena.search_for_pattern(
    substring_pattern="@Cacheable",
    relative_path="module-core-domain/",
    context_lines_after=1,
    max_answer_chars=3000
)
```

### Dependencies
```
serena.find_referencing_symbols("UserService/create")  # Who calls this?
```

### Architecture
```
serena.search_for_pattern("import.*infra", relative_path="src/domain/")
```

### For Documentation
```
# Public APIs (classes, methods)
serena.get_symbols_overview(depth=1)                    # Module structure
serena.find_symbol("*Service", depth=1, include_body=False)  # Signatures

# Find existing docs
serena.find_file(file_mask="*.md", relative_path=".")
serena.find_file(file_mask="README*", relative_path=".")
```

## Output Format

```markdown
## Search: [Target]

| File | Symbol | Line | Type |
|------|--------|------|------|
| path/file | Class.method | 45 | function |

### Key Code
[Relevant snippet - max 20 lines]

### Dependencies
- Calls: [list]
- Called By: [list]
```

## Symbol Kinds

| Kind | Number | Description |
|------|--------|-------------|
| Class | 5 | Class definition |
| Method | 6 | Class method |
| Function | 12 | Standalone function |
| Interface | 11 | Interface |

## Efficiency Rules

**Do:**
- Start with `get_symbols_overview` before reading files
- Use `include_body=False` first
- Limit searches with `relative_path`

**Avoid:**
- Reading entire files before symbol search
- Fetching bodies for signature checks
- Broad searches without scope restriction

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.