MCPInstall

grepai-search-basics

Basic semantic code search with GrepAI. Use this skill to learn fundamental search commands and concepts.

Installs
908
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/yoanbernabeu/grepai-skills --skill grepai-search-basics
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads grepai-search-basics automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

GrepAI Search Basics

This skill covers the fundamentals of semantic code search with GrepAI.

When to Use This Skill

  • Learning GrepAI search
  • Performing basic code searches
  • Understanding semantic vs. text search
  • Interpreting search results

Prerequisites

  1. GrepAI initialized (grepai init)
  2. Index created (grepai watch)
  3. Embedding provider running (Ollama, etc.)

What is Semantic Search?

Unlike traditional text search (grep, ripgrep), GrepAI searches by meaning:

TypeHow it WorksExample
Text searchExact string match"login" → finds "login"
Semantic searchMeaning similarity"authenticate user" → finds login, auth, signin code

Basic Search Command

grepai search "your query here"

Example

grepai search "user authentication flow"

Output:

Score: 0.89 | src/auth/middleware.go:15-45
──────────────────────────────────────────
func AuthMiddleware() gin.HandlerFunc {
    return func(c *gin.Context) {
        token := c.GetHeader("Authorization")
        if token == "" {
            c.AbortWithStatus(401)
            return
        }
        claims, err := ValidateToken(token)
        if err != nil {
            c.AbortWithStatus(401)
            return
        }
        c.Set("user", claims.UserID)
        c.Next()
    }
}

Score: 0.82 | src/auth/jwt.go:23-55
──────────────────────────────────────────
func ValidateToken(tokenString string) (*Claims, error) {
    token, err := jwt.Parse(tokenString, func(t *jwt.Token) (interface{}, error) {
        return []byte(secretKey), nil
    })
    if err != nil {
        return nil, err
    }
    if claims, ok := token.Claims.(*Claims); ok && token.Valid {
        return claims, nil
    }
    return nil, errors.New("invalid token")
}

Score: 0.76 | src/handlers/login.go:10-35
──────────────────────────────────────────
func HandleLogin(c *gin.Context) {
    var req LoginRequest
    if err := c.ShouldBindJSON(&req); err != nil {
        c.JSON(400, gin.H{"error": "invalid request"})
        return
    }
    user, err := userService.Authenticate(req.Email, req.Password)
    // ...
}

Understanding Results

Result Format

Score: 0.89 | src/auth/middleware.go:15-45
──────────────────────────────────────────
[code content]
ComponentMeaning
ScoreSimilarity (0.0 to 1.0, higher = more relevant)
File pathLocation of the code
Line numbersStart-end lines of the chunk
ContentThe actual code

Score Interpretation

ScoreMeaning
0.90+Excellent match
0.80-0.89Good match
0.70-0.79Related
0.60-0.69Loosely related
<0.60Weak match

Limiting Results

By default, GrepAI returns 10 results. Adjust with --limit:

# Get only top 3 results
grepai search "database queries" --limit 3

# Get more results
grepai search "error handling" --limit 20

Checking Index Status

Before searching, verify your index:

grepai status

Output:

✅ GrepAI Status

   Index:
   - Files: 245
   - Chunks: 1,234
   - Last updated: 2 minutes ago

   Ready for search.

Search vs Grep Comparison

Traditional grep

grep -r "authenticate" .
  • Finds exact text "authenticate"
  • Misses synonyms (login, signin, auth)
  • Returns all matches, unranked

GrepAI search

grepai search "authenticate user credentials"
  • Finds semantically similar code
  • Includes related concepts
  • Results ranked by relevance

What Makes a Good Query

Good Queries ✅

Describe the intent or behavior:

grepai search "validate user credentials"
grepai search "handle HTTP request errors"
grepai search "connect to the database"
grepai search "send email notification"
grepai search "parse JSON configuration"

Less Effective Queries ❌

Too short or generic:

grepai search "auth"           # Too vague
grepai search "function"       # Too generic
grepai search "getUserById"    # Exact name (use grep)

Natural Language Queries

GrepAI understands natural language:

# Ask questions
grepai search "how are users authenticated"
grepai search "where is the database connection configured"

# Describe behavior
grepai search "code that sends emails to users"
grepai search "functions that validate input data"

Multiple Words vs Phrases

Both work, but phrases often get better results:

# Multiple words (OR-like behavior)
grepai search "login password validation"

# Phrase (describes specific intent)
grepai search "validate user login credentials"

Quick Tips

  1. Use English: Models are trained on English
  2. Be specific: "JWT token validation" vs "validation"
  3. Describe intent: What the code DOES, not what it's called
  4. Use 3-7 words: Enough context, not too verbose
  5. Iterate: Refine query based on results

Common Search Patterns

Finding Entry Points

