agentleFS
yoanbernabeuyoanbernabeu/grepai/CLAUDE.md

grepai

CLAUDE.md1.9k starsChanged 11 months agoMITView on GitHub

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 embedder: Implement Embedder interface in…

  • Commits and pushes

Trending

More talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 6 mentionsFeb 2026: 1 mentionMar 2026: 1 mentionApr 2026: 1 mentionMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 3 mentionsAug 2026: 3 mentionsSep 2026: 7 mentionsOct 2026: 1 mentionNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the yoanbernabeu/grepai repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about yoanbernabeu/grepai

The biggest 5 of 23 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 23

Talked about on GitHub and Bluesky (23 times).

On GitHub · 21

16 more on GitHub
  • In this repository2 other files it gives its agents.

The file

We split this CLAUDE.md into the rules it gives an agent

11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    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
  1. Very specific:

    Follow conventional commits: type(scope): description

    line 71
  2. Distinctive:

    When working on a GitHub issue, ALWAYS follow this workflow:

    line 77
  3. Distinctive:

    No merge conflicts with main

    line 98
  4. Distinctive:

    IMPORTANT: Never push directly to main.

    line 100
  5. Very specific:

    Use grepai search INSTEAD OF Grep/Glob/find for:

    line 109
  6. Distinctive:

    Only use Grep/Glob when you need:

    line 117
  7. Very specific:

    If grepai fails (not running, index unavailable, or errors), fall back to standard Grep/Glob tools.

    line 123
  8. Very specific:

    Use grepai trace to understand function relationships:

    line 147
  9. Very specific:

    Start with grepai search to find relevant code

    line 169
  10. Very specific:

    Use Read tool to examine files from results

    line 171
  11. Distinctive:

    Only use Grep for exact string searches if needed

    line 172

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

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-all

Architecture 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 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

Data Flow

  1. Scanner (indexer/scanner.go) - Walks filesystem respecting gitignore patterns
  2. Chunker (indexer/chunker.go) - Splits files into overlapping chunks with context
  3. Indexer (indexer/indexer.go) - Orchestrates scanning, chunking, embedding, and storage
  4. Watcher (watcher/watcher.go) - Monitors filesystem for real-time incremental updates
  5. Searcher (search/search.go) - Embeds query and performs similarity search

CLI Commands (cli/)

  • init - Creates .grepai/config.yaml with default configuration
  • watch - Starts daemon: full index + real-time file watcher
  • search - Queries the index with natural language
  • agent-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:

  1. 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
  2. Implement the changes and commit following the commit convention
  3. 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>"
  4. 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.

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 --compact

Query 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 --json

Workflow

  1. Start with grepai search to find relevant code
  2. Use grepai trace to understand function relationships
  3. Use Read tool to examine files from results
  4. Only use Grep for exact string searches if needed

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.