Borrowing it
Nothing to install: this file belongs to kuaizhongqiang/TencentAgentMemoryBridge. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/kuaizhongqiang/TencentAgentMemoryBridge/main/.claude/skills/memory-init/SKILL.mdgit clone --depth 1 https://github.com/kuaizhongqiang/TencentAgentMemoryBridgeWrote 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/skills/kuaizhongqiang/tencentagentmemorybridge/memory-init)<a href="https://agentmods.dev/skills/kuaizhongqiang/tencentagentmemorybridge/memory-init"><img src="https://agentmods.dev/badge/skills/kuaizhongqiang/tencentagentmemorybridge/memory-init/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/skills/kuaizhongqiang/tencentagentmemorybridge/memory-init"><img src="https://agentmods.dev/badge/skills/kuaizhongqiang/tencentagentmemorybridge/memory-init.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.00114 | $0.01330 |
| Opus 5.5 | $0.00046 | $0.00532 |
| Sonnet 5.5 | $0.00023 | $0.00266 |
| Haiku 4.5 | $0.00011 | $0.00133 |
Grade A, and why
memory-init 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 2mo 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 — 62 lines — stays where its author put it; the contents beside it link to each section on GitHub.
memory-init
把当前项目接入 TencentDB Agent Memory(团队版 v3)。典型场景:把 TencentAgentMemoryBridge 的 .claude 文件夹整体复制到新项目后,执行本 skill,让该项目的 Claude Code 能正确按项目级 task_id 隔离记忆。
身份 vs 项目(必须先分清,禁止混用)
| 概念 | 配置项 | 取值形态 | 含义 | 是否随项目变 |
|---|---|---|---|---|
| 平台身份 | AGENT_ID |
agt-xxx |
本 agent(claude-code)的隔离身份,meta 面注册实体 | ❌ 跨项目不变 |
| 团队 | TEAM_ID |
team-xxx |
所属团队 | ❌ 跨项目不变 |
| 用户 | USER_ID |
usr-xxx |
唯一人类用户 | ❌ 跨项目不变 |
| 项目标签 | TASK_ID |
项目名(如 TencentAgentMemoryBridge) |
项目级隔离标签,自由字符串 | ✅ 每项目不同 |
⚠️
task_id绝不等于/不来自任何身份 id:不要用AGT_ID/TEAM_ID/USER_ID/key 当task_id(mcp-bridge ≥0.4.0 会拒绝agt-/team-/usr-/sk-前缀并报错)。task_id的取值是"这个项目叫什么",身份是"我是谁"——两码事。
前置
.claude/settings.local.json已含mcpServers.agent-memory(随.claude一起拷贝过来)- 本 skill 目录自带两个脚本(随
.claude拷贝):scripts/init.mjs— 初始化主脚本scripts/stop-memory-store.mjs— Stop hook 自动入库脚本(种子,用于补回缺失副本)
步骤
-
在项目根目录运行初始化脚本:
node .claude/skills/memory-init/scripts/init.mjs -
读取输出,逐项核对:
config.required/gateway.read/gateway.auth是否 ✅task_id是否等于期望的项目目录名(且不是 agt-/team-/usr- 开头的身份 id)Stop hook状态:存在/已补写/修复: <路径>
-
出现 ❌ 项时按提示处理:
- 缺失配置 / 疑似占位符 → 补全
.claude/settings.local.json→mcpServers.agent-memory.env的MEMORY_ENDPOINT/API_KEY/SERVICE_ID/TEAM_ID/AGENT_ID/USER_ID - task_id 校验 ❌(身份前缀)→ 清掉
TASK_ID环境变量或改成项目名;绝不能把AGT_ID之类身份 id 填进TASK_ID - 网关不可达(
gateway.read❌)→ 检查MEMORY_ENDPOINT与网络 hook.script❌ 且无种子可补 → 说明.claude复制不完整,需从原项目重新复制
- 缺失配置 / 疑似占位符 → 补全
-
(可选)验证写路径会往 L0 留一条 bootstrap 标记,默认不做:
node .claude/skills/memory-init/scripts/init.mjs --verify-write -
向用户汇报结果:身份、task_id、网关状态、Stop hook 是否已修复,以及下一步。汇报时分开说:
agent_id=agt-xxx(平台身份,跨项目不变)、task_id=<项目名>(本项目),不要混为一谈。
关键事实(汇报与排障时引用)
- task_id = 项目目录名(与 mcp-bridge
deriveTaskIdFromCwd一致,自动派生实现项目级记忆隔离);可用TASK_ID环境变量覆盖,但值必须是项目名,身份 id(agt-/team-/usr-/sk- 前缀)会被拒绝 - 身份单一事实源:
.claude/settings.local.json→mcpServers.agent-memory.env(team/agent/user + Bearer key + 可选USER_KEY);claude-code 的 agent_id 跨项目不变 - MemoryCore 没有 task 实体创建 API(数据面):task_id 是数据面字符串标签,
conversation/add携带即用,无需注册;meta 面/v3/meta/task/*是另一回事(管理端) - Stop hook 自愈:引用的
scripts/stop-memory-store.mjs缺失时从 skill 种子补回;hooks.Stop缺失时自动补写;state 文件加入.gitignore - 每轮对话结束后 Stop hook 自动写入 L0(按
session_id+ 时间戳去重);recall_memory/search_memories按需调用,绝不自动
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 2mo ago First seen · 62 lines · 114 tokens per session scan A 607cd4a247be
memory-init is a skill published in the GitHub repository kuaizhongqiang/TencentAgentMemoryBridge (1 stars, last pushed 3d ago), licensed MIT. It adds 114 tokens to every session and 1,330 once invoked, about $0.0005 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.
memory-init compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| memory-initkuaizhongqiang/TencentAgentMemoryBridge | Skill | 1 | 3d ago | MIT | A | 114 | Claude Code |
| knowledge-ingestopenclaw/openclaw | Skill | 394k | yesterday | MIT | A | 80 | Claude Code, Codex |
| mem0-oss-to-platformmem0ai/mem0 | Skill | 68k | 2d ago | Apache-2.0 | A | 217 | Claude Code, Codex |
| forgetasgeirtj/system_prompts_leaks | Skill | 71k | 2d ago | CC0-1.0 | A | 74 | Claude Code, Codex |
| Cortexdanielmiessler/LifeOS | Skill | 20k | yesterday | MIT | A | 184 | Claude Code |
| memoryopensquilla/opensquilla | Skill | 7.1k | 6d ago | Apache-2.0 | A | 44 | Claude Code, Codex |
| ha-data-storesshiwenwen/hope-agent | Skill | 1.9k | yesterday | MIT | A | 115 | Claude Code, Codex |