grepai search "main entry point"
grepai search "application startup"
grepai search "HTTP server initialization"

Finding Error Handling

grepai search "error handling and logging"
grepai search "exception handling"
grepai search "error response to client"

Finding Data Access

grepai search "database query execution"
grepai search "fetch user from database"
grepai search "save data to storage"

Finding Business Logic

grepai search "calculate order total"
grepai search "process payment transaction"
grepai search "validate business rules"

Troubleshooting

❌ Problem: No results ✅ Solutions:

  • Check index exists: grepai status
  • Run grepai watch if index is empty
  • Simplify query

❌ Problem: Irrelevant results ✅ Solutions:

  • Be more specific
  • Use different words
  • Check if code exists in the codebase

❌ Problem: Missing expected code ✅ Solutions:

  • Check if file is ignored in config
  • Ensure file extension is supported
  • Re-index: rm .grepai/index.gob && grepai watch

Output Format

Successful basic search:

Query: "user authentication flow"
Results: 5 matches

Score: 0.89 | src/auth/middleware.go:15-45
──────────────────────────────────────────
[relevant code...]

Score: 0.82 | src/auth/jwt.go:23-55
──────────────────────────────────────────
[relevant code...]

[additional results...]

Tip: Use --limit to adjust number of results
     Use --json for machine-readable output

FAQ

What does the grepai-search-basics skill do?

Basic semantic code search with GrepAI. Use this skill to learn fundamental search commands and concepts.

How do I install grepai-search-basics?

Run npx skills add https://github.com/yoanbernabeu/grepai-skills --skill grepai-search-basics in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/grepai-search-basics/ (personal) or .claude/skills/grepai-search-basics/ (project).

Which AI agents can use grepai-search-basics?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is grepai-search-basics safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains grepai-search-basics?

It is published by yoanbernabeu in yoanbernabeu/grepai-skills. It has 908 recorded installs.

More from yoanbernabeu/grepai-skills

View all →

grepai-search-advanced

yoanbernabeu/grepai-skills

Advanced search options in GrepAI. Use this skill for JSON output, compact mode, and AI agent integration.

AI & Agents828 installs

grepai-trace-graph

yoanbernabeu/grepai-skills

Build complete call graphs with GrepAI trace. Use this skill for recursive dependency analysis.

805 installs

grepai-ollama-setup

yoanbernabeu/grepai-skills

Install and configure Ollama for local embeddings with GrepAI. Use this skill when setting up private, local embedding generation.

AI & Agents799 installs

grepai-trace-callers

yoanbernabeu/grepai-skills

Find function callers with GrepAI trace. Use this skill to discover what code calls a specific function.

787 installs

grepai-search-tips

yoanbernabeu/grepai-skills

Tips and best practices for effective GrepAI searches. Use this skill to improve search result quality.

grepai-trace-callees

yoanbernabeu/grepai-skills

Find function callees with GrepAI trace. Use this skill to discover what functions a specific function calls.

765 installs

Popular education & science skills

View category →

teach

mattpocock/skills

Teach the user a new skill or concept, within this workspace.

Education & Science874K installs

scaffold-exercises

mattpocock/skills

Create exercise directory structures with sections, problems, solutions, and explainers that pass linting. Use when user wants to scaffold exercises, create exercise stubs, or set up a new course section.

Education & Science488.2K installs

paper-context-resolver

lllllllama/rigorpilot-skills

Rigor Paper Context helper for README-first deep learning repo reproduction. Use only when the README and repository files leave a narrow reproduction-critical gap and the task is to resolve a specific paper detail such as dataset split, preprocessing, evaluation protocol, checkpoint mapping, or runtime assumption from primary paper sources while recording conflicts. Do not use for general paper summary, repo scanning, environment setup, command execution, title-only paper lookup, or replacing README guidance by default.

Education & Science478.3K installs

caveman-learn

juliusbrussee/caveman

Act on a Caveman learn report - review the ranked token sinks, apply cost-lowering fixes with per-edit consent, and report what those fixes returned. Use when asked to lower an agent's token cost, what caveman has saved, to trim a heavy CLAUDE.md, or to offload re-pasted context into cavemem.

Education & Science107.9K installs

gsap-plugins

greensock/gsap-skills

Official GSAP skill for GSAP plugins — registration, ScrollToPlugin, ScrollSmoother, Flip, Draggable, Inertia, Observer, SplitText, ScrambleText, SVG and physics plugins, CustomEase, EasePack, CustomWiggle, CustomBounce, GSDevTools. Use when the user asks about a GSAP plugin, scroll-to, flip animations, draggable, SVG drawing, or plugin registration.

Education & Science67.9K installs

teach-impeccable

pbakaus/impeccable

DEPRECATED: Use /impeccable teach instead. This command has been folded into the impeccable skill.