The goal is to reduce noisy retrieval loops and token waste in real repositories. cgrep combines BM25 + tree-sitter symbol awareness, with optional semantic/hybrid search, and returns deterministic JSON for agent workflows.
What it does: - Code navigation: definition, references, callers, dependents - Focused context tools: read, map - Agent flow: `agent locate` -> `agent expand` (small payload first, expand only selected IDs) - MCP support: `cgrep mcp serve` + host install helpers - Agent install support: claude-code, codex, copilot, cursor, opencode
Benchmark snapshot (PyTorch, 6 implementation-tracing scenarios): - Baseline (`grep`) tokens-to-complete: 127,665 - cgrep (`agent locate/expand`) tokens-to-complete: 6,153 - 95.2% fewer tokens (20.75x smaller) - Avg retrieval latency to completion: 1321.3ms -> 22.7ms (~58.2x faster after indexing)
Links: - Repo: https://github.com/meghendra6/cgrep - Docs: https://meghendra6.github.io/cgrep/ - Benchmark method/results: https://meghendra6.github.io/cgrep/benchmarks/pytorch-agent-...
I’d really appreciate feedback on: - Real-world agent workflows I should benchmark next - MCP/agent integrations I should add - Cases where cgrep retrieval quality still falls short