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.svg" alt="Measured on agentmods" 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 | $0.00057 | $0.00665 |
| Sonnet 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 7d 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.
- 7d ago First seen · 62 lines · 114 tokens per session scan A 607cd4a247be
memory-init is a skill published in the GitHub repository kuaizhongqiang/TencentAgentMemoryBridge (0 stars, last pushed 22d ago), licensed MIT. It adds 114 tokens to every session and 1,330 once invoked, about $0.0006 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 skills, from other repositories
media-ingest
Ingest video, audio, PDF, book, screenshot, and GitHub repo content into the brain. Multi-format handling with entity extraction and backlink propagation. Covers video-ingest, youtube-ingest, and book-ingest subtypes.
mem0-oss-to-platform
Plan and then execute a migration of a project from the mem0 open-source / self-hosted SDK (the local Memory class) to the mem0 Platform / hosted / managed SDK (the MemoryClient class). Use this whenever a developer wants to move, switch, or migrate their mem0 usage off OSS/self-hosted to the hosted API — e.g.…
Cortex
Operate Cortex, the LifeOS memory system — the typed Knowledge Archive (People, Companies, Ideas, Research with typed related: links) plus recall of prior work sessions, ISAs, and conversations. Search, add, harvest, develop, ingest, distill, graph-navigate, recall. USE WHEN cortex, knowledge, knowledge base, search…
memory
Use when the user asks to remember, recall, forget, update, search, or inspect durable OpenSquilla memory, including profile facts in USER.md and long-term notes in MEMORY.md or memory//.md.
ha-data-stores
Map of Hope Agent's local data stores and safe read-only query workflow. Use when the user asks where Hope Agent stores data, wants to inspect sessions/messages/memory/logs/background jobs/knowledge indexes/settings, asks the model to query local app data, or debugging requires checking persisted state. Trigger…
establishing-project-context
Use when the user asks to establish shared project language, or project work exposes a conflicting, renamed, or deprecated domain term that needs active semantic modeling. Routine small tasks stay on the fast path.