← 返回 Skills 市场
indulgeback

Claude Code Memory Skill

作者 Liu Wenyu · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ✓ 安全检测通过
144
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install claude-code-memory-skill
功能描述
Use when you want to set up, maintain, or review a Claude Code style layered memory workflow, including `CLAUDE.md` rules, session memory, durable memory, an...
使用说明 (SKILL.md)

Overview

Use this skill when the task involves memory design or memory hygiene for Claude Code or a similar coding agent.

This skill organizes memory into three layers:

  1. Instruction memory
  2. Session memory
  3. Durable memory

The intent is to keep each layer narrow, useful, and easy to trust.

Before you start

  • Identify the host tool's instruction file. For Claude Code this is usually CLAUDE.md or CLAUDE.local.md. Other common examples are AGENTS.md and .github/copilot-instructions.md.
  • Identify or create a repo-local durable memory directory. The default layout in this skill uses .agent-memory/.
  • Identify or create the session summary file at .agent-memory/session/summary.md.

Layer 1: Instruction memory

Treat the host instruction file as the rule layer. In Claude Code, this is the CLAUDE.md layer.

Put information here only if it is:

  • stable
  • normative
  • broadly applicable across future work
  • costly for the agent to rediscover incorrectly

Good candidates:

  • test commands
  • review expectations
  • approval boundaries
  • release process rules
  • communication style preferences that consistently apply

Do not place transient task state here.

Layer 2: Session memory

Maintain .agent-memory/session/summary.md as the short-lived working notebook for the current thread.

It should answer:

  • What is actively being worked on now
  • What did the user ask for
  • Which files and functions matter
  • Which commands have already been run
  • Which errors happened and how they were resolved
  • What remains next

This layer should be updated during long tasks and before compaction or handoff.

Use this structure:

# Session Title

# Current State

# Task Specification

# Files and Functions

# Workflow

# Errors and Corrections

# Key Results

# Worklog

Keep it concise but concrete. Prefer file paths, exact commands, and specific failure modes over generic summaries.

Layer 3: Durable memory

Use .agent-memory/ for long-lived memories that should survive across conversations.

Store durable memories in topic files and keep .agent-memory/MEMORY.md as an index.

Use the following durable memory types:

user-profile

Information about the user's role, goals, background, and level of familiarity.

Examples:

  • backend-heavy engineer who wants frontend explanations grounded in systems concepts
  • founder who prefers quick trade-off summaries

working-style

Guidance about how to collaborate with this user or team.

Examples:

  • run tests before proposing a commit
  • avoid long recap paragraphs
  • prefer one bundled refactor PR in this codebase

project-context

Important project facts that are not derivable from the repo.

Examples:

  • freeze window dates
  • stakeholder constraints
  • migration rationale
  • incident aftermath that still shapes decisions

external-reference

Pointers to systems outside the repo.

Examples:

  • which dashboard matters for this codepath
  • which Linear board tracks this class of bugs
  • which Slack channel owns deployment coordination

Durable memory format

Each durable memory should live in its own file with frontmatter:

---
name: testing-policy
description: Integration tests in this repo must hit a real database
type: working-style
---

Integration tests in this repo must hit a real database.

Why:
A previous production migration failure was missed by mock-based coverage.

How to apply:
When changing data access or migrations, prefer real-db integration coverage over mocks.

The index file should stay short:

- [Testing Policy](testing-policy.md) - Real database integration tests are expected here

What not to save as durable memory

Do not save these unless there is a strong reason and the non-obvious part is the actual point:

  • file structure
  • code architecture visible in the repo
  • git history
  • recent diff summaries
  • temporary task state
  • obvious commands already documented in project instructions

If it can be recovered cheaply from the current repo, prefer not to save it as durable memory.

Recall discipline

Never trust durable memory blindly.

Before acting on it:

  • verify named files still exist
  • grep for named functions or flags
  • prefer current repo state over historical memory if they conflict
  • update or remove stale memories when you discover drift

Promotion workflow

When reviewing memory, classify each item:

  • Promote to instruction memory
  • Keep in durable memory
  • Keep only in session memory
  • Delete as stale, duplicate, or overfit

Promote into the instruction layer when the item has become a rule. Keep it in durable memory when it remains useful context but is not a rule. Keep it only in session memory when it is tied to the present thread.

Review workflow

When the user asks to review memory:

  1. Read the host instruction file such as CLAUDE.md
  2. Read .agent-memory/MEMORY.md
  3. Read the most relevant durable topic files
  4. Read .agent-memory/session/summary.md if current-thread context matters
  5. Produce a report with:
    • promotions
    • cleanup
    • conflicts
    • ambiguous items

Do not modify durable memory or instruction files without user approval unless the user explicitly asked you to apply the cleanup.

File layout used by this skill

.agent-memory/
├── MEMORY.md
├── user/
├── style/
├── project/
├── references/
└── session/
    └── summary.md

References

安全使用建议
This skill is a documentation/workflow template for organizing repo-local memory and appears coherent. Before installing or enabling it: (1) inspect any .agent-memory files in your repo for secrets or sensitive data (durable memory is stored in repo files and could contain tokens if someone put them there), (2) confirm you want the agent to read those repo files (it will read CLAUDE.md/.agent-memory to produce reports), and (3) avoid giving the agent autonomous write permission to instruction or durable memory unless you trust it and have review controls in place. Because it is instruction-only and declares no external endpoints or credentials, the main risk is accidental storage/exposure of sensitive info in the .agent-memory files — review those files before use.
能力标签
cryptocan-make-purchases
能力评估
Purpose & Capability
The name and description (Claude Code style layered memory) match the content of SKILL.md and accompanying docs. The skill is instruction-only and only needs access to repository files (instruction file and .agent-memory), which is appropriate for its stated purpose.
Instruction Scope
Runtime instructions direct the agent to read and review local files (CLAUDE.md, .agent-memory/MEMORY.md, session summary) and produce promotion/cleanup reports. The SKILL.md explicitly instructs not to modify durable/instruction files without user approval. It does not ask the agent to read unrelated system paths, environment variables, or send data to external endpoints.
Install Mechanism
No install spec or code files are executed — this is instruction-only, which is the lowest-risk install mechanism and consistent with the skill's purpose.
Credentials
The skill requires no environment variables, credentials, or external configuration paths. All declared and implicit requirements are proportional to a repo-local memory review workflow.
Persistence & Privilege
The skill is not forced-always and does not request elevated or persistent platform privileges. It can be invoked by the agent (default), which is expected for skills; the SKILL.md also restricts automatic modification of memory/instruction files without explicit user approval.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install claude-code-memory-skill
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /claude-code-memory-skill 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial release: clean-room layered memory skill for Claude Code style workflows.
元数据
Slug claude-code-memory-skill
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Claude Code Memory Skill 是什么?

Use when you want to set up, maintain, or review a Claude Code style layered memory workflow, including `CLAUDE.md` rules, session memory, durable memory, an... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 144 次。

如何安装 Claude Code Memory Skill?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install claude-code-memory-skill」即可一键安装,无需额外配置。

Claude Code Memory Skill 是免费的吗?

是的,Claude Code Memory Skill 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Claude Code Memory Skill 支持哪些平台?

Claude Code Memory Skill 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Claude Code Memory Skill?

由 Liu Wenyu(@indulgeback)开发并维护,当前版本 v0.1.0。

💬 留言讨论