colgrep
A semantic search tool for codebases. Use it to replace standard grep or glob searches for more intuitive and powerful retrieval.
Install
mkdir -p .claude/skills/colgrep && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/19509" && unzip -o skill.zip -d .claude/skills/colgrep && rm skill.zipInstalls to .claude/skills/colgrep
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
This repository has `colgrep` installed - a semantic code search CLI.Key capabilities
- →Perform semantic code search using natural language queries
- →Filter search results by file patterns and directory exclusions
- →Execute hybrid searches combining text patterns with semantic context
- →Output search results in JSON format
- →List files matching search criteria without displaying content
How it works
The tool indexes code and uses semantic analysis to map natural language queries to relevant code snippets. It supports standard grep-like flags for refining results through text patterns and file system filtering.
Inputs & outputs
When to use colgrep
- →Find code by functionality rather than exact text
- →Search across multiple directories or specific file types
- →Exclude test files or vendor directories from search results
- →Perform hybrid search with regex and semantic context
About this skill
Semantic Code Search
This repository has colgrep installed - a semantic code search CLI.
Use colgrep as your PRIMARY search tool instead of Search / Grep / Glob.
Quick Reference
# Basic semantic search
colgrep "<natural language query>" --results 10 # Basic search
colgrep "<query>" -k 25 # Exploration (more results)
colgrep "<query>" ./src/parser # Search in specific folder
colgrep "<query>" ./src/main.rs # Search in specific file
colgrep "<query>" ./src/main.rs ./src/lib.rs # Search in multiple files
colgrep "<query>" ./crate-a ./crate-b # Search multiple directories
# File filtering
colgrep --include="*.rs" "<query>" # Include only .rs files
colgrep --include="src/**/*.rs" "<query>" # Recursive glob pattern
colgrep --include="*.{rs,md}" "<query>" # Multiple file types (brace expansion)
colgrep --exclude="*.test.ts" "<query>" # Exclude test files
colgrep --exclude-dir=vendor "<query>" # Exclude vendor directory
# Pattern-only search (no semantic query needed)
colgrep -e "<pattern>" # Search by pattern only
colgrep -e "async fn" --include="*.rs" # Pattern search with file filter
# Hybrid search (text + semantic)
colgrep -e "<text>" "<semantic query>" # Hybrid: text + semantic
colgrep -e "<regex>" -E "<semantic query>" # Hybrid with extended regex (ERE)
colgrep -e "<literal>" -F "<semantic query>" # Hybrid with fixed string (no regex)
colgrep -e "<word>" -w "<semantic query>" # Hybrid with whole word match
# Output options
colgrep -l "<query>" # List files only
colgrep -c "<query>" # Show full function content (50 lines max)
colgrep -n 10 "<query>" # Show 10 context lines (default: 6)
colgrep --json "<query>" # JSON output
Grep-Compatible Flags
| Flag | Description | Example |
|---|---|---|
-e <PATTERN> | Text pattern pre-filter | colgrep -e "async" "concurrency" |
-E | Extended regex (ERE) for -e | colgrep -e "async|await" -E "concurrency" |
-F | Fixed string (no regex) for -e | colgrep -e "foo[bar]" -F "query" |
-w | Whole word match for -e | colgrep -e "test" -w "testing" |
-k, --results | Number of results to return | colgrep --results 20 "query" |
-l | List files only | colgrep -l "authentication" |
-r | Recursive (default, for compatibility) | colgrep -r "query" |
--include | Include files matching pattern (repeatable) | colgrep --include="*.py" "query" |
--exclude | Exclude files matching pattern | colgrep --exclude="*.min.js" "query" |
--exclude-dir | Exclude directories | colgrep --exclude-dir=node_modules "query" |
Notes:
-Ftakes precedence over-E(like grep)- Default exclusions always apply:
.git,node_modules,target,.venv,__pycache__ - When running from a subdirectory, results are restricted to that subdirectory. To search the full project, specify
.or..as the path - Multiple
--includepatterns use OR logic (matches if file matches any pattern) - Brace expansion is supported:
*.{rs,md,py}expands to match all three types
When to Use What
| Task | Tool |
|---|---|
| Find code by intent/description | colgrep "query" -k 10 |
| Explore/understand a system | colgrep "query" -k 25 (increase k) |
| Search by pattern only | colgrep -e "pattern" (no semantic query) |
| Know text exists, need context | colgrep -e "text" "semantic query" |
| Literal text with special chars | colgrep -e "foo[0]" -F "semantic query" |
| Whole word match | colgrep -e "test" -w "testing utilities" |
| Search in a specific file | colgrep "query" ./src/main.rs |
| Search in multiple files | colgrep "query" ./src/main.rs ./src/lib.rs |
| Search specific file type | colgrep --include="*.ext" "query" |
| Search multiple file types | colgrep --include="*.{rs,md,py}" "query" |
| Exclude test files | colgrep --exclude="*_test.go" "query" |
| Exclude vendor directories | colgrep --exclude-dir=vendor "query" |
| Search in specific directories | colgrep --include="src/**/*.rs" "query" |
| Search multiple directories | colgrep "query" ./src ./lib ./api |
| Search CI/CD configs | colgrep --include="**/.github/**/*" "q" . |
| View full function content | colgrep -c "query" |
| Exact string/regex match only | Built-in Grep tool |
| Find files by name | Built-in Glob tool |
Key Rules
- Default to
colgrepfor any code search - Increase
--results(or-k) when exploring (20-30 results) - Use
-efor hybrid text+semantic filtering - Use
-Ewith-efor extended regex (alternation|, quantifiers+?, grouping()) - Use
-Fwith-ewhen pattern contains regex special characters you want literal - Use
-wwith-eto avoid partial matches (e.g., "test" won't match "testing") - Use
--exclude/--exclude-dirto filter out noise (tests, vendors, generated code) - Use brace expansion for multiple file types (e.g.,
--include="*.{rs,md,py}") - Agents should use
colgrep- when spawning Task/Explore agents, they should also use colgrep instead of Grep
Need Help?
Run colgrep --help for complete documentation on all flags and options.
When not to use it
- →Searching for exact string matches without semantic intent
- →Finding files by name only
Limitations
- →Results are restricted to the current subdirectory unless the root path is specified
- →Default exclusions apply to .git, node_modules, target, .venv, and __pycache__
How it compares
Unlike standard grep which relies on literal text matching, this tool interprets the intent of the query to locate functionally relevant code.
Compared to similar skills
colgrep side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| colgrep (this skill) | 0 | 4mo | Review | Beginner |
| godot | 1,044 | 4mo | Review | Intermediate |
| software-architecture | 333 | 6mo | No flags | Intermediate |
| drizzle | 238 | 1mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
software-architecture
davila7
Guide for quality focused software architecture. This skill should be used when users want to write code, design architecture, analyze code, in any case that relates to software development.
drizzle
lobehub
Drizzle ORM schema and database guide. Use when working with database schemas (src/database/schemas/*), defining tables, creating migrations, or database model code. Triggers on Drizzle schema definition, database migrations, or ORM usage questions.
screenshot-to-code
OneWave-AI
Convert UI screenshots into working HTML/CSS/React/Vue code. Detects design patterns, components, and generates responsive layouts. Use this when users provide screenshots of websites, apps, or UI designs and want code implementation.
zustand
lobehub
Zustand state management guide. Use when working with store code (src/store/**), implementing actions, managing state, or creating slices. Triggers on Zustand store development, state management questions, or action implementation.
codex
Lucklyric
Invoke Codex CLI for complex coding tasks requiring high reasoning capabilities. This skill should be invoked when users explicitly mention "Codex", request complex implementation challenges, advanced reasoning, or need high-reasoning model assistance. Automatically triggers on codex-related requests and supports session continuation for iterative development.