Agent skill

Memory

by 312362115 in 312362115/claude

记忆管理:手动触发的全局/项目级记忆写入、查看、清理、迁移. An agent skill from 312362115/claude.

MITAuto-check passed

Install Memory

skills CLI
$ npx skills add 312362115/claude --skill memory -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install 312362115/claude memory --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/312362115/claude.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/memory .claude/skills/memory && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
memory
GitHub stars
107
Token cost
~792 tokens
SKILL.md length
118 words
Files
1
Skills in repo
20
Repo updated
First seen
Licence
MIT

At a glance

记忆管理:手动触发的全局/项目级记忆写入、查看、清理、迁移. An agent skill from 312362115/claude.

  • Works in 3 steps: 下次对话还需要吗? → 不需要就不写 → 能从代码/git/docs 推导出来吗? → 能推导就不写 → 是否跨项目通用? → 通用放全局,特定放项目
  • SKILL.md covers Slash 命令, 记忆体系, 操作 1:写入记忆(save) and 操作 2:查看记忆(list), plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Memory is an agent skill from 312362115/claude. 记忆管理:手动触发的全局/项目级记忆写入、查看、清理、迁移。 管理 ~/.claude/memory/(全局)和项目级 memory 目录。 触发词:/memory、记住、忘掉、清理记忆、记忆管理、看看记忆。 触发场景:用户想保存跨项目经验、清理过期记忆、查看当前记忆状态。

Its SKILL.md is about 790 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The licence is MIT.

Example prompts

  • “/memory”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. 下次对话还需要吗? → 不需要就不写
  2. 能从代码/git/docs 推导出来吗? → 能推导就不写
  3. 是否跨项目通用? → 通用放全局,特定放项目

What it can do on your machine

Read from SKILL.md and the folder at commit 2d4fa49. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Memory loads about 792 tokens when it runs. Until then it costs about 36 tokens; SKILL.md has 118 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~36
When it runs · the whole SKILL.md, loaded when a task matches
~792

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from 312362115/claude at commit 2d4fa49, republished under its MIT licence (© 312362115). 118 words, ~792 tokens.

Download SKILL.mdSave it as .claude/skills/memory/SKILL.md (or your agent's skills folder).
name
memory
description
记忆管理:手动触发的全局/项目级记忆写入、查看、清理、迁移。 管理 ~/.claude/memory/(全局)和项目级 memory 目录。 触发词:/memory、记住、忘掉、清理记忆、记忆管理、看看记忆。 触发场景:用户想保存跨项目经验、清理过期记忆、查看当前记忆状态。
version
1.0.0
last_updated
2026-04-09
repository
https://github.com/312362115/claude

记忆管理(Memory)

记忆是跨会话的备忘录。全局记忆跨项目,项目记忆跟项目走。

Slash 命令

命令作用
/memory list查看全局 + 项目级所有记忆
/memory save <内容>保存一条记忆(自动判断层级和类型)
/memory clean批量检查过期/重复记忆,给出清理建议
/memory forget <关键词>删除指定记忆
/memory move <关键词> --to global项目记忆迁移到全局
/memory move <关键词> --to project全局记忆迁移到项目

也可以用自然语言触发:"记住 xxx"、"看看记忆"、"忘掉 xxx"、"清理记忆"。


记忆体系

~/.claude/
├── memory/                              ← 全局记忆(所有项目可见)
│   ├── MEMORY.md                            索引文件
│   └── *.md                                 记忆文件
└── projects/<path>/memory/              ← 项目记忆(仅当前项目可见)
    ├── MEMORY.md                            索引文件
    └── *.md                                 记忆文件
层级存什么示例
全局跨项目通用的个人偏好、工作习惯、通用经验"我喜欢简洁的提交信息"、"大表加索引用 CONCURRENTLY"
项目项目特定的决策、约束、坑"这个项目用 SQLite 不支持 ALTER COLUMN"

操作 1:写入记忆(save)

用户说"记住xxx"、"保存到记忆"、"这个经验记下来"时触发。

执行流程
用户要求保存
  │
  ├─ 判断层级
  │   ├─ 跨项目通用?→ 全局(~/.claude/memory/)
  │   └─ 项目特定?→ 项目级
  │   └─ 不确定?→ 问用户
  │
  ├─ 判断类型
  │   ├─ 用户偏好/角色信息 → user 类型
  │   ├─ 做法纠正/做法确认 → feedback 类型
  │   ├─ 项目阶段性目标/约束 → project 类型
  │   └─ 外部资源位置 → reference 类型
  │
  ├─ 检查去重
  │   └─ 读 MEMORY.md 索引,确认没有重复或矛盾的条目
  │
  ├─ 写入
  │   ├─ 创建记忆文件(带 frontmatter)
  │   └─ 更新 MEMORY.md 索引
  │
  └─ 确认:"已保存到 [全局/项目] 记忆:[一句话描述]"
写入判断三连问

写之前过一遍:

  1. 下次对话还需要吗? → 不需要就不写
  2. 能从代码/git/docs 推导出来吗? → 能推导就不写
  3. 是否跨项目通用? → 通用放全局,特定放项目
不写的
  • 代码结构、文件路径、函数签名(从代码看)
  • Bug 修复方案(从 git 看)
  • 已经写在 CLAUDE.md 或 docs/ 里的(已有持久化)

操作 2:查看记忆(list)

用户说"看看记忆"、"当前有哪些记忆"、"memory list"时触发。

执行流程
1. 读取全局 MEMORY.md(如存在)
2. 读取项目级 MEMORY.md(如存在)
3. 汇总输出,按类型分组

输出格式:
## 全局记忆(X 条)
### Feedback
- [标题](文件) — 描述

### User
- [标题](文件) — 描述

## 项目记忆(X 条)
### Feedback
- [标题](文件) — 描述

合计:全局 X 条 + 项目 X 条

操作 3:清理记忆(clean)

用户说"清理记忆"、"忘掉xxx"、"记忆过期了"时触发。

单条删除

用户指定要忘掉的内容:

  1. 在 MEMORY.md 中找到对应条目
  2. 删除记忆文件
  3. 从 MEMORY.md 移除索引行
  4. 确认:"已删除 [全局/项目] 记忆:[标题]"
批量清理

用户说"清理一下记忆"、"检查过期记忆"时:

1. 读取所有记忆文件
2. 逐条检查:
   │
   ├─ project 类型超过 1 个月?→ 标记待确认
   ├─ feedback 引用的代码/模块还存在吗?→ 不存在则标记
   ├─ 内容已写入 CLAUDE.md 或 docs/?→ 标记可删除
   ├─ 两条内容重复或矛盾?→ 标记合并
   └─ reference 引用的资源还有效吗?→ 无法验证则标记

3. 输出清理建议(不自动删,让用户确认):

## 记忆清理建议

### 建议删除(X 条)
- [标题] — 原因:内容已沉淀到 CLAUDE.md
- [标题] — 原因:引用的模块 src/old/ 已删除

### 建议合并(X 组)
- [标题A] + [标题B] — 内容重叠

### 建议保留(X 条)
- [标题] — 仍然有效

4. 用户确认后批量执行

操作 4:迁移记忆(move)

在项目记忆和全局记忆之间迁移。

用户说"这条移到全局"、"这个经验其他项目也能用"时触发。

1. 复制记忆文件到目标层级的 memory 目录
2. 更新目标层级的 MEMORY.md
3. 删除源层级的记忆文件和索引条目
4. 确认:"已将 [标题] 从 [项目/全局] 迁移到 [全局/项目]"

与其他 skill 的关系

task-manager 标 done → 自动写入项目记忆(Step 5,按写入规则判断)
docs-management Lint → 顺带检查记忆健康
memory-manage(本 skill)→ 用户手动触发写入/查看/清理/迁移
  • 自动写入由 task-manager 负责(复盘时提取经验)
  • 手动管理由本 skill 负责(用户主动触发)
  • 两者互补:自动写入保证不遗漏,手动管理保证不腐烂

© 312362115, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/memory of 312362115/claude.

Open the folder on GitHubat commit 2d4fa49

More from 312362115/claude

All 20 skills in this repo
  • Diagram

    312362115/claude

    专业图表生成技能:根据需求自动选择合适的图表类型,生成符合设计规范的 PNG 图表. An agent skill from 312362115/claude.

    107 GitHub stars~2.7k tokensUpdated 4 mo ago
    Auto-check passed
  • Deep Research

    312362115/claude

    深度调研技能:对任意命题进行系统性调研并输出专业研究报告. An agent skill from 312362115/claude.

    107 GitHub stars~6.6k tokensUpdated 4 mo ago
    Auto-check passed
  • Preview Md

    312362115/claude

    MD 文件浏览器预览:GitHub 风格渲染 + 左侧自动目录. An agent skill from 312362115/claude.

    107 GitHub stars~636 tokensUpdated 4 mo ago
    Auto-check passed
  • Writing

    312362115/claude

    通用写作技能:以"内容→组件→组合"的方式产出技术文档、产品文档、汇报材料. An agent skill from 312362115/claude.

    107 GitHub stars~1.6k tokensUpdated 4 mo ago
    Auto-check passed
  • Code Walkthrough

    312362115/claude

    代码导读技能:帮助快速理解不熟悉的项目或模块,建立心智模型. An agent skill from 312362115/claude.

    107 GitHub stars~1k tokensUpdated 4 mo ago
    Auto-check: notes
  • DB Review

    312362115/claude

    数据库代码审查 + Migration 安全检查. An agent skill from 312362115/claude.

    107 GitHub stars~1.8k tokensUpdated 4 mo ago
    Auto-check passed

Questions about Memory

What does Memory do?

记忆管理:手动触发的全局/项目级记忆写入、查看、清理、迁移. An agent skill from 312362115/claude. Memory is an agent skill from 312362115/claude.

How do I install Memory in Claude Code?

Run `npx skills add 312362115/claude --skill memory -a claude-code`. Or copy the skill folder (skills/memory in 312362115/claude) into .claude/skills/memory in your project. Claude Code loads it when a task matches its description.

How do I install Memory in Codex?

Run `npx skills add 312362115/claude --skill memory -a codex`. Or copy the skill folder (skills/memory in 312362115/claude) into .agents/skills/memory in your project. Codex loads it when a task matches its description.

Can I use Memory in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add 312362115/claude --skill memory -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/memory, .gemini/skills/memory, .github/skills/memory and .opencode/skills/memory in your project.

What does Memory need to run?

SKILL.md names no scripts, command-line tools or credentials: Memory is instructions for the agent only.

Does Memory access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Memory safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Memory use?

Memory is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Memory use?

About 792 tokens (SKILL.md is roughly 3.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

Who maintains Memory?

312362115 (a GitHub user) maintains it in 312362115/claude, which has 107 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on May 14, 2026.

Source: 312362115/claude on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.