repogrep

A set of Cursor rules for using repogrep, a local tool that searches indexed external code repositories by keywords or meaning. It can also use code symbols such as function and class definitions.

In plain words
What is it for?
Use it to list indexed repositories, search their code, find definitions and examples, or read files from those repositories.
Why use it?
It explains when to use repogrep for repositories outside the current workspace and keeps searches of the active project on other tools.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/fernandoabolafio/repobase/repogrep
Clone the repo
git clone --depth 1 https://github.com/fernandoabolafio/repobase

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,879 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01879
Opus 5 $0.00000 $0.00940
Sonnet 5 $0.00000 $0.00376
Haiku 4.5 $0.00000 $0.00188

Measured 2d ago against content hash 1675c9cf7964, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

repogrep scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/repogrep.mdc · 244 lines

How it starts

The opening of the file, as written. The whole thing — 244 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cursor Rule: repogrep CLI Integration

Overview

repogrep is a local code search tool that indexes repositories and provides both full-text (keyword) and semantic search capabilities. Use it to search across external codebases that have been indexed locally.

When to Use repogrep

Use repogrep when you need to:

  • Search code in repositories that are NOT in the current workspace
  • Find examples of patterns across multiple indexed codebases
  • Explore external libraries or frameworks that have been indexed
  • Read files from indexed repositories without opening them
  • Perform semantic searches across large codebases

Do NOT use repogrep for:

  • Searching the current workspace (use codebase_search or grep tools instead)
  • Files in the active project directory

Available Commands

1. repogrep list

List all indexed repositories to see what's available for searching.

repogrep list

Use this first to understand which repositories you can search.

2. repogrep search - Semantic & Keyword Search

The primary search command with three modes:

Keyword search (default): Fast full-text search using SQLite FTS

repogrep search "authentication middleware"
repogrep search "user login" --repo Effect-TS-effect

Semantic search: AI-powered meaning-based search

repogrep search "how to handle errors" --semantic
repogrep search "async state management" --semantic --limit 10

Hybrid search: Combines both approaches

repogrep search "database connection pooling" --hybrid

Options:

  • -r, --repo <name> - Filter to specific repository
  • --semantic - Use semantic/vector search
  • --hybrid - Combine keyword + semantic search
  • -l, --limit <number> - Max results (default: 20)

3. repogrep grep - Pattern Search

Search for regex patterns in file contents (like ripgrep).

# Find all function declarations
repogrep grep "function \w+\(" --type ts

# Case-insensitive search with context
repogrep grep "todo" -i -C 3 --repo myproject

# Count matches per file
repogrep grep "console\.log" --type js -c

# Just show filenames
repogrep grep "deprecated" -l

Read the full file on GitHub · 244 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 244 lines · 0 tokens per session scan A 1675c9cf7964

Subscribe to this mod's changes

repogrep is a cursor rule published in the GitHub repository fernandoabolafio/repobase (16 stars, last pushed 7mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,879 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.