Token导航 LogoToken导航

Agent Skill · 研究检索

memory-bank(记忆库)

memory-bank 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

memory-bank 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 38,990。

总安装 1,482周安装 63GitHub Stars 38下载 519核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:memory-bank(记忆库)
来源仓库:https://github.com/nagendhra-web/memory-bank
仓库路径:skills/memory-bank
安装命令:
npx skills add https://github.com/nagendhra-web/memory-bank --skill memory-bank
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/nagendhra-web/memory-bank --skill memory-bank

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

memory-bank 用于查找、检索和筛选相关信息。适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词快速定位候选结果。可通过来源仓库和原始 README 进一步核验具体用法。安装方式:通过 npx skills add 命令从指定 GitHub 仓库安装。

注意:安装前建议确认权限范围和维护状态,避免触发不必要的联网或文件操作。

来源仓库内路径:skills/memory-bank

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/nagendhra-web/memory-bank --skill memory-bank;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

memory-bank 怎么安装?

在终端执行 npx skills add https://github.com/nagendhra-web/memory-bank --skill memory-bank。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

memory-bank 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

memory-bank 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

memory-bank 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

memory-bank 用的人多吗?

公开数据是累计安装 1,482 次,近一周安装 63 次,下载 519 次,GitHub 38 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

memory-bank 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
memory-bank

记忆库 · 本页

1,48238需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Memory Bank

An adaptive memory system that gives Claude Code persistent, intelligent context across sessions — while cutting token waste so your sessions last 3-5x longer. Not a flat file — a layered architecture that compresses, branches, diffs, self-heals, and loads only what matters.


Core Architecture

Memory Bank operates on three layers:

┌─────────────────────────────────────────────┐
│  Layer 2: GLOBAL MEMORY                     │
│  ~/.claude/GLOBAL-MEMORY.md                 │
│  Cross-project patterns, user preferences,  │
│  reusable decisions. Permanent.             │
├─────────────────────────────────────────────┤
│  Layer 1: PROJECT MEMORY                    │
│  ./MEMORY.md (+ branch overlays)            │
│  Architecture, decisions, active work.      │
│  Lives as long as the project.              │
├─────────────────────────────────────────────┤
│  Layer 0: SESSION CONTEXT                   │
│  In-conversation only.                      │
│  Current task focus, scratch notes.         │
│  Dies when session ends (persisted to L1).  │
└─────────────────────────────────────────────┘

Layer 0 (Session) — Ephemeral. Tracks what you're doing right now. Automatically flushed to Layer 1 at session end.

Layer 1 (Project) — The primary memory file. Tracks project state, decisions, active work, blockers. Branch-aware: each git branch can have its own overlay that merges with the base memory.

Layer 2 (Global) — Cross-project knowledge. Your coding preferences, tool choices, patterns you always use. Lives in ~/.claude/GLOBAL-MEMORY.md. Loaded alongside Layer 1 at session start.

See references/memory-layers.md for full architecture details.

When to Activate

TriggerAction
Session starts, MEMORY.md existsFull load sequence
"remember this", "don't forget"Mid-session update
"wrap up", "save progress", "done for now"Full session write
"pick up where we left off", "what were we doing"Load + summarize
"switch to [branch]", "context for [feature]"Branch-aware load
"memory health", "is memory stale"Health check
"hand off", "onboard someone"Generate handoff doc
"compress memory", "clean up memory"Run compression
"rebuild memory"Recovery mode
"save state", "continue this later"Session continuation protocol
"context budget", "how much context left"Context budget check
"running out of context", "session is long"Emergency save + continuation file

Workflow

1. Session Start — The Load Sequence

Execute this sequence before doing anything else:

Step 1: Detect memory files
  └─ Check for MEMORY.md in project root
  └─ Check for ~/.claude/GLOBAL-MEMORY.md
  └─ Check for MEMORY-ARCHIVE.md (has history been archived?)

Step 2: Detect git context
  └─ Current branch name
  └─ Check for .memory/branches/<branch>.md overlay
  └─ Days since last session (from "Last updated" field)

