Local semantic and hybrid search for codebases and coding-agent history. Find implementation by intent, then recover the decisions and fixes that led to it across Claude Code, Codex, Cursor, OpenCode, and Pi sessions.
FAQ
sgrep is a Claude Code plugin with 1 hand-picked skill for development work, indexed on Flowy. Install it with the command on its page. It includes sgrep. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
> /plugin marketplace add XiaoConstantine/sgrep> /plugin install sgrep@sgrep
Local semantic and hybrid search for codebases and coding-agent history.
Find implementation by intent, then recover the decisions and fixes that led to it across Claude Code, Codex, Cursor, OpenCode, and Pi sessions.
Documentation · Getting started · CLI reference · Agent skill
sgrep "where do we validate authentication tokens"
sgrep conv "why did we change the authentication cache key"
brew tap XiaoConstantine/tap
brew install sgrep
# Download the local embedding model and verify llama.cpp.
sgrep setup
See the installation guide for curl, Go, source builds, and sqlite-vec.
cd your-repository
sgrep index .
sgrep "database connection error handling" # balanced, the default
sgrep --profile fast "request routing" # lowest latency
sgrep --profile quality "JWT validation middleware" # optional ColBERT reranking
| Profile | Pipeline | Use it for |
|---|---|---|
fast | Semantic | Quick exploration |
balanced | Semantic + BM25 | Recommended everyday profile; default |
quality | Semantic + BM25 + ColBERT | Optional reranking experiments |
sgrep conv index
sgrep conv "embedding server ownership bug"
sgrep conv "session compaction" --agent codex --since 7d
sgrep conv resume <session_id>
Conversation search supports Claude Code, Codex CLI, Cursor, OpenCode, and Pi, with semantic, hybrid, and exact retrieval.
sgrep complements structural and exact search:
| Tool | Finds | Example |
|---|---|---|
sgrep | Intent | sgrep "authentication logic" |
ast-grep | Structure | sg -p '$fn($args)' |
ripgrep | Exact text | rg "JWT_SECRET" |
Install the shared agent skill:
npx skills add XiaoConstantine/sgrep --skill sgrep -g
Claude Code users can also install automatic project indexing and watch hooks:
sgrep install-claude-code
The managed local llama.cpp service is shared, while code and conversation indexes retain separate retrieval controls. The editable diagram source is at docs/static/architecture.tldr.
In the final controlled local-only comparison, sgrep balanced is the
strongest overall local quality-latency tradeoff and the strongest normalized
implementation-code retriever by point estimate. It is not universally best,
and the bootstrap confidence intervals overlap competing tools.
| Evaluation track | Point-estimate result |
|---|---|
| Normalized implementation code | sgrep balanced: MRR 0.792, NDCG@10 0.589, R@10 0.413 at 54.4ms median |
| Normalized all files | osgrep wins MRR (0.867); sgrep balanced/quality win NDCG@10 and R@10 (0.607 / 0.340) |
| Native product output | osgrep wins MRR (0.858) and ChunkHound wins R@10 (0.236); sgrep balanced's small NDCG@10 lead is pool-sensitive |
The benchmark used 20 queries, model-judged pooled qrels, sgrep source
19ebec1, and the pinned dspy-go corpus at 87cb50f. Query-bootstrap 95%
confidence intervals overlap, so these are point-estimate verdicts rather than
significance claims. balanced is recommended over quality: it was faster
and matched or beat it on the final normalized metrics. Cloud-backed mgrep is
kept in a separate, quota-interrupted exploratory track and is not part of the
local comparison.
See the benchmark methodology and full tables.
| Guide | Covers |
|---|---|
| Getting started | Installation, setup, first searches |
| Code search | Profiles, output, watch mode, reranking |
| Conversation search | Sources, filters, view, export, resume |
| CLI reference | Commands and flags |
| Configuration | Environment and server modes |
| Storage | Index files and vector backends |
| Library API | Embedding sgrep in Go |
go build -o sgrep ./cmd/sgrep
go test ./...
golangci-lint run ./...
Apache-2.0
.claude/
.claude-plugin/
marketplace.json
commands/
sgrep.md
.github/
workflows/
ci.yml
docs.yml
release.yml
.gitignore
.goreleaser.yaml
AGENTS.md
bench/
quality/
coir_results.json
dataset.json
dspy-go-dataset.json
metrics_test.go
metrics.go
run_coir_bench.py
run_dspy_bench.py
runner.go
types.go
README.md
results/
current-implementation/
hybrid.txt
hybrid+colbert.txt
semantic.txt
search_benchmark_test.go
benchmark_results.json
cmd/
profile/
index_profile.go
main.go
sgrep/
sgrep-bench/
main.go
main.go
docs/
.gitignore
content/
_index.md
architecture.md
benchmarks.md
guides/
_index.md
agent-integration.md
code-search.md
conversation-search.md
getting-started.md
library.md
reference/
_index.md
cli.md
configuration.md
storage.md
hugo.toml
layouts/
_default/
baseof.html
list.html
single.html
home.html
static/
architecture.jpg
architecture.tldr
css/
site.css
go.mod
go.sum
install.sh
internal/
bench/
benchmark_test.go
cli/
conv_test.go
conv_watch.go
conv.go
root.go
LICENSE
Makefile
pkg/
chunk/
chunk_test.go
chunk.go
languages_c.go
languages_java.go
languages_javascript.go
languages_python.go
languages_rust.go
languages.go
treesitter_test.go
treesitter.go
conv/
actions_test.go
actions.go
chunker_test.go
chunker.go
driver_libsql.go
driver_sqlite_vec.go
indexer.go
parser/
claude_test.go
claude.go
codex_test.go
codex.go
cursor.go
driver_libsql.go
driver_sqlite_vec.go
opencode_test.go
opencode.go
parser.go
pi_mono_test.go
pi_mono.go
search_test.go
search.go
store_test.go
store.go
types.go
embed/
embed_test.go
embed.go
index/
colbert_pq_scratch.go
index_test.go
index.go
lexical_test.go
lexical.go
modelcfg/
config_test.go
config.go
rerank/
reranker_test.go
reranker.go
server.go
search/
colbert_bench_test.go
colbert_test.go
colbert.go
search_test.go
search_tq_test.go
search.go
terms_test.go
terms.go
server/
download_test.go
download.go
manager_test.go
manager.go
store/
buffered_test.go
buffered.go
colbert_codec_test.go
colbert_codec.go
disksize_test.go
factory_sqlite_vec_test.go
factory_sqlite_vec.go
factory.go
fts.go
hybrid_test.go
hybrid.go
inmem_test.go
inmem.go
libsql_test.go
libsql.go
mmap_segments_test.go
mmap_segments.go
mmap_vectors_test.go
mmap_vectors.go
prune_sqlite_vec.go
prune.go
quantize_test.go
quantize.go
sqlite_metadata.go
store.go
test_helpers.go
tq_search_store.go
tq_vectors_test.go
tq_vectors.go
types.go
util/
cache_test.go
cache.go
content_test.go
content.go
debug.go
dot_arm64.go
dot_arm64.s
dot_generic.go
eventbox_test.go
eventbox.go
pq_test.go
pq.go
slab_test.go
slab.go
tqmath_arm64.go
tqmath_arm64.s
tqmath_generic.go
tqmath_test.go
tqmath.go
tqprod_test.go
tqprod.go
tracer_test.go
tracer.go
plugins/
sgrep/
.claude-plugin/
plugin.json
hooks/
hook.json
sgrep_start.sh
sgrep_stop.sh
skills/
sgrep/
assets_test.go
assets.go
SKILL.md
profile
README.md
scripts/
benchmark_comparison.sh
benchmark_disksize.go
benchmark.sh
context_sweep.sh
perf_bench.sh
quality_compare.py
quality_comparison.sh
sgrep.go
SKILL.md© 2026 Flowy · Free and open source
Built for Claude Code · Not affiliated with Anthropic