2P by meghendra 11시간전 | ★ favorite | 댓글과 토론

안녕하세요. cgrep이라는 로컬 우선(code-local) 코드 검색 도구를 만들었습니다.

핵심 목표는 AI 코딩 에이전트가 코드베이스를 탐색할 때 발생하는 토큰 낭비와 반복 검색을 줄이는 것입니다.
cgrep은 BM25 검색(Tantivy) + AST 심볼 분석(tree-sitter)을 결합해서, 단순 문자열 검색보다 코드 의도에 맞는 탐색을 하도록 설계했습니다.

주요 기능:

  • 코드 탐색: definition / references / callers / dependents
  • 컨텍스트 탐색: read / map
  • 에이전트 2단계 흐름: agent locate -> agent expand (작은 페이로드로 후보 찾고 필요한 것만 확장)
  • MCP 지원: cgrep mcp serve + host 설치 지원
  • 에이전트 설치 지원: claude-code, codex, copilot, cursor, opencode

PyTorch 기준 벤치마크(구현 추적 시나리오 6개):

  • grep 기준 tokens-to-complete: 127,665
  • cgrep(agent locate/expand) tokens-to-complete: 6,153
  • 토큰 95.2% 감소 (20.75x 축소)
  • 완료까지 평균 검색 지연: 1321.3ms -> 22.7ms (약 58.2x)

모든 처리는 로컬에서 동작합니다(클라우드 인덱스 의존 없음).

피드백 부탁드립니다:

  • 실제 대형 코드베이스에서 부족한 점
  • MCP/에이전트 연동에서 필요한 개선점
  • 벤치마크 시나리오 보강 아이디어

Repo: https://github.com/meghendra6/cgrep
Docs: https://meghendra6.github.io/cgrep/
Benchmark: https://meghendra6.github.io/cgrep/benchmarks/…