Step 3: Session diff (if git available)
  └─ Commits since last memory update
  └─ Files changed since last session
  └─ Any conflicts between memory and current code state

Step 4: Health check
  └─ Score memory freshness (see Health Scoring below)
  └─ Flag stale entries
  └─ Flag referenced files that no longer exist

Step 5: Context-aware greeting
  └─ Summarize where we left off (2-3 sentences, specific)
  └─ Report any drift detected (code changed, memory stale)
  └─ State the next immediate action
  └─ Ask: "Ready to continue, or has the plan changed?"

Example greeting (fresh memory, same branch):

"Welcome back! Last session you finished the Stripe webhook handler in src/api/webhooks/stripe.ts and were about to write integration tests. The handlePaymentSuccess() function is complete but handleRefund() is stubbed out. 3 commits have landed since — all yours, no surprises. Ready to pick up with the integration tests?"

Example greeting (stale memory, branch switched):

"Welcome back! Your memory is from 5 days ago on main, but you're now on feature/user-profiles. I found a branch overlay from 3 days ago with context about the profile avatar upload. However, src/components/Avatar.tsx referenced in memory was renamed to ProfileImage.tsx. Want me to update memory with the current state before we continue?"

If no MEMORY.md exists:

  • Proceed normally
  • After first meaningful work, offer: "Want me to start tracking our progress? I'll create a memory file so next session picks up instantly."

2. Mid-Session Updates

When the user says "remember this" or you complete a significant milestone:

  1. Read current MEMORY.md
  2. Determine what changed:

- New decision made? → Update Key Decisions - Task completed? → Move from Active Work to Completed, update Where We Left Off - New blocker? → Add to Blockers - Important context? → Add to Notes

  1. Write the updated file
  2. Confirm with specifics: "Saved — added the Zod migration decision and marked the user model as complete."

Do NOT rewrite the entire file on mid-session updates. Only modify the sections that changed. This preserves context from session start.


3. Session End — The Write Sequence

When wrapping up, execute a full memory write:

Step 1: Audit the session
  └─ What was accomplished? (be specific: files, functions, lines)
  └─ What decisions were made and why?
  └─ What's blocked or unresolved?
  └─ What should happen next? (crystal clear next step)

Step 2: Compress completed work
  └─ Move finished items to Completed with one-line summaries
  └─ Remove resolved blockers
  └─ Archive stale notes

Step 3: Update memory health metadata
  └─ Update "Last updated" timestamp
  └─ Increment session counter
  └─ Update file reference table (verify paths still exist)

Step 4: Write MEMORY.md
  └─ Full overwrite with current state
  └─ Verify the file was written successfully

Step 5: Check compression threshold
  └─ If > 150 lines, suggest compression
  └─ If > 200 lines, auto-compress (see Smart Compression)

Step 6: Prompt for global memory
  └─ Any cross-project learnings worth saving to Layer 2?
  └─ New user preferences discovered?

MEMORY.md Template

# Project Memory
Last updated: [DATE] | Session [N] | Branch: [BRANCH]
Memory health: [SCORE]/10

## Project Overview
[1-2 sentences. What this is, what stack, what stage.]

## Where We Left Off
- **Current task:** [specific task with file/function reference]
- **Status:** [done | in progress | blocked]
- **Next immediate step:** [so clear Claude can start without asking anything]
- **Open question:** [decision pending, if any]

## Completed
- [DATE] [one-line summary with key files touched]
- [DATE] [one-line summary]

## Active Work
- [ ] [task — specific file, function, or component]
- [ ] [task]
- [x] [recently completed, will archive on next compression]

