Openclaw-skills code-search
Fast codebase search combining glob file matching and ripgrep content search. Find files by pattern, search code by regex, explore project structure. Use when needing to find files, search for patterns in code, understand codebase structure, or explore unfamiliar projects. Triggers on "find files", "search code", "grep for", "where is", "find all uses of", "explore this codebase", "project structure".
install
source · Clone the upstream repo
git clone https://github.com/EasyJoy-Technologies/openclaw-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/EasyJoy-Technologies/openclaw-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/code-search" ~/.claude/skills/easyjoy-technologies-openclaw-skills-code-search && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/EasyJoy-Technologies/openclaw-skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/code-search" ~/.openclaw/skills/easyjoy-technologies-openclaw-skills-code-search && rm -rf "$T"
manifest:
skills/code-search/SKILL.mdsource content
Code Search — Fast Codebase Exploration
Efficient file and content search. Always prefer
rg over raw grep.
File Search
find <dir> -type f -name "*.ts" | head -50 # by extension find <dir> -type f -name "*.ts" -mtime -7 | head -30 # recently modified find <dir> -path "*/services/*.ts" -type f # by path pattern
Content Search (ripgrep)
rg -l "pattern" <dir> # file list only rg -n -C 2 "pattern" <dir> # with context rg -n "pattern" --type ts <dir> # filter by type rg -n "TODO" -g "*.ts" -g "!node_modules" <dir> # glob filter rg -c "pattern" <dir> # count per file rg -n -U "interface\s*\{[^}]*\}" <dir> --type ts # multiline
Project Structure Discovery
find <dir> -maxdepth 2 -type d | sort | head -50find <dir> -maxdepth 2 \( -name "package.json" -o -name "tsconfig.json" -o -name "Makefile" -o -name "*.toml" \) | sortrg -l "main\(|export default|app\." <dir> --type ts --type js | head -20find <dir> -type f | sed 's/.*\.//' | sort | uniq -c | sort -rn | head -15
Common Patterns
| Task | Command |
|---|---|
| Where is X defined? | |
| What calls X? | |
| What changed recently? | / |
| API surface | |
Tips
- Exclude
,node_modules
,.git
,dist
: usebuild-g "!node_modules" - Pipe through
to avoid flooding contexthead -N - Use
for exact strings with special charsrg -F "literal" - Use
first (files only), thenrg -l
for detailrg -n -C 2 - Fallback:
ifgrep -rn --include="*.ts"
unavailablerg