From 762310880cd89a1abfe8964d102328a3d8dad9d5 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Wed, 25 Mar 2026 22:21:14 +0700 Subject: [PATCH] chore: Add Claude Code memory system files Co-Authored-By: Claude Opus 4.6 --- .claude/memory/memory/MEMORY.md | 3 ++ .claude/memory/memory/memory_saving_rules.md | 42 ++++++++++++++++++++ .claude/settings.json | 7 ++++ 3 files changed, 52 insertions(+) create mode 100644 .claude/memory/memory/MEMORY.md create mode 100644 .claude/memory/memory/memory_saving_rules.md create mode 100644 .claude/settings.json diff --git a/.claude/memory/memory/MEMORY.md b/.claude/memory/memory/MEMORY.md new file mode 100644 index 0000000..93558af --- /dev/null +++ b/.claude/memory/memory/MEMORY.md @@ -0,0 +1,3 @@ +# Project Memory Index + +- [Memory Saving Rules](memory_saving_rules.md) — How to save memories in this project diff --git a/.claude/memory/memory/memory_saving_rules.md b/.claude/memory/memory/memory_saving_rules.md new file mode 100644 index 0000000..6c4b069 --- /dev/null +++ b/.claude/memory/memory/memory_saving_rules.md @@ -0,0 +1,42 @@ +--- +name: Memory Saving Rules +description: Rules for saving and managing memories in this project +type: feedback +--- + +## How to Save Memories + +Saving a memory is a two-step process: + +**Step 1** — Write the memory to its own file (e.g., `user_role.md`, `feedback_testing.md`) using this frontmatter format: + +```markdown +--- +name: {{memory name}} +description: {{one-line description — used to decide relevance in future conversations}} +type: {{user, feedback, project, reference}} +--- + +{{memory content — for feedback/project types, structure as: rule/fact, then **Why:** and **How to apply:** lines}} +``` + +**Step 2** — Add a pointer to that file in `MEMORY.md`. `MEMORY.md` is an index — each entry should be one line, under ~150 characters: `- [Title](file.md) — one-line hook`. + +## Memory Types + +- **user**: Information about user's role, goals, preferences, and knowledge +- **feedback**: Guidance on how to approach work — what to avoid and what to keep doing +- **project**: Information about ongoing work, goals, initiatives, bugs, or incidents +- **reference**: Pointers to where information can be found in external systems + +## What NOT to Save + +- Code patterns, conventions, architecture (read from code instead) +- Git history (use `git log` / `git blame`) +- Debugging solutions (the fix is in the code) +- Anything already documented in CLAUDE.md files +- Ephemeral task details + +**Why:** Memories should capture unique context not derivable from other sources. + +**How to apply:** Before saving, ask: "Is this information available elsewhere?" If yes, don't save as memory. diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..b3e656c --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,7 @@ +{ + "permissions": { + "allow": [ + "Write(*.md)" + ] + } +}