我不再使用 Grep,结果我的 Agent 速度提升了 10 倍

원제 · I Stopped Using Grep and My Agent Got 10x Faster

8:062분 읽기Better Stack2026. 04. 25.컴퓨터/소프트웨어 · 창업/스타트업 · AI/미래기술

핵심 요약

通过部署 Claude Context MCP 插件,开发者可以利用混合检索技术大幅提升 AI 对代码库的理解深度,在处理中等规模项目时尤其能显著缩短获取详细架构信息所需的时间。

하이라이트

  • Claude Context 插件通过向量数据库和混合搜索技术索引整个代码库,减少了 40% 的上下文占用。

  • 该工具结合了 TreeSitter 代码结构解析、基于 Merkle DAG 的增量更新机制以及向量+BM25 混合检索。

  • 在处理 150 万行代码的 VS Code 仓库时,大型索引过程耗时约 50 分钟,OpenAI 嵌入成本约 1.06 美元。

  • Claude Context 在面对复杂查询时,相比传统的 grep 搜索,提供的内容详细程度和架构描述能力高出数倍。

  • 对于中等规模的代码库(2 万至 3 万行代码),Claude Context 能实现极快的索引速度和明显的回复质量提升。

타임라인

  1. Claude Context 的技术架构与功能

    Claude Context 由 Zilliz 开发,通过 MCP 协议连接到各类代理框架。它通过向量搜索捕捉语义含义,并结合 BM25 索引进行关键字匹配,最终实现 40% 的上下文缩减。这种设计使得编码助手能够精准定位代码,而非盲目搜索。

    • 插件通过向量数据库直接索引代码库,避免了传统 grep 搜索的猜测与低效。
    • TreeSitter 支持解析九种主流编程语言,形成函数与类的代码结构块。
    • Merkle DAG 技术确保系统仅重新索引已更改的文件,优化了大规模代码库的管理。
  2. 大规模代码库的实际性能测试

    通过 VS Code 代码库的对比测试,发现 Claude Context 在简单查询中不占速度优势。但在处理复杂问题时,它提供了包含相关文件引用、行号及深层逻辑的详细信息,而常规搜索在相同时间内往往无法提供同等维度的架构解读。

    • 在 150 万行代码的仓库测试中,索引过程耗时 50 分钟并产生了 1.06 美元的 OpenAI 使用成本。
    • 常规 grep 搜索在简单查询中响应速度快于 Claude Context。
    • Claude Context 在复杂问题上表现出更强的代码关联与细节分析能力。
  3. 回复质量对比与使用建议

    针对笼统且宽泛的代码库架构查询,Claude Context 展现了强大的总结能力,能够清晰地划分启动序列与各阶段服务初始化逻辑。尽管索引过程在大型项目中较为耗时,但在中等规模项目中极具实用价值,是理解大型开源项目的有效辅助工具。

    • Claude Context 在回复 Electron 应用主进程架构等复杂问题时,速度比普通方案快五倍且细节更丰富。
    • 中等规模代码库(2万-3万行)是该工具的最佳应用场景。
    • 无服务器版数据库方案在成本与便捷性之间提供了良好平衡。

설명

Claude Context is an MCP server that indexes your entire codebase into a vector database using AST parsing, Merkle DAG hashing, and hybrid semantic + BM25 search giving your coding agent up to 40% context reduction compared to raw grep and glob. Built by Zilliz on top of Milvus, it supports more than 9 programming languages and works with any MCP-compatible agent. In this video I test it against VSCode's 1.5M-line codebase to see if the setup overhead and cloud costs are actually worth it and whether smarter search truly beats traditional file-hunting when your agent needs to understand large, unfamiliar projects. 🔗 Relevant Links Claude Context GitHub - https://github.com/zilliztech/claude-context Claude Context MCP Evals - https://github.com/zilliztech/claude-context/tree/master/evaluation Zilliz - https://zilliz.com/ Milvus - https://milvus.io/ ❤️ More about us Radically better observability stack: https://betterstack.com/ Written tutorials: https://betterstack.com/community/ Example projects: https://github.com/BetterStackHQ 📱 Socials Twitter: https://twitter.com/betterstackhq Instagram: https://www.instagram.com/betterstackhq/ TikTok: https://www.tiktok.com/@betterstack LinkedIn: https://www.linkedin.com/company/betterstack

커뮤니티 글

모든 글 보기
이 영상에 대해 글쓰기