Semantic code search using Phase 1 vector embeddings and Phase 2 hybrid search.
Semantic code search using Phase 1 vector embeddings and Phase 2 hybrid search (semantic + structural). Find code by meaning, not just keywords.
Core principle: Search code by what it does, not what it's called.
This skill now supports three search modes:
Hybrid (Default):
Semantic-Only:
Structural-Only:
| Mode | Speed | Accuracy | Best For | | --------------- | ------ | -------- | ----------------- | | Hybrid | <150ms | 95% | General search | | Semantic-only | <50ms | 85% | Concepts | | Structural-only | <50ms | 100% | Exact patterns | | Phase 1 only | <50ms | 80% | Legacy (fallback) |
Always:
Don't Use:
// Basic hybrid search
Skill({ skill: 'code-semantic-search', args: 'find authentication logic' });
// With options
Skill({
skill: 'code-semantic-search',
args: 'database queries',
options: {
mode: 'hybrid',
language: 'javascript',
limit: 10,
},
});
// Fast conceptual search
Skill({
skill: 'code-semantic-search',
args: 'find authentication',
options: { mode: 'semantic-only' },
});
// Exact pattern matching
Skill({
skill: 'code-semantic-search',
args: 'find function authenticate',
options: { mode: 'structural-only' },
});
Hybrid Search: .claude/lib/code-indexing/hybrid-search.cjs
Query Analysis: .claude/lib/code-indexing/query-analyzer.cjs
Result Ranking: .claude/lib/code-indexing/result-ranker.cjs
| Anti-Pattern | Why It Fails | Correct Approach | | ----------------------------------------------------- | -------------------------------------------------- | --------------------------------------------------------------------------- | | Semantic search for exact string matching | Slower and less accurate than text search | Use ripgrep/Grep for exact keyword matching | | Single-word queries ("auth") | Too vague for semantic matching; returns noise | Use natural-language descriptions ("authentication token validation logic") | | Using semantic-only mode for general searches | Misses structural variants; 85% vs 95% accuracy | Use hybrid mode (default) for general queries | | Ignoring search results that don't match expectations | Semantic results find surprising-but-relevant code | Read all results; unexpected matches are often the most valuable | | Not combining with structural search | Finds concepts but not exact patterns | Use semantic for discovery → structural for precision |
Before starting:
Read .claude/context/memory/learnings.md
After completing:
.claude/context/memory/learnings.md.claude/context/memory/issues.md.claude/context/memory/decisions.mdASSUME INTERRUPTION: If it's not in memory, it didn't happen.
npx skills add oimiragieo/code-semantic-search下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer