convez.ai
MCP Server
Stahldavid

sensegrep

Stahldavid/sensegrep

Ver no GitHub
BomPluginScore · de 0 a 100

Semantic + structural code search for AI-native development

Instalação

$npx convez-ai Stahldavid/sensegrep

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
2
Forks
0
Acompanhando
0
Saúde
100%
Último commit
há 2 semanas
Versão
@sensegrep/cli@1.20.1
Issues abertas
8
Contribuidores
3

README

A tradução para o português deste README ainda está na fila.

sensegrep

semantic grep for AI coding agents

npm version License CI

sensegrep understands your code semantically. Instead of matching text patterns, it uses AI embeddings and tree-sitter AST parsing to find code by meaning - so you can search for "authentication logic" and actually find your auth functions, even if they never contain the word "authentication".

AI agents should not read more code, they should read the right code. sensegrep combines semantic search, exact matching, and AST-aware structural retrieval to deliver smaller, more relevant context.

Sensegrep time-to-value demo

MP4 fallback: assets/time-to-value.mp4

Watch full product demo (25s): assets/time-to-value-full.mp4

Why sensegrep?

Traditional search tools (grep, ripgrep, ast-grep) match text patterns. sensegrep matches concepts:

Featuregrep/ripgrepast-grepsensegrep
Exact text matchYesYesYes (via --pattern)
AST-awareNoYesYes (tree-sitter)
Semantic searchNoNoYes (AI embeddings)
Symbol metadata filtersNoPartialYes (30+ filters)
Duplicate detectionNoNoYes (logical duplicates)
Tree-shaking outputNoNoYes (collapse irrelevant code)
MCP server for AI agentsNoNoYes

Quickstart

Claude Code Plugin (recommended)

The fastest way to get sensegrep into Claude Code — zero configuration:

claude plugin marketplace add Stahldavid/sensegrep
claude plugin install sensegrep

This automatically sets up the MCP server and teaches Claude when and how to use sensegrep instead of grep. No manual JSON editing required.

Marketplace setup (required on first install):

claude plugin marketplace add Stahldavid/sensegrep
claude plugin install sensegrep

After the marketplace has been added once, the explicit marketplace form also works:

claude plugin install sensegrep@sensegrep

Running claude plugin install sensegrep@sensegrep on a fresh machine before claude plugin marketplace add Stahldavid/sensegrep will fail because Claude Code does not know the sensegrep marketplace yet.

CLI

npm i -g @sensegrep/cli

# Index your project
sensegrep index --root .

# Search by meaning
sensegrep search "error handling and retry logic" --type function --exported --exclude "*.md"

# Build a reading map for a broad theme
sensegrep survey "authentication login token" --language typescript --limit 4

# Break a broad topic into coherent subthemes
sensegrep cluster "checkout payment order cart" --limit 4

# Find duplicates
sensegrep detect-duplicates --threshold 0.85

Cursor Plugin

Install from the Cursor marketplace or via CLI:

cursor plugin install sensegrep

Includes the MCP server, an always-on rule to prefer sensegrep over grep, and a skill with full filter reference. Cursor plugin status: pending marketplace approval.

One-click MCP install link for Cursor:

Add to Cursor

Fallback deeplink (copy/paste if needed):

cursor://anysphere.cursor-deeplink/mcp/install?name=sensegrep&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBzZW5zZWdyZXAvbWNwQGxhdGVzdCJdfQ%3D%3D

Codex Plugin

Install from the public marketplace — no manual config:

codex plugin marketplace add Stahldavid/sensegrep
codex plugin install sensegrep

See the Codex recipe for the manual ~/.codex/config.toml setup.

MCP Server (for Codex or manual setup)

npx -y @sensegrep/mcp

Add to your MCP configuration:

{
  "servers": {
    "sensegrep": {
      "command": "npx",
      "args": ["-y", "@sensegrep/mcp"]
    }
  }
}

Or with npm global install first:

npm install -g @sensegrep/mcp
{
  "servers": {
    "sensegrep": {
      "command": "sensegrep-mcp"
    }
  }
}

The MCP server provides sensegrep.search, sensegrep.survey, sensegrep.cluster, sensegrep.index, and sensegrep.detect_duplicates tools.

Agent Skill — CLI (no MCP server)

For terminal-first agents or CI, you don't need an MCP server. Install the CLI and the sensegrep-cli Agent Skill, which teaches the agent to run sensegrep commands directly:

npm i -g @sensegrep/cli
npx skills add Stahldavid/sensegrep --skill sensegrep-cli -g

See docs/agent-skills.md for when to use the MCP tools vs the CLI skill.

VS Code Extension

Search for "Sensegrep" in the VS Code marketplace, or install from the extension page.

Features: semantic search sidebar, duplicate detection, code lens, semantic folding, auto-indexing with watch mode.

Recipes

Copy-paste setup and practical workflows:

Full index: docs/recipes/README.md

How It Works

Source Code
    │
    ▼
┌─────────────┐    ┌──────────────┐    ┌──────────────┐
│  Tree-Sitter │───▶│   Chunker    │───▶│  Embeddings  │
│  AST Parser  │    │  (symbols +  │    │ (Gemini or   │
│              │    │   metadata)  │    │ OpenAI-comp) │
└─────────────┘    └──────────────┘    └──────────────┘
                                              │
                                              ▼
                                       ┌──────────────┐
                          Query ──────▶│   LanceDB    │
                                       │ Vector Search│
                                       └──────┬───────┘
                                              │
                                              ▼
                                       ┌──────────────┐
                                       │ Tree-Shaker  │──▶ Results
                                       │ (collapse    │
                                       │  irrelevant) │
                                       └──────────────┘
  1. Parse: Tree-sitter extracts AST nodes with full metadata (symbol type, exports, complexity, docs, decorators)
  2. Chunk: Code is split into semantic chunks aligned to symbol boundaries
  3. Embed: Each chunk is embedded using Gemini or an OpenAI-compatible embeddings API.
  4. Store: Embeddings + metadata are stored in LanceDB for fast vector search
  5. Search: Your query is embedded and matched against the index with optional structural filters
  6. Tree-shake: Results are collapsed to show only relevant code, hiding unrelated symbols

Supported Languages

  • TypeScript / JavaScript (TSX/JSX included)
  • Python (dataclasses, protocols, decorators, async generators, TypedDict, and more)
  • Java (classes, interfaces, records, annotations, methods, and tree-shaken results)
  • Vue (single-file components with <script> / <script setup> semantic support)
  • More coming: C#, HTML (see feature branches)

Search Filters

sensegrep supports 30+ structural filters that can be combined with semantic search:

# Find exported async functions with high complexity
sensegrep search "data processing" --type function --exported --async --min-complexity 5

# Find Python dataclasses
sensegrep search "user model" --type class --variant dataclass --language python

# Find undocumented complex code (refactoring candidates)
sensegrep search "business logic" --min-complexity 10 --has-docs false

# Filter by decorator
sensegrep search "route handler" --type function --decorator route

# Keep docs and markdown out of results
sensegrep search "authentication flow" --include "src/**/*.ts" --exclude "*.md"

# Build a reading map for onboarding a domain
sensegrep survey "authentication login token" --language typescript --limit 4

# Split a broad backend topic into subthemes
sensegrep cluster "price list commission ncm uf packaging" --language java --include "backend-api/**/*.java"

Embeddings Configuration

sensegrep uses remote embedding providers: Gemini, OpenAI-compatible APIs, or Amazon Bedrock.

# Recommended: Gemini embeddings (best quality)
export GEMINI_API_KEY="your_ai_studio_key"
sensegrep search "auth flow" --provider gemini --embed-model gemini-embedding-001

# OpenAI-compatible provider
export SENSEGREP_OPENAI_API_KEY="your_api_key"
sensegrep search "auth flow" --provider openai --embed-model fireworks/qwen3-embedding-8b

# Amazon Bedrock + Cohere Embed v4
export AWS_REGION="us-east-1"
sensegrep search "auth flow" --provider bedrock --embed-model cohere.embed-v4:0 --embed-dim 1536

Global defaults via ~/.config/sensegrep/config.json:

{
  "provider": "gemini",
  "embedModel": "gemini-embedding-001",
  "embedDim": 768
}

Common environment variables:

  • SENSEGREP_PROVIDER (gemini, openai, bedrock)
  • SENSEGREP_EMBED_MODEL
  • SENSEGREP_EMBED_DIM
  • GEMINI_API_KEY / GOOGLE_API_KEY (Gemini)
  • SENSEGREP_OPENAI_API_KEY / FIREWORKS_API_KEY / OPENAI_API_KEY (OpenAI-compatible)
  • SENSEGREP_BEDROCK_REGION / AWS_REGION / AWS_DEFAULT_REGION (Amazon Bedrock)
  • SENSEGREP_ROOT (MCP root directory)
  • SENSEGREP_WATCH (MCP watcher toggle)

For the complete and official runtime variable list, see docs/mcp-setup.md.

More embedding providers and API integrations may be added in the future.

Packages

PackageDescriptionnpm
@sensegrep/coreSearch engine librarynpm
@sensegrep/cliCommand-line interfacenpm
@sensegrep/mcpMCP server for AI agentsnpm
sensegrepVS Code extensionMarketplace
sensegrep-pluginClaude Code pluginclaude plugin marketplace add Stahldavid/sensegrep && claude plugin install sensegrep
sensegrep-cursorCursor plugincursor plugin install sensegrep
sensegrep (Codex)Codex plugincodex plugin marketplace add Stahldavid/sensegrep && codex plugin install sensegrep

Case Studies

Reproducible qualitative examples from public repositories:

Roadmap

  • ROADMAP.md
  • Benchmark methodology vs ripgrep / ast-grep is scheduled for Month 2.

Contributing

See CONTRIBUTING.md for development setup, architecture overview, and contribution guidelines.

Community

License

Apache-2.0

Ver o original no GitHub

Bom para

Relacionados