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.
npx agentmods add instructions/zehee/kimi-code-memory-mcp-server/agents-mdgit clone --depth 1 https://github.com/Zehee/kimi-code-memory-mcp-serverWhat 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 | $0.01641 | $0.01641 |
| Opus 5 | $0.00821 | $0.00821 |
| Sonnet 5 | $0.00328 | $0.00328 |
| Haiku 4.5 | $0.00164 | $0.00164 |
Grade A, and why
kimi-code-memory-mcp-server AGENTS.md 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 yesterday.
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 — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.
强制启动协议-(subagent忽略)
每次新会话开始后、回答用户第一个问题或执行任何可能改变项目状态的操作之前,必须调用 mcp__kimi-memory__bootstrap_workspace()。
必须读取并内化:
essence.md—— 当前工作区什么最重要memoryIndexTree—— 记忆目录结构,关注标记[new]的最近变化recentContext—— 当前 session 的最近对话notesRefs—— 是否有待处理的速记
记忆分类约定
| 类型 | folder | tags | 用途 |
|---|---|---|---|
| 决策 | memory/decisions/ |
decision |
架构、接口、流程决策 |
| 规则 | memory/rules/ |
rule |
编码规范、协作红线 |
| 知识 | memory/knowledge/ |
knowledge |
技术栈、业务背景 |
| 参考 | memory/reference/ |
reference |
外部链接、文档引用 |
| 速记 | notes/ |
scratch |
临时便签,不进入长期精要 |
什么时候必须 remember?
出现以下信号时立即写入 memory/:
- 用户说"我们决定…"、"拍板了" →
memory/decisions/,tagdecision - 用户说"这里必须…"、"红线是…" →
memory/rules/,tagrule - 技术选型、接口约定首次出现 →
memory/knowledge/,tagknowledge - 定位到 bug 根因和修复方案 →
memory/decisions/或memory/knowledge/,tagfix - 编码风格、目录结构、命名规范 →
memory/rules/,tagconvention
什么时候不要 remember?
- ❌ 临时调试命令或探索性代码
- ❌ 用户未确认的推测
- ❌ 一次性报错(没有形成通用结论)
- ❌ 当前会话的临时上下文(由
wire.jsonl自动捕获) - ❌ 已经在
memory/中存在的知识
判断口诀:如果这条信息三天后回头看仍然有价值,才写入 memory/。
决策守卫
准备执行任何可能改变项目状态的操作之前(写文件、改结构、做选择、引入依赖):
- 提取关键词(技术实体 + 动作)
- 并行查询:
search(query, folder="memory")—— 查决策/规则/知识search_context(query)—— 查历史对话
- 命中且一致 → 引用来源后继续
- 命中但矛盾 → 向用户报告冲突,请求澄清
- 未命中但重要 → 询问用户"这是一个新决策,是否记录?"
引用来源的纪律
所有从 memory/ 召回的关键结论,回复中必须标注来源:
- ✅ "根据
memory/decisions/xxx,我们决定…" - ❌ "我们之前决定…"(无来源)
主题追溯
当用户要求追溯某个主题时:
- 确认主题范围
- 用
search_context打捞相关 turns(调用时会自动按 90 秒时间簇扩展并提炼命中的 turns) - 用
list_search_views查看最近的搜索视图,作为 theme 挂载的候选集 - 对搜索命中的 turns 做语义分析,用
tag_theme把 genuinely belongs to the theme 的 turns 逐个挂载到themes/<theme>.json - 如果候选不足,用新的 query 再次
search_context打捞,生成新的 search view - 用
trace_theme输出主题时间线
search_context 已内置提炼能力,不需要单独调用 refine_session_turns。
记忆卫生检查清单
每次调用 remember 前:
- 这条信息三天后还有价值吗?
- 是否已有重复记忆?(先
search) -
folder选对了吗?项目相关不进notes/ -
tags是否包含最贴切的分类标签? - 正文是否包含决策原因/影响范围/相关文件?
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.
- yesterday First seen · 145 lines · 1,641 tokens per session scan A 52359bcc4cf6
kimi-code-memory-mcp-server AGENTS.md is an instructions file published in the GitHub repository Zehee/kimi-code-memory-mcp-server (2 stars, last pushed 14d ago), licensed MIT. It adds 1,641 tokens to every session, about $0.0082 per session on Opus 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 instructions, from other repositories
shuohao-skills CLAUDE.md
Instructions for eternityspring/shuohao-skills, covering claude.md and 行为规则.
postgres-skills AGENTS.md
Instructions for neondatabase/postgres-skills, covering agents.md, repository overview, creating a new skill, directory structure and naming conventions.
redthread AGENTS.md
AGENTS.md instructions for matheusht/redthread, covering redthread agent architecture, 1. core operating guidelines, 2. the orchestration workflow (principal vs subagents), the principal agent must and subagent usage.
skills AGENTS.md
Instructions for CometWorks/skills: You are an experienced developer of Space Engineers in-game scripts, mods, and plugins.
OpenSwarm CLAUDE.md
Instructions for VRSEN/OpenSwarm, covering agency builder, background, a note on communication flow patterns, available sub-agents and orchestration responsibilities.
AiDAPrivate AGENTS.md
AGENTS.md instructions for sigwl/AiDAPrivate, covering aida agent instructions, build system, subagent policy, working contract and session change discipline.