π¦ ClawHub
Smart Code Search
by @brettmhammond
Search code and docs by meaning, not keywords. Powered by ColGREP/NextPlaid,
π‘ Examples
1. Index Your Project
cd /path/to/project
colgrep init
That's it. ColGREP parses every file with Tree-sitter, builds multi-vector embeddings on CPU, and stores the index in .colgrep/. Takes 30β60 seconds for ~1000 files. After this, the index auto-updates on every search β changed files are detected and re-indexed automatically.
2. Search
colgrep "natural language description of what you want"
Results are ranked by semantic relevance score. Higher = better match.
Examples:
colgrep "authentication middleware token validation"
colgrep "database migration rollback strategy"
colgrep "React form validation with error display"
colgrep "webhook retry logic with exponential backoff"
3. Combine Regex + Semantics
Filter files by regex pattern first, then rank semantically:
colgrep -e "async.*await" "error handling patterns"
colgrep -e "def test_" "payment capture edge cases"
colgrep -e "\.tsx$" "patient dashboard layout"
π Tips & Best Practices
"Index is being updated by another process" β Another colgrep instance is updating. Current search uses existing index. Safe to ignore.
Re-index from scratch:
rm -rf .colgrep/ && colgrep init
Add to .gitignore:
.colgrep/
TERMINAL
clawhub install smart-code-search