tree-ring-memory-cn

tree-ring-memory-cn is a skill for Claude Code, Codex from YangsonHung/awesome-agent-skills. It costs 43 tokens per session (1,275 once invoked), scanned A, original, MIT.

A local-first memory guide for AI agents that stores concise project decisions, lessons, warnings, preferences, and other useful facts with evidence and controlled aging.

In plain words
What is it for?
It is for recalling project history, recording tested lessons, auditing saved context, merging or removing memories, anonymising sensitive information, and resuming work safely.
Why use it?
It helps an agent recover important project context without treating full chat histories, unverified claims, secrets, or outdated details as permanent memory.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

Good fit It is for recalling project history, recording tested lessons, auditing saved context, merging or removing memories, anonymising sensitive information, and resuming work safely.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yangsonhung/awesome-agent-skills/tree-ring-memory-cn
Install

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.

Any agent
npx skills add YangsonHung/awesome-agent-skills --skill tree-ring-memory-cn
Clone the repo
git clone --depth 1 https://github.com/YangsonHung/awesome-agent-skills

Made for: Claude Code, Codex.

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 tree-ring-memory-cn

README.md
[![agentmods](https://agentmods.dev/badge/skills/yangsonhung/awesome-agent-skills/tree-ring-memory-cn/github.svg)](https://agentmods.dev/skills/yangsonhung/awesome-agent-skills/tree-ring-memory-cn)
Your own site
<a href="https://agentmods.dev/skills/yangsonhung/awesome-agent-skills/tree-ring-memory-cn"><img src="https://agentmods.dev/badge/skills/yangsonhung/awesome-agent-skills/tree-ring-memory-cn/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.

agentmods 80×15 button for tree-ring-memory-cn

Your own site · 80×15
<a href="https://agentmods.dev/skills/yangsonhung/awesome-agent-skills/tree-ring-memory-cn"><img src="https://agentmods.dev/badge/skills/yangsonhung/awesome-agent-skills/tree-ring-memory-cn.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,275 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.00043 $0.01275
Opus 5 $0.00022 $0.00638
Sonnet 5 $0.00009 $0.00255
Haiku 4.5 $0.00004 $0.00128

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

Security

Grade A, and why

tree-ring-memory-cn 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 10d 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.

skills/zh-cn/tree-ring-memory-cn/SKILL.md · 122 lines

How it starts

The opening of the file, as written. The whole thing — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Tree Ring Memory

Overview

使用本技能把 Tree Ring Memory 当作具备生命周期意识的 AI Agent 记忆层来操作。它适合保存长期有用的决策、经验、警告、项目约定、用户偏好和未来种子,而不是保存完整聊天记录,也不是后台自动抓取器。

核心思想是让 Agent 记忆有意地老化:

  • 仍在进行的工作可以保留较多细节
  • 较旧经验应压缩成稳定摘要
  • 重要失败和警告应保持可见
  • 持久偏好和项目事实应成为高置信记忆
  • 尚未确认的后续想法应与事实分开
  • 敏感信息应默认阻止、脱敏或遗忘

何时使用

在以下场景使用本技能:

  • 用户要求记住、召回、合并、脱敏或遗忘。
  • 当前任务依赖过去的项目决策、偏好或警告。
  • Agent 正在开始或恢复一个带有 Tree Ring Memory 或项目本地 .tree-ring 目录的仓库。
  • 测试、事故、PR、基准、评审或运行记录产生了对未来有用的经验。
  • AGENTS.md、DOX 或 Revolve 等来源文档包含应汇总进记忆的长期指导。
  • Agent 需要在高风险改动前审计已保存的记忆。

不要使用

以下场景不要把本技能作为主要指南:

  • 任务结束后就应消失的短期草稿。
  • 原始思维链或隐藏推理。
  • 密钥、凭据、令牌、私钥、支付信息或其他敏感值。
  • 保存完整对话,而不是简洁经验或决策。
  • 把未经验证的说法当作持久项目事实。
  • 替代来源文档、测试、Issue、PR 或发布记录。

使用说明

当 Tree Ring Memory 能改善连续性时,按下面的流程执行。简单任务中只做窄范围召回,并且只有经验明显具备长期价值时才写入记忆。高风险任务中应加入来源检查、证据化记录和收尾复盘。

工作流程

  1. 当历史上下文可能影响任务时,先召回再行动。
  2. 优先使用窄范围、项目级查询,避免泛泛的全局召回。
  3. 如果存在来源文档,必须直接读取;记忆不能替代 AGENTS.md、项目文档、测试、Issue、PR 或发布记录。
  4. 只保存未来确实有帮助的简洁经验、决策、警告和偏好。
  5. 如果经验来自经过审查的运行、评估、检查点、事故、分支、PR、Issue 或测试产物,优先使用证据化记录。
  6. 对过时或敏感记忆执行脱敏、替换或删除,不要保留已知错误的上下文。

命令参考

先查看本地帮助,确保命令与当前安装版本一致:

tree-ring --help
tree-ring evidence --help
tree-ring dox sync --help
tree-ring revolve sync --help

如果项目有本地 Tree Ring 配置,先读取 .tree-ring/SKILL.md.tree-ring/CLI.md,不要直接假设全局配置适用于当前仓库。需要显式指定项目存储时,使用本地 root:

tree-ring --root .tree-ring recall --query "release decisions"
tree-ring --root .tree-ring evidence --help

写入来源适配器摘要前先使用 dry-run:

tree-ring dox sync --source-root . --dry-run
tree-ring revolve sync --source-root revolve --dry-run
tree-ring integrations scan --source-root .

只有当摘要简洁、有用、带来源且隐私安全时,才执行实际写入。

年轮模型

用年轮模型判断保留强度:

  • cambium:当前活跃任务上下文
  • outer:近期决策和经验
  • inner:较旧的压缩项目知识
  • heartwood:高置信、长期稳定的事实和偏好
  • scar:重要失败、回归、被否定方案和警告
  • seed:未解决想法、假设和后续事项

不要把证据薄弱的内容提升到 heartwood。在用户确认或证据足够强之前,优先使用 outerseed

隐私守门规则

永远不要保存:

  • 密钥、凭据、令牌、私钥或支付信息
  • 原始思维链
  • 临时草稿
  • 未验证却被当作持久事实的说法
  • 未经用户明确指示的敏感健康、财务、法律或个人标识信息
  • 超出短摘录范围的受版权保护文本

如果有用记忆包含敏感材料,只保留足够避免重复错误的脱敏操作摘要。

收尾清单

结束有意义的工作前,检查:

Read the full file on GitHub · 122 lines

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. 10d ago First seen · 122 lines · 43 tokens per session scan A a51fd5902c5a

Subscribe to this mod's changes

tree-ring-memory-cn is a skill published in the GitHub repository YangsonHung/awesome-agent-skills (18 stars, last pushed 1mo ago), licensed MIT. It adds 43 tokens to every session and 1,275 once invoked, about $0.0002 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-30.

Related

Other skills, from other repositories