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-auto-recall)<a href="https://agentmods.dev/rules/zql0805/memforge/memforge-auto-recall"><img src="https://agentmods.dev/badge/rules/zql0805/memforge/memforge-auto-recall/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-auto-recall"><img src="https://agentmods.dev/badge/rules/zql0805/memforge/memforge-auto-recall.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.07463 | $0.07463 |
| Opus 5.5 | $0.02985 | $0.02985 |
| Sonnet 5.5 | $0.01493 | $0.01493 |
| Haiku 4.5 | $0.00746 | $0.00746 |
Grade A, and why
memforge-auto-recall 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.
How it starts
The opening of the file, as written. The whole thing — 567 lines — stays where its author put it; the contents beside it link to each section on GitHub.
════════════════════════════════════════════════════
GATE 1 — recall_memory 强制入口(与 GATE 0 同级最高优先级)
读到此处即锁定:本会话首次回复必须先调用 recall_memory
════════════════════════════════════════════════════
铁律:会话首次回复的第一个工具调用必须是 recall_memory
无论用户问什么、任务是否紧急、对话摘要是否已提供上下文,每个会话的第一轮回复中,第一个 MCP/工具调用必须是 recall_memory。
执行要求
- 从用户消息中提取核心关键词作为 query
- 必须传
product_line(从工作区路径推断) - 对话摘要不能替代
recall_memory— 摘要只包含上次对话快照,记忆库包含跨会话的经验、规范和关联知识 - 检索完成后,结合记忆结果和对话摘要决定下一步行动
- 跨会话恢复未完成工作时,遵循「跨会话恢复安全协议」(见下方独立章节)
后续交互的检索规则
- 同一会话内,当任务/话题发生变化时必须再次 recall_memory
- 同一任务的连续交互无需重复检索
- 涉及代码修改时,额外检索相关文件路径和业务域
违规识别
- 会话首轮回复中未调用 recall_memory 就执行其他工具(Read/Shell/Grep 等)→ 违规
- 以「对话摘要已提供上下文」为由跳过 recall_memory → 违规
- MCP 服务可用时因「任务简单」而跳过 recall_memory → 违规
唯一例外
- Memforge MCP 服务不可用(连接失败/超时)→ 静默跳过,不阻塞
- 用户明确写「不用检索记忆」「跳过 recall」→ 可省略
════════════════════════════════════════════════════
跨会话恢复安全协议
════════════════════════════════════════════════════
核心原则:用户当前问题优先于历史待办
当新会话带有上次对话摘要且存在未完成工作时,必须先回答用户当前的问题,而非直接跳到历史待办。
恢复流程
- 先回答用户当前问题 — 无论待办工作是否存在,用户当前消息的优先级最高
- 判断关联性 — 用户当前问题是否与待办工作直接相关:
- 相关(如用户说"上次那个功能做完了吗")→ 回答后自然衔接待办工作
- 不相关(如用户问了一个新问题)→ 回答完后,在末尾单独提醒:"上次还有 X 功能未完成,是否继续?"
- 恢复前必须验证实际状态 — 不能盲信 TODO 列表的标记:
- 检查
git log确认代码变更是否已提交/部署 - 检查数据库/文件系统确认数据变更是否已执行
- 向用户展示验证结果 + 待办列表,获得明确确认后再继续
- 检查
安全红线
| 场景 | 规则 |
|---|---|
| TODO 标记为 completed 的任务 | 绝不重做,即使用户问了相关问题也只汇报结果 |
| 破坏性/不可逆操作(删除数据、DROP TABLE、force push 等) | 必须单独确认,即使 TODO 标记为 pending |
| 有副作用的操作(数据库写入、发消息、部署等) | 验证是否已执行过,防止重复执行 |
| TODO 状态与实际环境矛盾 | 以实际环境为准,向用户说明差异 |
违规识别
- 未回答用户当前问题就直接继续历史待办 → 违规
- 未验证实际状态就执行待办中的破坏性操作 → 违规
- 重复执行已完成的有副作用操作 → 违规
════════════════════════════════════════════════════
Memforge 记忆自动检索与存储
核心指令
你有权访问 Memforge MCP 工具(29 + 17 个)。在回答用户问题或执行任务之前,必须先检索相关记忆(参见 GATE 1)。
编码规范强制加载(修改代码前必须执行)
在修改、创建、审查代码之前,必须调用 get_system_rules 加载团队规范:
get_system_rules({
product_line: "<从工作区路径推断>",
language: "<当前项目主语言,如 java/php/typescript>",
format: "prompt"
})
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 · 567 lines · 7,463 tokens per session scan A 1016fb09d8ce
memforge-auto-recall is a cursor rule published in the GitHub repository zql0805/memforge (2 stars, last pushed 3mo ago), licensed MIT. It adds 7,463 tokens to every session, about $0.0299 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.