Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/zql0805/memforgeWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/zql0805/memforge/memforge-codebase-memory-routing)<a href="https://agentmods.dev/rules/zql0805/memforge/memforge-codebase-memory-routing"><img src="https://agentmods.dev/badge/rules/zql0805/memforge/memforge-codebase-memory-routing/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/zql0805/memforge/memforge-codebase-memory-routing"><img src="https://agentmods.dev/badge/rules/zql0805/memforge/memforge-codebase-memory-routing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00641 | $0.00641 |
| Opus 5.5 | $0.00256 | $0.00256 |
| Sonnet 5.5 | $0.00128 | $0.00128 |
| Haiku 4.5 | $0.00064 | $0.00064 |
Grade A, and why
memforge-codebase-memory-routing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
代码发现工具路由策略
核心原则
当需要理解代码结构时,优先使用 Codegraph MCP 的结构化工具,而非 Grep/Glob/Read 全文搜索。 Codegraph 基于 AST 实时解析,已索引多个仓库,查询精确且 Token 消耗低。
工具选择决策树
| 需要做的事 | 首选(Codegraph) | 备选(传统工具) |
|---|---|---|
| 根据任务描述获取相关代码 | codegraph_context(task) |
手动 Grep + Read 多文件 |
| 查找函数/类/方法定义 | codegraph_search(query) |
Grep 按函数名搜索 |
| 追踪谁调用了某函数 | codegraph_callers(symbol) |
Grep 逐文件追踪 |
| 追踪某函数调了什么 | codegraph_callees(symbol) |
Grep 逐文件追踪 |
| 追踪两个符号间的调用路径 | codegraph_trace(from, to) |
手动逐层追踪 |
| 分析修改某符号的影响范围 | codegraph_impact(symbol) |
git diff + 手动分析 |
| 批量查看多个相关符号源码 | codegraph_explore(symbols) |
逐个 Read 文件 |
| 查看单个符号签名和位置 | codegraph_node(symbol) |
Grep + Read |
| 查看项目文件结构 | codegraph_files(project) |
ls / Glob |
多项目查询
所有工具支持 projectPath 参数切换目标仓库,格式:/opt/memforge/repos/<产品线>/<仓库名>
仍然使用 Grep/Glob/Read 的场景
以下场景直接使用传统工具:
- 文本内容搜索:日志文本、错误消息、配置值、字符串常量
- 文件名搜索:按文件名模式查找文件(Glob)
- 配置文件:读取 JSON/YAML/TOML/ENV 等
- 文档/注释:搜索 Markdown、README、注释
- 非代码文件:SQL 脚本、Shell 脚本、Dockerfile
- 已知文件路径:直接 Read
注意事项
- Codegraph 数据基于 AST 实时解析,代码变更后 ~1s 自动同步
- 优先使用
codegraph_context(task)—— 描述任务即可获取相关代码,无需精确指定符号名 - 如果 Codegraph MCP 不可用(服务离线/网络不通),静默回退到 Grep/Glob/Read
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 50 lines · 641 tokens per session scan A 1144e346a652
memforge-codebase-memory-routing is a cursor rule published in the GitHub repository zql0805/memforge (2 stars, last pushed 5mo ago), licensed MIT. It adds 641 tokens to every session, about $0.0026 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
memforge-codebase-memory-routing compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| memforge-codebase-memory-routingzql0805/memforge | Cursor rule | 2 | 5mo ago | MIT | A | 641 | Cursor |
| compression-safetyyvgude/lean-ctx | Cursor rule | 4.0k | yesterday | Apache-2.0 | A | 399 | Cursor |
| honcho-memoryplastic-labs/honcho | Cursor rule | 8.4k | today | AGPL-3.0 | A | 224 | Cursor |
| cursorrulesnhadaututtheky/neural-memory | Cursor rule | 246 | 2d ago | MIT | A | 917 | Cursor |
| nauro-adoptNauro-AI/nauro | Cursor rule | 10 | yesterday | Apache-2.0 | A | 89 | Cursor |
| honcho_rulesmatthewdcage/llm-swarm-router | Cursor rule | 28 | 21d ago | MIT | A | 1,412 | Cursor |
| nauro-contextNauro-AI/nauro | Cursor rule | 10 | yesterday | Apache-2.0 | A | 272 | Cursor |