## Blockers
- [blocker with context on what's needed to unblock]

## Key Decisions
| Date | Decision | Reasoning | Affects |
|------|----------|-----------|---------|
| [DATE] | [what was decided] | [why] | [files/areas impacted] |

## Key Files
| File | Purpose | Last Modified |
|------|---------|---------------|
| [path] | [what it does] | [session N] |

## Architecture Notes
[Non-obvious design choices, data flow, system boundaries]

## Known Issues
- [issue, severity, and workaround if any]

## Session Log
| Session | Date | Summary |
|---------|------|---------|
| [N] | [DATE] | [one-line summary of what happened] |

## User Preferences
[How the user likes to work — discovered across sessions]

## External Context
[APIs, services, env setup — NO secrets, NO credentials, NEVER]

Branch-Aware Memory

When working across multiple git branches, memory adapts:

MEMORY.md                          <- Base project memory (main/trunk)
.memory/
  branches/
    feature-auth.md                <- Overlay for feature/auth branch
    feature-payments.md            <- Overlay for feature/payments branch
    bugfix-race-condition.md       <- Overlay for bugfix branch

How it works:

  1. At session start, detect current git branch
  2. Load base MEMORY.md first
  3. Check .memory/branches/<branch-slug>.md for an overlay
  4. Merge overlay on top of base (overlay sections take priority)
  5. At session end, write changes back to the correct layer:

- Architecture decisions → base MEMORY.md (shared across branches) - Branch-specific work → .memory/branches/<branch>.md

On branch merge:

  • When a feature branch merges to main, prompt: "The feature/auth branch just merged. Want me to fold its memory overlay into the base MEMORY.md and clean up the branch file?"
See references/branch-aware-memory.md for merge strategies.

Smart Compression

Memory files grow. Smart Compression keeps them useful:

Auto-compress triggers:

  • MEMORY.md exceeds 150 lines → suggest compression
  • MEMORY.md exceeds 200 lines → auto-compress
  • Entries older than 5 sessions → candidates for archival

Compression rules:

  1. Completed tasks older than 3 sessions → collapse to one-liner in Session Log
  2. Resolved blockers → remove entirely
  3. Stale "Active Work" items (no progress in 3+ sessions) → flag for user
  4. Decision Log entries → NEVER compress (permanent record)
  5. Architecture Notes → NEVER compress (permanent record)

Archival: When session count exceeds 10, create MEMORY-ARCHIVE.md:

# Memory Archive
Archived sessions from Project Memory.

## Sessions 1-8 Summary
[Paragraph summary of early project work]

## Key Milestones
- Session 2: Initial project scaffolding complete
- Session 5: Auth system shipped
- Session 8: Database migration to Prisma complete
See references/smart-compression.md for the full compression algorithm.

Session Diffing

At session start, detect what changed since memory was last written:

# Get the date from MEMORY.md "Last updated" field
# Then check what happened since

git log --oneline --since="[last-updated-date]"
git diff --stat HEAD~[commits-since]

Report format:

"Since your last session (3 days ago), there have been 7 commits: 4 by you, 3 by @teammate. Key changes: src/api/users.ts was refactored, package.json has 2 new dependencies (zod, @tanstack/query). Your memory references src/api/users.ts — I'll verify it's still accurate."

Conflict detection: When session diff reveals changes that contradict memory:

  • Memory says "using Express" but package.json now has Fastify → flag
  • Memory references src/auth/login.ts but file was deleted → flag
  • Memory says "blocked on API key" but .env now has it → update
See references/session-diffing.md for conflict resolution strategies.

Memory Health Scoring

Rate memory on a 1-10 scale across four dimensions:

DimensionWeightScore 10Score 1
Freshness30%Updated today> 14 days old
Relevance30%All referenced files existMost files missing/renamed
Completeness20%All sections filled, next step clearMissing key sections
Actionability20%Can start working immediatelyNeed to ask 3+ questions

Display at session start:

Memory health: 8/10
  Freshness:    9/10 (updated yesterday)
  Relevance:    7/10 (2 file paths changed)
  Completeness: 8/10 (all sections present)
  Actionability: 9/10 (next step is crystal clear)

If health < 5: Trigger recovery mode or suggest a memory rebuild.


Recovery Mode

When memory is severely stale, corrupted, or missing critical context:

Step 1: Scan the project
  └─ Read package.json / pyproject.toml / go.mod (detect stack)
  └─ Read README.md and CLAUDE.md (project context)
  └─ List key directories and recent files

Step 2: Read git history
  └─ Last 20 commits (who, what, when)
  └─ Current branch and recent branches
  └─ Any open/recent PRs

Step 3: Reconstruct memory
  └─ Build Project Overview from package.json + README
  └─ Build Key Files from most-modified files in git log
  └─ Build Key Decisions from commit messages and code patterns
  └─ Set "Where We Left Off" from most recent commits
  └─ Flag confidence level: "Reconstructed from code — verify with user"

Step 4: Present and confirm
  └─ Show reconstructed memory to user
  └─ Ask for corrections
  └─ Write verified MEMORY.md

Handoff Protocol

Generate a developer handoff document that's optimized for humans (not Claude):

# Project Handoff: [Project Name]
Generated: [DATE] | By: [user] via Claude Code

## Quick Start
1. Clone: `git clone [repo]`
2. Install: `[package manager] install`
3. Setup: [env vars, database, etc.]
4. Run: `[dev command]`

## Current State
[Where the project is right now — what works, what doesn't]

## Architecture
[System diagram, key components, data flow]

## Active Work
[What's in progress, what's next, what's blocked]

## Key Decisions & Why
[Decisions that a new developer would question — with the reasoning]

## Gotchas
[Things that will bite you if you don't know about them]

## Who to Ask
[People, channels, or docs for domain-specific questions]

Trigger with: "generate a handoff", "onboard someone to this project", "write a handoff doc"


Context Efficiency Engine

The #1 complaint with Claude Code: sessions hit context limits too fast. You spend half your tokens re-explaining context, and the other half doing actual work. Memory Bank flips this ratio.

The Token Problem (Verified with tiktoken)

Without memory-bank, every session start costs ~1,200 tokens:

Conversation overhead (4 exchanges):      ~566 tokens
  User re-explains project, stack, status
  Claude asks clarifying questions
  User answers follow-ups
  Back-and-forth until Claude understands

File reads (Claude reads 3+ files to orient): ~634 tokens
  Webhook handler:    ~344 tokens
  Checkout route:     ~257 tokens
  Stripe client:      ~33 tokens

TOTAL per session: ~1,200 tokens
TOTAL over 10 sessions: ~12,000 tokens wasted

The Token Solution (Verified)

With memory-bank, the same session start costs ~400 tokens:

MEMORY.md loads (compact format):  ~334 tokens
  Entire project context in one structured file
  Decisions, files, status, blockers, architecture

Claude greeting + user confirms:   ~60 tokens
  Claude already knows everything, no questions needed

File reads needed:                 0 tokens
  Memory has file purposes, no need to read source

TOTAL per session: ~394 tokens (67% reduction)
TOTAL over 10 sessions: ~3,940 tokens (saved ~8,060)

These numbers were measured using tiktoken on our example files. Actual savings depend on project complexity (larger projects save more).

Progressive Loading

Don't dump everything into context. Load in tiers:

Tier 1: ALWAYS load (costs ~200 tokens)
  └─ Project Overview (1-2 sentences)
  └─ Where We Left Off (current task, status, next step)
  └─ Active Blockers

Tier 2: Load on DEMAND (costs ~300 tokens when needed)
  └─ Key Decisions (only when a decision comes up)
  └─ Key Files (only when working with files not in Tier 1)
  └─ Architecture Notes (only when touching architecture)

Tier 3: Load ONLY when asked (costs ~200 tokens when needed)
  └─ Session Log (only for velocity/history questions)
  └─ User Preferences (only on first session or when relevant)
  └─ External Context (only when working with APIs/services)

Result: Instead of loading 800 tokens of memory at once, load 200 tokens immediately and the rest only when actually needed. Most sessions never need Tier 3 at all.

Compact Encoding Rules

Every line in MEMORY.md is optimized for maximum information per token:

Use structured shorthand, not prose:

BAD (38 tokens):
  "We made the decision to use Prisma as our ORM instead of Drizzle
   because it provides better TypeScript type inference and the team
   is already familiar with it from previous projects."

GOOD (14 tokens):
  | 2025-04-01 | Prisma over Drizzle | Type inference, team familiarity | All DB |

Use tables for structured data (they compress well):

BAD (scattered prose — 120 tokens for 5 files):
  The main checkout route is in src/app/api/checkout/route.ts. The Stripe
  client is configured in src/lib/stripe.ts. Cart state management is in...

GOOD (table — 60 tokens for 5 files):
  | File | Purpose |
  | src/app/api/checkout/route.ts | Stripe session creation |
  | src/lib/stripe.ts | Stripe client singleton |
  | src/stores/cart.ts | Zustand cart + persistence |

Use checklists for active work (scannable, dense):

BAD (prose):
  We are currently working on the webhook handler, which is partially
  complete. We also need to write tests and haven't started yet.

GOOD (checklist):
  - [x] Stripe webhook handler — handlePaymentSuccess()
  - [ ] handleRefund() — stubbed, needs implementation
  - [ ] Integration tests for webhook endpoints

One line, one fact. No filler words:

BAD: "The project is essentially a web application that was built for..."
GOOD: "Bakery e-commerce. Next.js 14, Prisma, Stripe. Launching April."

Context Budget Tracking

Monitor token usage and warn before hitting limits:

At session start, estimate the context budget:

Available context:   ~200,000 tokens (Claude's window)
Memory load:         ~800 tokens (Tier 1 + loaded Tiers)
System prompt:       ~2,000 tokens
Remaining for work:  ~197,200 tokens

At 40% usage (~80,000 tokens consumed):
  → Suggest: "We're at 40% context. Consider compacting soon."

At 60% usage (~120,000 tokens consumed):
  → Save a session checkpoint automatically
  → Suggest: "Context at 60%. Good time to /compact or start fresh."

At 80% usage (~160,000 tokens consumed):
  → Auto-save full state to MEMORY.md
  → Alert: "Context is at 80%. Saving state now — you can continue
     in a new session with zero loss. Say 'wrap up' or keep going."

Session Continuation Protocol

When a session hits context limits or user wants to start fresh:

Step 1: EMERGENCY SAVE (before context dies)
  └─ Write MEMORY.md with EVERYTHING from current session
  └─ Include exact cursor position: file, function, line number
  └─ Include any uncommitted mental model (what Claude was thinking)
  └─ Include partial work state: what's done, what's half-done, what's next

Step 2: Write CONTINUATION.md (a one-shot warm-up file)
  └─ Ultra-compact: under 50 lines, under 500 tokens
  └─ Contains ONLY what the next session needs to start immediately
  └─ Format:

# Continue: [task name] Resume from: src/auth/refresh.ts:47 — writing rotateToken()

## State - handlePaymentSuccess(): DONE ✓ - handleRefund(): stubbed at line 89, needs Stripe refund.created event - Tests: NOT STARTED

## Context - Stripe webhook sig verified in middleware (line 12) - Using stripe.webhooks.constructEvent() not manual HMAC - Refund handler follows same pattern as payment handler

## Immediate Next Action Implement handleRefund() in src/api/webhooks/stripe/route.ts:89 using the stripe.refund.created event payload. Pattern: extract refund.payment_intent → find order → update status to "refunded"


Step 3: GREET AND GO (next session) └─ Read CONTINUATION.md first (it's the fast-path) └─ Read MEMORY.md for full context only if needed └─ Delete CONTINUATION.md after loading └─ Start working immediately — no questions, no warm-up

Trigger phrases: "save state", "I'm running out of context", "continue this later", "session is getting long"

Token Savings By Feature (Verified)

FeatureHow It SavesMeasured Impact
Structured memory vs re-explainingCompact file replaces 4+ conversation exchanges~566 tokens/session
Eliminating orientation file readsClaude doesn't need to read source files to understand project~634 tokens/session
Compact encoding (tables > prose)Same info, 39-42% fewer tokens than prose39-42% reduction in memory size
Session continuation protocolCONTINUATION.md is under 200 tokens vs full re-warm-up~1,000 tokens on session handoff
Smart compressionKeeps memory under 150 lines / ~700 tokensPrevents bloat over time

Verified totals (measured with tiktoken):

ScenarioTokensTurns
Without memory-bank~1,200/session8 turns
With memory-bank~394/session2 turns
Savings~806/session (67%)6 turns
Over 10 sessions~8,060 saved60 turns saved
Over 30 sessions~24,180 saved180 turns saved

Anti-Patterns That Waste Tokens

Never do these in memory files:


✗ Verbose prose where a table works ✗ Repeating the same information in multiple sections ✗ Storing code snippets in memory (reference file:line instead) ✗ Long descriptions of completed work (one-line summaries only) ✗ Keeping resolved blockers (delete them) ✗ Storing information that's in README.md or CLAUDE.md already ✗ Using memory for things Git tracks (commit history, diffs, blame)

Always do these:


✓ Tables for structured data (decisions, files, tasks) ✓ Checklists for active work ✓ One sentence for Project Overview (not a paragraph) ✓ File:line references instead of describing code ✓ Delete resolved items (they're in git history) ✓ Reference other files instead of duplicating content
See references/context-efficiency.md for the full token optimization guide.

Rules for Excellent Memory

Be surgical, not vague. Bad: "Working on auth" Good: "Implementing JWT refresh token rotation in src/auth/refresh.ts — rotateToken() is complete, needs Redis TTL logic in src/cache/tokens.ts:47"

The "Next immediate step" is the single most important line. It should be so precise that Claude can start coding the instant a session begins, with zero clarifying questions.

Capture the "why" behind every decision. Future Claude will encounter the same trade-offs and re-litigate them unless the reasoning is recorded.

Never store secrets. No API keys, passwords, tokens, or credentials. Ever. Not even "temporarily". Reference .env or a secrets manager instead.

Overwrite on session end, surgical update mid-session. Session end = full rewrite for consistency. Mid-session = targeted section updates to avoid losing context.

Keep it under 150 lines. Compress aggressively. Stale information is actively harmful — it misleads more than it helps.


Auto-Setup via CLAUDE.md

For fully automatic memory with all features, add to project CLAUDE.md (or ~/.claude/CLAUDE.md for all projects):

## Memory

At the start of every session:
1. Check for MEMORY.md in the project root
2. Check for ~/.claude/GLOBAL-MEMORY.md
3. Check current git branch and look for .memory/branches/<branch>.md
4. Run session diff — what changed since last memory update
5. Score memory health and flag any issues
6. Greet me with a specific summary and the next immediate step

During sessions:
- Update memory when I say "remember this" or complete a milestone
- Track key decisions with reasoning in the decision table

At session end (when I say "wrap up", "save", "done for now"):
1. Write comprehensive MEMORY.md with full current state
2. Ensure "Next immediate step" is crystal clear
3. Run compression if over 150 lines
4. Confirm what was saved
See references/claude-md-integration.md for the full integration guide.

Reference Files

  • references/memory-layers.md — Full architecture of the 3-tier memory system with promotion rules and cross-layer interactions
  • references/branch-aware-memory.md — Git branch integration, overlay merging, and cleanup strategies
  • references/smart-compression.md — Compression algorithm, archival thresholds, and what to never compress
  • references/session-diffing.md — Cross-session change detection, conflict resolution, and drift correction
  • references/advanced-patterns.md — Team workflows, velocity tracking, handoff protocol, and enterprise patterns
  • references/context-efficiency.md — Token optimization guide, progressive loading details, compact encoding reference
  • references/claude-md-integration.md — Complete setup guide for automatic triggering across all projects

Examples

  • examples/solo-fullstack.md — Memory for a solo developer on a Next.js app
  • examples/team-backend.md — Team-shared memory for a backend service
  • examples/monorepo.md — Multi-domain memory for a monorepo
  • examples/minimal.md — 5-line memory for quick prototypes

平台分布

Codex

36.66%
按下载量换算190

Claude

29.81%
按下载量换算155

Cursor

16.91%
按下载量换算88

Gemini CLI

8.72%
按下载量换算45

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills