@VincentLogic: 这开源项目把 Claude Code 的成本砍了 25%。 它不做新模型,不做新 IDE。 就给 AI coding agent 画了张"代码地图"。 传统玩法:模型读完整个仓库 → 爆 token。 它的玩法:先把代码用 Tree-si…
摘要
一个开源项目通过Tree-sitter将代码解析成图结构并存入本地SQLite,为AI coding agent提供代码地图,从而减少token消耗和成本,平均节省57% token,成本降低25%。支持Claude Code、Cursor、aider等工具。
查看缓存全文
缓存时间: 2026/06/09 10:45
这开源项目把 Claude Code 的成本砍了 25%。
它不做新模型,不做新 IDE。 就给 AI coding agent 画了张“代码地图“。
传统玩法:模型读完整个仓库 → 爆 token。 它的玩法:先把代码用 Tree-sitter 解析成图(函数、调用、引用),存到本地 SQLite。 AI 想知道某个函数被谁调用,不用读全文,直接查图。
一句话:别人是给 AI 看整本书。它是给 AI 配了张目录。
官方 benchmark 跑了 7 个大型仓库(VS Code、Django、Tokio、Gin、OkHttp……):
平均省 57% token 成本降 25% 速度快 23% 工具调用少 62%
开源,支持 20+ 语言,Claude Code / Cursor / aider 都能接。
现在的 AI 编程工具拼的不是模型,是给模型“省脑子“的工程能力。
This open-source project slashes the cost of Claude Code by 25%.
It doesn’t create new models or new IDEs. It just draws a “code map” for the AI coding agent.
Traditional approach: The model reads the entire repository → token explosion. Its approach: First parse the code into a graph using Tree-sitter (functions, calls, references), store it in a local SQLite. When the AI wants to know who’s calling a certain function, no need to read the full text—just query the graph.
In one sentence: Others give the AI the whole book to read. It equips the AI with a table of contents.
Official benchmark run on 7 large repositories (VS Code, Django, Tokio, Gin, OkHttp…):
Average token savings of 57% Cost reduced by 25% Speed improved by 23% Tool calls reduced by 62%
Open-source, supports 20+ languages, compatible with Claude Code / Cursor / aider.
Today’s AI programming tools aren’t competing on models—they’re competing on engineering chops that “save brainpower” for the models.
GitHub:https://github.com/colbychherry/codegraph…
之前大家卷的全是“模型上下文窗口多大“——100 万、200 万、1000 万。 但你真给 AI 喂 100 万 token 的代码,它要么迷路、要么抓不住重点。 真正有用的不是“装得下“,是“找得到“。
codegraph 这种思路以后会越来越多: 文档有“语义搜索“、代码有“图谱“、公司内部数据有“结构化索引“。 套在 AI 上面就是同一个东西——别让 AI 读完所有东西,让它知道去哪查。
这也是为什么 RAG 这一波还没死。 只是从“粗糙切片“进化到“结构化查询“而已。
对于 AI 来说,上下文里塞满无关代码就是‘噪音’,噪音多了就容易产生幻觉。有了这张‘地图’,AI 就像开了上帝视角,知道路在哪,而不是在代码丛林里盲搜。这才是真正的Context Engineering。
确实,盲目 RAG 整个仓库就是浪费 token。有了代码图谱,AI 才知道该看哪部分,精准打击而不是地毯式轰炸
Hermes Agent 的 SOUL.md 可以直接定义 Agent 的角色和行为方式。
5个可以直接复制用的模板:
研究员——查事实、核来源、把证据整理清楚,不猜。
内容创作者——学你的表达风格,找热点,写帖子,不重复上次的角度。
运营经理——管收件箱、会议、截止日期,只汇报真正要紧的事。
销售——找潜在客户、起草外联、跟进、记录异议、推动成交。
创始人首席助理——排项目优先级、找执行瓶颈、追目标进度、保持方向不跑偏。
SOUL.md 的逻辑是:与其每次给 Agent 写一堆系统提示词,不如一次定义清楚它是谁、怎么工作。
你现在最需要哪个角色帮你?
相似文章
@VincentLogic: AI 编程助手每次改代码都要把整个项目扫一遍,这 Token 烧得我心疼。 装了 CodeGraph 之后,它不再像无头苍蝇一样用 grep 到处翻文件了。它先在本地建个索引图谱,把函数定义、变量引用、调用关系全理清。AI 想干活,直接查…
CodeGraph 通过本地构建索引图谱,减少 AI 编程助手扫描整个项目的次数,大幅降低 Token 消耗并提升速度,兼容 VS Code、Claude Code 和 Cursor。
@GitTrend0x: Claude Code 代码库智能大脑 27×省 Token 杀手级开源神器 https://github.com/repowise-dev/repowise… 这就是 Repowise,专为 AI 辅助工程团队打造的代码库智能平台!它把…
Repowise is an open-source tool that indexes codebases into four intelligence layers (dependency graph, git history, auto-documentation, architectural decisions) and exposes them via seven MCP tools to AI coding agents like Claude Code, achieving up to 27× token savings while maintaining answer quality.
@GitHub_Daily: 用 Claude Code 开发项目,代码库一大,每次探索代码结构都要扫一堆文件,工具调用多、速度慢,token 也跟着烧。 于是找到 CodeGraph 这个开源工具,给代码库预建一张语义知识图谱,让 Claude Code 直接查图而…
CodeGraph 是一个开源工具,为代码库预建语义知识图谱,让 Claude Code 直接查图而不是逐文件扫描,从而大幅减少工具调用次数(减少 92%)并提升探索速度(提升 71%),支持 19 种编程语言和 13 个框架。
@FakeMaidenMaker: 想真正搞懂 Claude Code 这类 AI Agent 底层怎么搭,这个开源项目从 0 手写了一个给你看 GitHub 揽获 66.5K Star,还上了 Trendshift 热榜 Agent 的智能来自模型本身,你能做的不是「造智…
一个开源项目从零教你搭建 Claude Code 的简化版,深入讲解 AI Agent 的 harness 工程,已获 66.5K Star。
@justloveabit: https://x.com/justloveabit/status/2055263377006747820
介绍Claude Code 2.1.142新版本与CodeGraph、MCP的组合使用,通过本地语义知识图谱大幅提升大型代码库的探索效率,tool call减少92%,速度提升71%。