grepai
AGENTS.md1.9k starsChanged 10 months agoMITView on GitHub
CLAUDE.md only imports this file. grepai is a semantic code search CLI tool that indexes code using vector embeddings for natural language queries. Interfaces define extensible backends: - embedder.Embedder (embedder/embedder.go) - Text-to-vector embedding providers - store.VectorStore (store/store.go) - Vector storage with similarity search Current implementations: - Embedders: Ollama (local), OpenAI (cloud) - Stores: GOB (file-based), PostgreSQL with pgvector Configuration stored in .grepai/config.yaml. Key options: - embedder.provider: "ollama" or "openai" - store.backend: "gob" or "postgres" - chunking.size/chunking.overlap: Token-based chunking parameters New…
- Commits and pushes
We split this AGENTS.md into the rules it gives an agent
13 rules. About 0 are common, 7 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 71
Follow conventional commits: type(scope): description
- Distinctive: line 77
When working on a GitHub issue, ALWAYS follow this workflow:
- Distinctive: line 98
No merge conflicts with main
- Distinctive: line 100
IMPORTANT: Never push directly to main.
- Distinctive: line 106
Always test backward compatibility: Before opening a PR, verify that:
- Distinctive: line 110
Add a regression test whenever possible (e.g.
- Very specific: line 124
Use grepai search INSTEAD OF Grep/Glob/find for:
- Distinctive: line 132
Only use Grep/Glob when you need:
- Very specific: line 138
If grepai fails (not running, index unavailable, or errors), fall back to standard Grep/Glob tools.
- Very specific: line 162
Use grepai trace to understand function relationships:
- Very specific: line 184
Start with grepai search to find relevant code
- Very specific: line 186
Use Read tool to examine files from results
- Distinctive: line 187
Only use Grep for exact string searches if needed
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
This file provides guidance to AI coding agents (Claude Code, Codex, Cursor, etc.) when working with code in this repository. CLAUDE.md only imports this file.
Build and Development Commands
# Build the binary
make build
# Run tests with race detection
make test
# Run tests with coverage report
make test-cover
# Lint with golangci-lint
make lint
# Build and run
make run
# Cross-compile for all platforms
make build-allArchitecture Overview
grepai is a semantic code search CLI tool that indexes code using vector embeddings for natural language queries.
Core Components
Interfaces define extensible backends:
embedder.Embedder(embedder/embedder.go) - Text-to-vector embedding providersstore.VectorStore(store/store.go) - Vector storage with similarity search
Current implementations:
- Embedders: Ollama (local), OpenAI (cloud)
- Stores: GOB (file-based), PostgreSQL with pgvector
Data Flow
- Scanner (
indexer/scanner.go) - Walks filesystem respecting gitignore patterns - Chunker (
indexer/chunker.go) - Splits files into overlapping chunks with context - Indexer (
indexer/indexer.go) - Orchestrates scanning, chunking, embedding, and storage - Watcher (
watcher/watcher.go) - Monitors filesystem for real-time incremental updates - Searcher (
search/search.go) - Embeds query and performs similarity search
CLI Commands (cli/)
init- Creates.grepai/config.yamlwith default configurationwatch- Starts daemon: full index + real-time file watchersearch- Queries the index with natural languageagent-setup- Configures Cursor/Claude Code integration
Configuration
Configuration stored in .grepai/config.yaml. Key options:
embedder.provider: "ollama" or "openai"store.backend: "gob" or "postgres"chunking.size/chunking.overlap: Token-based chunking parameters
Adding New Backends
New embedder: Implement Embedder interface in embedder/, add config in config/config.go, wire in CLI commands.
New store: Implement VectorStore interface in store/, add config, wire in CLI.
Commit Convention
Follow conventional commits: type(scope): description
Types: feat, fix, docs, style, refactor, test, chore
Issue Workflow
When working on a GitHub issue, ALWAYS follow this workflow:
- Create a feature branch from
main:git checkout main git pull origin main git checkout -b <type>/<issue-number>-<short-description> # Example: feat/42-add-new-embedder - Implement the changes and commit following the commit convention
- Push the branch and create a Pull Request:
git push -u origin <branch-name> gh pr create --title "<type>(scope): description" --body "Closes #<issue-number>" - Before merging, ensure:
- CI pipeline passes (all checks green)
- Code has been reviewed if required
- No merge conflicts with
main
IMPORTANT: Never push directly to main. Always use branches and PRs.
V1 Stability Rules
grepai is now 1.x: users rely on existing configs, indexes and CLI/MCP outputs. Every change MUST follow these rules:
- Always test backward compatibility. Before opening a PR, verify that:
- an existing
.grepai/config.yaml(without any newly added keys) still loads and behaves as before, with defaults matching the previous behavior; - an index built by the previous release (gob, Postgres, Qdrant, symbols, RPG) is still readable, or is migrated/rebuilt transparently;
- CLI flags, JSON output fields and MCP tool parameters/results are not removed or renamed (additions only). Add a regression test whenever possible (e.g. load a config or index fixture produced by the previous version).
- an existing
- Always test locally on a real, representative project, not only with unit tests:
- build the binary (
make build) and run./bin/grepai(index, watch, search, trace, MCP…) on an actual project; - pick a project whose language matches the feature under work (e.g. PHP project for PHP trace scoping, SvelteKit project for
.svelteextraction, Go project for Go-specific chunking); the grepai repository itself is fine for Go and generic features; - for backend-specific changes, test against that backend (e.g. a local Postgres/pgvector or Qdrant instance).
- build the binary (
- Report both in the PR "Test Plan": the backward-compatibility checks performed and the real project used (language, size, commands run, observed results).
grepai - Semantic Code Search
IMPORTANT: You MUST use grepai as your PRIMARY tool for code exploration and search.
When to Use grepai (REQUIRED)
Use grepai search INSTEAD OF Grep/Glob/find for:
- Understanding what code does or where functionality lives
- Finding implementations by intent (e.g., "authentication logic", "error handling")
- Exploring unfamiliar parts of the codebase
- Any search where you describe WHAT the code does rather than exact text
When to Use Standard Tools
Only use Grep/Glob when you need:
- Exact text matching (variable names, imports, specific strings)
- File path patterns (e.g.,
**/*.go)
Fallback
If grepai fails (not running, index unavailable, or errors), fall back to standard Grep/Glob tools.
Usage
# ALWAYS use English queries for best results (embedding model is English-trained)
grepai search "user authentication flow"
grepai search "error handling middleware"
grepai search "database connection pool"
grepai search "API request validation"
# JSON output for AI agents (--compact saves ~80% tokens by omitting content)
grepai search "authentication flow" --json --compactQuery Tips
- Use English for queries (better semantic matching)
- Describe intent, not implementation: "handles user login" not "func Login"
- Be specific: "JWT token validation" better than "token"
- Results include: file path, line numbers, relevance score, code preview
Call Graph Tracing
Use grepai trace to understand function relationships:
- Finding all callers of a function before modifying it
- Understanding what functions are called by a given function
- Visualizing the complete call graph around a symbol
Trace Commands
IMPORTANT: Always use --json flag for optimal AI agent integration.
# Find all functions that call a symbol
grepai trace callers "HandleRequest" --json
# Find all functions called by a symbol
grepai trace callees "ProcessOrder" --json
# Build complete call graph (callers + callees)
grepai trace graph "ValidateToken" --depth 3 --jsonWorkflow
- Start with
grepai searchto find relevant code - Use
grepai traceto understand function relationships - Use
Readtool to examine files from results - Only use Grep for exact string searches if needed
Trending
More talk lately.about the whole repository
Who's talking about yoanbernabeu/grepai
- @yoandev.co“On vise les 300 ⭐️ sur GitHub ! Si GrepAI atteint ce cap mercredi prochain, je m'engage à lancer le projet …”Bluesky · Jan 21, 2026 · 6 likes
- jeremyakers/grepai“Review runtime aggregate with Ollama batching”GitHub · Sep 15, 2026 · 1 reactions
- jeremyakers/grepai“Review Ollama batch embedding requests”GitHub · Sep 13, 2026 · 1 reactions
- jeremyakers/grepai“Refresh PostgreSQL symbol storage on current upstream main”GitHub · Sep 10, 2026 · 1 reactions
- jeremyakers/grepai“Refresh live-folder cleanup on current upstream main”GitHub · Sep 10, 2026 · 1 reactions
The biggest 5 of 27 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 27
Talked about on GitHub and Bluesky (27 times).
On GitHub · 25
- Sep 15, 2026Review runtime aggregate with Ollama batching — jeremyakers/grepai1 reaction · 1 comment
- Sep 13, 2026Review Ollama batch embedding requests — jeremyakers/grepai1 reaction · 1 comment
- Sep 10, 2026Refresh PostgreSQL symbol storage on current upstream main — jeremyakers/grepai1 reaction · 1 comment
- Sep 10, 2026Refresh live-folder cleanup on current upstream main — jeremyakers/grepai1 reaction · 1 comment
- Sep 10, 2026fix(indexer): stop re-embedding unchanged linked files on startup — jeremyakers/grepai1 reaction · 1 comment
20 more on GitHub
- Sep 10, 2026fix(indexer): reuse unchanged files reached through linked folders — jeremyakers/grepai1 reaction · 1 comment
- Oct 30, 2026agent-skills.github.yoanbernabeu.grepai: 1.1.0 → 1.2.0 — sudosubin/agents.nix0 reactions
- Oct 26, 2026agent-skills.github.yoanbernabeu.grepai: 1.0.0 → 1.1.0 — sudosubin/agents.nix0 reactions
- Oct 25, 2026agent-skills.github.yoanbernabeu.grepai: 0.39.0 → 1.0.0 — sudosubin/agents.nix0 reactions
- Oct 25, 2026agent-skills.github.yoanbernabeu.grepai: 0.38.0 → 0.39.0 — sudosubin/agents.nix0 reactions
- Oct 24, 2026agent-skills.github.yoanbernabeu.grepai: 0.37.0 → 0.38.0 — sudosubin/agents.nix0 reactions
- Oct 3, 2026agent-skills.github.yoanbernabeu.grepai: init at 0.37.0 — sudosubin/agents.nix0 reactions
- Sep 10, 2026Refresh startup optimization on current upstream main — jeremyakers/grepai0 reactions · 1 comment
- Aug 24, 2026Security triage review: 2026-08-24 (part 5/8) — flatcar/security-triage0 reactions · 1 comment
- Aug 20, 2026Security triage review: 2026-08-20 (part 18/22) — flatcar/security-triage0 reactions · 1 comment
- Aug 19, 2026Security triage review: 2026-08-19 (part 18/22) — flatcar/security-triage0 reactions
- Jul 28, 2026x/vulndb: potential Go vuln in github.com/yoanbernabeu/grepai: GHSA-q76h-p6jh-9rw3 — golang/vulndb0 reactions · 1 comment
- Jul 28, 2026x/vulndb: potential Go vuln in github.com/yoanbernabeu/grepai: GHSA-6h35-9p2w-3j3r — golang/vulndb0 reactions · 1 comment
- Apr 29, 2026benchmarks: Add grepai and probe to benchmarks — MinishLab/semblesays it tested it0 reactions · 1 comment
- Mar 11, 2026Similarity with https://github.com/yoanbernabeu/grepai — samuelfaj/distill0 reactions · 1 comment
- Feb 7, 2026intergrate — Furver-io/bri-db0 reactions
- Jan 25, 2026chore(deps): update dependency yoanbernabeu/grepai to v0.23.1 — M0Rf30/PKGBUILD0 reactions
- Jan 23, 2026Enhancement: grepai統合によるトークン最適化とセマンティック検索 — clearclown/claude-code-aida0 reactions
- Jan 22, 2026Add automated setup script for grepai and beads — miqcie/grepai-beads-helpers0 reactions
- Jan 11, 2026🔍 Optimisation des recherches en mode plan : grepai comme alternative sémantique à grep — Dev-Int/tests0 reactions · 1 comment
On Bluesky · 2
- Jan 21, 2026On vise les 300 ⭐️ sur GitHub ! Si GrepAI atteint ce cap mercredi prochain, je m'engage à lancer le projet sur Product Hunt. 📦 Aidez-moi à… — @yoandev.co6 likes and reposts
- Jan 11, 2026見てる: "yoanbernabeu/grepai: grep on steroids: semantic code search powered by AI embeddings. Search your codebase by meaning, not just… — @azu.bsky.social1 likes and repost
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 28,693 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

