TencentAgentMemoryBridge: Skill for Claude Code

.claude/skills/memory-init/SKILL.md

memory-init is a skill for Claude Code from kuaizhongqiang/TencentAgentMemoryBridge. It costs 114 tokens per session (1,330 once invoked), scanned A, original, MIT.

A project setup and repair skill for TencentDB Agent Memory, a service that stores agent memory. It checks the project’s connection settings, keeps each project’s memory separate, and repairs a missing stop hook, which is a script run when work ends.

In plain words
What is it for?
Initializing memory in a project, checking the memory gateway and authentication, deriving a project-based task ID, and restoring the automatic memory-saving stop script when needed.
Why use it?
It helps prevent memories from different projects being mixed together and catches incomplete or incorrect setup after copying configuration between projects.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths; mentions Claude Code.

This is kuaizhongqiang/TencentAgentMemoryBridge's own configuration. It tells Claude Code how to work on TencentAgentMemoryBridge itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything TencentAgentMemoryBridge configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/kuaizhongqiang/TencentAgentMemoryBridge/main/.claude/skills/memory-init/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/kuaizhongqiang/TencentAgentMemoryBridge

Made for: Claude Code.

Wrote 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.

agentmods badge for memory-init

README.md
[![agentmods](https://agentmods.dev/badge/skills/kuaizhongqiang/tencentagentmemorybridge/memory-init.svg)](https://agentmods.dev/skills/kuaizhongqiang/tencentagentmemorybridge/memory-init)
Your own site
<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>
Per session 114 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,330 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 7d ago against content hash 607cd4a247be, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

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.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/init.mjs, scripts/stop-memory-store.mjs), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

.claude/skills/memory-init/SKILL.md · 62 lines

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 自动入库脚本(种子,用于补回缺失副本)

步骤

  1. 在项目根目录运行初始化脚本:

    node .claude/skills/memory-init/scripts/init.mjs
    
  2. 读取输出,逐项核对:

    • config.required / gateway.read / gateway.auth 是否 ✅
    • task_id 是否等于期望的项目目录名(且不是 agt-/team-/usr- 开头的身份 id)
    • Stop hook 状态:存在 / 已补写 / 修复: <路径>
  3. 出现 ❌ 项时按提示处理:

    • 缺失配置 / 疑似占位符 → 补全 .claude/settings.local.jsonmcpServers.agent-memory.envMEMORY_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 复制不完整,需从原项目重新复制
  4. (可选)验证写路径会往 L0 留一条 bootstrap 标记,默认不做:

    node .claude/skills/memory-init/scripts/init.mjs --verify-write
    
  5. 向用户汇报结果:身份、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.jsonmcpServers.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 按需调用,绝不自动

Read the full file on GitHub · 62 lines

Files

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.

Changes

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.

  1. 7d ago First seen · 62 lines · 114 tokens per session scan A 607cd4a247be

Subscribe to this mod's changes

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.

Related

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.

garrytan/gbrain · 52 tokens

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.…

mem0ai/mem0 · 273 tokens

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…

danielmiessler/LifeOS · 196 tokens

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.

opensquilla/opensquilla · 44 tokens

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…

shiwenwen/hope-agent · 115 tokens

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.

GanyuanRan/Aegis · 45 tokens