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 1mo 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.
- 1mo 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 3mo 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.
Other cursor rules, from other repositories
compression-safety
Cursor rule "compression-safety" from yvgude/lean-ctx, covering compression safety — prevent lean-ctx marker corruption, the problem, rules for all agents, never write compressed content to files and file restoration commands.
honcho_rules
Honcho persistent memory — capture every conversation, recall past context, and build a growing model of the user. Activates on every conversation.
nauro-adopt
Seeds Nauro's project store from an existing repo. Use after nauro adopt has run locally. On filesystem-capable surfaces, reads docs (README, manifests, ADRs, Memory-Bank) for rationale and inspects code, config, tests, lockfiles, and recent git history for evidence, then surfaces targeted probes that turn evidence…
nauro-context
Writes durable shared context into Nauro's project store so other agents (a later session or a parallel one) can discover and pull it, finds and reads context another agent left, or captures a resumable brief so your own next session in this environment picks up cleanly. Three modes. Author writes a shared brief for…
graphmind-memory
A set of rules connects the coding agent to GraphMind, a shared memory system that stores project knowledge between sessions. It uses an MCP service to restore context, record actions, and save decisions.
compendium
Prefer the Compendium MCP gateway to shrink noisy/large context before pasting it into the conversation.