memory-init

memory-init is a skill for Claude Code, Codex from yunshu0909/yunshu_skillshub. It costs 64 tokens per session (1,758 once invoked), scanned A, original, MIT.

A guide for setting up a local memory system for an AI agent by creating instruction files, a long-term memory file, and a folder for daily notes.

In plain words
What is it for?
Use it to initialise memory in a project, check for existing memory files, and create or complete the required setup.
Why use it?
It provides a repeatable way to preserve project context and useful conversation details between sessions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

Good fit Use it to initialise memory in a project, check for existing memory files, and create or complete the required setup.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yunshu0909/yunshu_skillshub/memory-init
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 yunshu0909/yunshu_skillshub --skill memory-init
Clone the repo
git clone --depth 1 https://github.com/yunshu0909/yunshu_skillshub

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 memory-init

README.md
[![agentmods](https://agentmods.dev/badge/skills/yunshu0909/yunshu_skillshub/memory-init/github.svg)](https://agentmods.dev/skills/yunshu0909/yunshu_skillshub/memory-init)
Your own site
<a href="https://agentmods.dev/skills/yunshu0909/yunshu_skillshub/memory-init"><img src="https://agentmods.dev/badge/skills/yunshu0909/yunshu_skillshub/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.

agentmods 80×15 button for memory-init

Your own site · 80×15
<a href="https://agentmods.dev/skills/yunshu0909/yunshu_skillshub/memory-init"><img src="https://agentmods.dev/badge/skills/yunshu0909/yunshu_skillshub/memory-init.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,758 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00064 $0.01758
Opus 5 $0.00032 $0.00879
Sonnet 5 $0.00013 $0.00352
Haiku 4.5 $0.00006 $0.00176

Measured 11d ago against content hash 9a4f67c02075, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, 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 11d 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.

memory-init/SKILL.md · 182 lines

How it starts

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

记忆系统初始化

功能说明

在当前工作目录下一键部署记忆系统,生成三个东西:

  1. CLAUDE.md — 人设 + 对话规则 + 记忆协议
  2. MEMORY.md — 长期记忆文件(初始为空模板)
  3. memory/ — 每日记忆目录
  • /memory-init → 交互式初始化,逐步收集信息后生成

工作流程

第0步:检查现有文件

先检查当前目录下是否已存在 CLAUDE.md、AGENT.md、MEMORY.md 或 memory/ 目录。

  • 如果都不存在 → 正常初始化
  • 如果部分存在 → 告诉用户哪些已存在,问是要覆盖还是只补缺的
  • 如果都存在 → 告诉用户"已经初始化过了",问是否要重置

第1步:收集项目简介 + 人设信息

1.1 项目简介

先用 ls 和 Glob 检查当前目录是否已有实质性项目文件(代码、文档、配置文件等)。注意:.claude/.git/node_modules/ 等工具目录不算项目文件。

  • 已有实质性项目文件(如 README、package.json、源代码、文档等)→ 扫描目录结构、README、package.json、主要代码文件等,自动生成项目简介(2-3句话概括项目是什么、做什么用的),展示给用户确认或修改
  • 空目录 / 只有工具目录 / 几乎没有内容 → 必须问用户:"这个项目是做什么的?简单描述一下",然后停下来等用户回答,不要继续往下走。拿到用户的回答后,再进入 1.2
1.2 人设信息

问用户以下问题:

  1. 你的角色是什么?(如:SA/售前、开发、产品、运营)
  2. 你主要用 Claude 做什么?(如:客户沟通、技术方案、日常文档、代码开发)
  3. 对话风格偏好?(如:简洁直接 / 详细展开 / 随意聊天)
  4. 有什么特别的工作习惯要我知道的?(可选,用户可以跳过)

第2步:生成 CLAUDE.md

根据收集到的信息生成 CLAUDE.md,包含以下模块:

# 项目简介

[根据扫描结果或用户描述生成,2-3句话概括项目是什么、做什么用的]

# 人设

[根据用户角色和用途生成,1-2句话]

# 对话风格

[根据用户偏好生成,3-5条规则]

# 思考方式

[根据用户角色生成,3-5条思考优先级]

# 记忆协议

## 长期记忆(MEMORY.md)
- 存放稳定的核心信息:客户画像、个人偏好、关键决策
- 每次对话自动加载,始终在上下文中
- 超过 150 行时主动提议精简

## 每日记忆(memory/YYYY-MM-DD.md)
- 存放当天对话产生的要点:结论、洞察、待办、决策
- 对话结束前问一句"这次有值得记住的吗?",确认后写入当天文件
- 需要回顾历史时,搜索 memory/ 目录检索

## 工作流
1. 对话开始 → 用 Read 工具读取本项目根目录下的 MEMORY.md,再用 Read 读取 memory/当天日期.md(如 memory/2026-03-02.md),了解今天已有的上下文
2. 涉及历史上下文 → 用 Grep 工具搜索本项目根目录下的 memory/ 目录
3. 对话结束 → 问是否要记录,确认后写入 memory/当天日期.md
4. 如果产出了值得长期记住的信息(如新客户、重要决策),同步更新 MEMORY.md
5. 注意:以上所有文件路径都是相对于本项目根目录,不是全局 ~/.claude/ 目录

## 补充规则
- 记忆以本项目根目录下的文件为准,忽略 ~/.claude/ 下的 auto-memory(内置记忆系统),不要读也不要写
- 对话开始时,除了读今天的记忆,也读昨天的(memory/昨天日期.md),保持跨天连续性
- 用户说"记住这个"、"这个记一下"时,立刻写入文件,不要只"记在心里"等结束再存
- 每日记忆积累超过 7 天时,主动提议做一次蒸馏:把仍然有价值的要点合并到 MEMORY.md,过时的标记或清理

注意:记忆协议部分是固定模板,不随用户输入变化。项目简介、人设、对话风格、思考方式根据用户输入定制。


第2.5步:询问是否生成 AGENT.md(给 Codex 用)

生成 CLAUDE.md 之后,问用户:

"你还用 Codex 吗?要不要同时生成一份 AGENT.md?内容和 CLAUDE.md 一模一样,Codex 会自动读取 AGENT.md。"

  • 用户说要 → 把 CLAUDE.md 的内容原样复制一份为 AGENT.md
  • 用户说不要 → 跳过,继续下一步

Read the full file on GitHub · 182 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. 11d ago First seen · 182 lines · 64 tokens per session scan A 9a4f67c02075

Subscribe to this mod's changes

memory-init is a skill published in the GitHub repository yunshu0909/yunshu_skillshub (755 stars, last pushed 1mo ago), licensed MIT. It adds 64 tokens to every session and 1,758 once invoked, about $0.0003 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

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

shellm

Reference for the shellm system — recursive LLM shell, identity management, memory, skills, trajectory, and all CLI tools. Use when working on shellm itself, debugging agent behavior, or understanding how the pieces fit together.

laude-institute/headlong · 49 tokens