greplm-search

A code-search agent for exploring a software project. It finds implementations, symbols, definitions, references, and related code across a codebase.

In plain words
What is it for?
Use it to find symbols and implementations, trace references, inspect snippets and outlines, search code structure, review Git history, and prepare focused context for a coding task.
Why use it?
It helps you understand unfamiliar code without reading many whole files or depending on basic text matching. It can also show connections between functions and possible effects of changes.

Agent

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 agents/khaledsmq/greplm/gemini
Clone the repo
git clone --depth 1 https://github.com/KhaledSMQ/greplm
Per session 44 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,013 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. Scan, not verified.
Origin 97% copy Near-identical to another mod 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.00044 $0.01013
Opus 5 $0.00022 $0.00507
Sonnet 5 $0.00009 $0.00203
Haiku 4.5 $0.00004 $0.00101

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

Security

Grade C, and why

greplm-search scanned grade C with 2 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

curl -fsSL https://raw.githubusercontent.com/KhaledSMQ/greplm/main/install.sh | sh

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -fsSL https://raw.githubusercontent.com/KhaledSMQ/greplm/main/install.sh | sh
Origin

This is a copy

97% identical to greplm-search — 5 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

crates/greplm-cli/agents/gemini.md · 66 lines

How it starts

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

Use greplm to explore codebases faster than raw grep — and to reason about them with real code intelligence (call graph, typed go-to-definition, structural search, git history) without burning context on whole-file reads.

greplm index                          # build or refresh the index

# Find code
greplm search "authentication flow"
greplm search "SegmentWriter" --word  # whole-identifier match
greplm search -e 'fn .*candidates' --lang rust --limit 20
greplm search "needle" --exhaustive       # every match: no ranking/limit/per-file cap (grep parity)
greplm symbols extract --exact        # symbol / definition lookup
greplm outline crates/greplm-core/src/trigram.rs
greplm snippet crates/greplm-core/src/trigram.rs 15 25 --context 3

# Code intelligence
greplm pack "how does incremental indexing work" --budget 8000  # task -> ranked, budgeted context
greplm def <file> <line> <col>   # typed go-to-definition (file line col)
greplm callers references            # who calls this symbol
greplm callees merge_segments        # what this symbol calls
greplm impact add_doc --depth 3      # blast radius: what breaks if I change this
greplm xref SegmentWriter            # resolved references (defs + calls + imports)
greplm ast 'fn $NAME() {}' --lang rust   # structural / AST search (or a tree-sitter query)

# Git time-travel
greplm blame <file> <line>
greplm history references            # commits that touched a symbol
greplm changed main                  # files + symbols changed since a revision

greplm summary

Pass -C ./my-project to search another directory. Add --json for machine-readable output.

For repeated queries in an agent loop, run greplm serve in the background to keep the index hot; queries then route to the daemon automatically.

If greplm is not on $PATH, install with:

curl -fsSL https://raw.githubusercontent.com/KhaledSMQ/greplm/main/install.sh | sh

Workflow

  1. Run greplm index before searching a project (incremental by default). indexed 0 files means nothing changed since the last run — not an empty index; confirm the index is populated with greplm status/greplm summary (check files/doc_count) before falling back to grep.
  2. Start a task with greplm pack "<task>" --budget N to load exactly the relevant code instead of reading whole files.
  3. Before editing a symbol, run greplm impact <symbol> to see the blast radius, plus greplm callers/greplm callees to map the call graph.
  4. Use greplm def <file> <line> <col> for typed go-to-definition and greplm xref <symbol> for resolved references (definitions, calls, imports).
  5. Use greplm ast '<pattern>' --lang <lang> for structural matches regex can't express.
  6. Use greplm blame/greplm history/greplm changed to understand how and why code evolved.
  7. For "find every occurrence", use greplm search --exhaustive (no ranking/limit/per-file cap); drop to raw grep only for a quick one-off confirmation of an exact string.

Read the full file on GitHub · 66 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 · 66 lines · 44 tokens per session scan C b9403e376374

Subscribe to this mod's changes

greplm-search is an agent published in the GitHub repository KhaledSMQ/greplm (14 stars, last pushed 22d ago), licensed MIT. It adds 44 tokens to every session and 1,013 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). It is 97% identical to greplm-search, differing in 5 lines, and is treated as a copy.

Related

Other agents, from other repositories

codemap

Defines agent personalities (Orchestrator, Explorer, Librarian, etc.) and manages their configuration lifecycle. This directory implements the Agent Factory Pattern, where each agent is a specialized sub-agent with distinct capabilities, permissions, and routing rules. The Orchestrator agent (src/agents/index.ts)…

alvinunreal/oh-my-opencode-slim · 0 tokens

api-designer

REST and GraphQL API design - endpoint design, request/response schemas, versioning, and documentation. Use for designing new APIs or evolving existing ones.

AgentWorkforce/relay · 35 tokens

shep-web-route-creator

Scaffolds ONE new Next.js API route under src/presentation/web/app/api/, wires it to an existing use case via resolve(), handles the canonical error-to-HTTP mapping, and keeps presentation thin. Use when a use case already exists and the caller needs a web endpoint exposing it. Does NOT create the use case, does NOT…

shep-ai/shep · 85 tokens

python-pro

Python 3.13 language expert for the ClosedLoop plugin monorepo. Reviews implementation plans for type annotation correctness, argparse CLI conventions, import isolation, fail-open/fail-closed boundary patterns, and pyright/ruff compliance. Produces type-patterns.md in legacy mode.

closedloop-ai/claude-plugins · 60 tokens

config-safety-reviewer

Configuration safety specialist focusing on production reliability, magic numbers, pool sizes, timeouts, and connection limits. Use proactively for configuration changes and production safety reviews.

alirezarezvani/claude-code-tresor · 37 tokens

Audit

Deep security + performance audit of a specific diff. Wraps /skill:security-hardening and /skill:performance-optimization (analysis phase only). Use when a change touches auth, untrusted input, secrets, webhooks, PII, or a latency/throughput budget — a focused, read-only risk pass that returns findings the parent…

BlackBeltTechnology/pi-agent-dashboard · 98 tokens