Agent skill
vectorcode
Semantic code search using RAG and vector embeddings. Use when you need to find code by concept/functionality rather than exact text match, discover implementation examples, or understand where specific concepts are used across projects.
Install this agent skill to your Project
npx add-skill https://github.com/yurifrl/cly/tree/main/.opencode/skill/vectorcode
SKILL.md
VectorCode - Semantic Code Search
VectorCode provides semantic code search using RAG (Retrieval-Augmented Generation) and vector embeddings. It indexes code files into ChromaDB and enables finding relevant code by meaning rather than exact text matching.
When to Use This Skill
- Finding code with similar functionality but different naming conventions
- Discovering implementation examples across large codebases
- Understanding where specific concepts/patterns are used
- Retrieving contextual code for AI-assisted development
- Searching when you don't know exact variable/function names
Available MCP Tools
List Projects
mcp__vectorcode__ls - Get list of indexed projects (no parameters)
Semantic Search
mcp__vectorcode__query - Search for code by concept
query_messages: Array of keywords (separate phrases, include related terms)n_query: Number of files to retrieve (increase if context insufficient)project_root: Project path (get fromlsfirst)
Index Files
mcp__vectorcode__vectorise - Add files to index
paths: Array of file paths (accurate, case-sensitive)project_root: Project identifier
Manage Index
mcp__vectorcode__files_ls - List indexed files in project
mcp__vectorcode__files_rm - Remove files from index
Query Best Practices
- Always run
lsfirst to get validproject_rootvalues - Break queries into keywords - "auth login password" not "authentication login with password"
- Include related terms - For "function" add: "return value", "parameter", "arguments"
- Add imported names - If searching for imported class/function, include its name
- Try orthogonal keywords on retry - If first query fails, use different but related terms
- Don't repeat exact keywords - Avoid using same query terms from previous attempts
- Increase file count - If results lack context, increase
n_queryparameter - Don't escape special characters - Use raw strings
CLI Commands
Initialize project:
cd /path/to/project
vectorcode init # Setup project
vectorcode vectorise src/ # Index source directory
Update after changes:
vectorcode update # Re-index changed files
Search manually:
vectorcode query "authentication logic" -n 10
Configuration
Location: home/.config/vectorcode/config.json5
{
"db_url": "http://127.0.0.1:8000" // ChromaDB server URL
}
MCP Setup (in home/.claude/settings.json):
"vectorcode": {
"command": "vectorcode-mcp-server"
}
Result Handling
- Provide references - Include file paths and line ranges when answering
- Don't paste full source - Reference code locations, not entire files
- Paths are relative - All paths relative to project root
- No external edits - Don't suggest edits outside working directory
Workflow Example
1. Run mcp__vectorcode__ls → get project list
2. Run mcp__vectorcode__query with:
- query_messages: ["authentication", "user", "login", "password", "validation"]
- n_query: 10
- project_root: "/Users/yuri/Workdir/WIP/myapp"
3. Analyze returned files and line ranges
4. Provide answer with file references: "Authentication is handled in src/auth/login.py:45-78"
Limitations
- Requires ChromaDB server running at configured URL
- Retrieval may not be accurate for single file requests (retrieve multiple)
- Results depend on quality of embeddings and chunking
- Best for semantic search, not exact pattern matching (use grep for that)
Troubleshooting
No results: Check project indexed (files_ls), try broader keywords, increase n_query
Files not updating: Run vectorcode update or re-vectorize specific files
Project not found: Run ls to verify project_root value, check if initialized
Key Difference from grep/ripgrep
- VectorCode: Finds conceptually similar code (semantic understanding)
- grep: Finds exact text patterns (literal matching)
Use VectorCode when you know WHAT you're looking for but not WHERE or HOW it's named.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
ag:changelog
Generates and updates project CHANGELOG.md from git commits, conversation decisions, and architectural changes. Auto-invoke this skill when new features are added, features are removed, or architecture changes occur.
prompt-engineering
Prompt engineering reference and workflow for creating, refining, and reviewing high-quality prompts for AI tools, agents, and skills.
ag:claudemd-update
Updates CLAUDE.md based on recent conversation history. This skill should be used when the user asks to update their CLAUDE.md, sync learnings from conversations, or review what was discussed recently.
write-skill
Create Claude Code skills with proper structure and documentation. Use when building custom skills, writing SKILL.md files, or when user asks "write a skill" or "create Claude skill".
add-module
Create new demo or utility modules following CLY project patterns. Use when adding TUI demonstration modules to modules/demo/ or utility modules to modules/, following Bubbletea/Bubbles conventions with proper Cobra CLI integration.
git-worktrees
Manage git worktrees for parallel development. Use when user mentions worktrees, parallel branches, or working on multiple branches simultaneously.
Didn't find tool you were looking for?