memory-layer

memory-layer is a skill for Claude Code from OthmanAdi/MDDesign. It costs 56 tokens per session (1,231 once invoked), scanned A, original, Apache-2.0.

A three-level memory system for coding agents: temporary notes, project lookups, and long-term records of decisions and their reasons.

In plain words
What is it for?
Use it to save session notes, find where things are in a project, and record why technical decisions were made.
Why use it?
It keeps short-lived findings separate from information that should remain available across the project. Moving a decision into long-term memory requires a human approval step.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions subagents.

Part of the mddesign plugin — 5 skills, 10 commands, 5 agents, 4 hooks shipped together

Good fit Use it to save session notes, find where things are in a project, and record why technical decisions were made.

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

Made for: Claude Code.

Or install mddesign, the plugin that ships this one along with the rest of its 5 skills, 10 commands, 5 agents, 4 hooks.

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-layer

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/othmanadi/mddesign/memory-layer"><img src="https://agentmods.dev/badge/skills/othmanadi/mddesign/memory-layer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,231 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.
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.00056 $0.01231
Opus 5.5 $0.00022 $0.00492
Sonnet 5.5 $0.00011 $0.00246
Haiku 4.5 $0.00006 $0.00123

Measured 1mo ago against content hash d55de2146ba2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

memory-layer 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 1mo 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.

.clinerules/memory-layer/SKILL.md · 90 lines

How it starts

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

Memory Layer

Three-tier wrapper on top of code-memory-router plus a local file-tier scratchpad.

Tiers

Tier Purpose Backend Lifetime
scratch Volatile session notes, in-flight findings .agents/memory/scratch/<topic>.md (file-tier) Session, until promoted or /mddesign:handoff promote
WHERE Locational queries (where is X, which file, which directory) QMD via /memory-router Project lifetime
WHY Decisions, rationale, post-mortems, "we picked X because" MemPalace drawers via /memory-router Forever

Operations

/mddesign:memory save <text> (default tier: scratch)

  1. Determine the active topic. The active phase id from task_plan.md is the default topic. If no plan exists, use general.
  2. Append <text> plus an ISO timestamp to .agents/memory/scratch/<topic>.md. Create parent directories if needed.
  3. Print confirmation: "Saved to scratch / topic=".

/mddesign:memory save --tier why <text>

  1. Print the text to the user with a clear "About to promote to MemPalace WHY tier. Approve? [y/N]" line.
  2. The PreToolUse hook intercepts the next Bash or /memory-router invocation (named checkpoint: before_mempalace_write).
  3. On approval, invoke /memory-router with the canonical "save to MemPalace" pattern documented in code-memory-router's SKILL.md. Pass the text plus a project tag derived from CWD basename.
  4. On the same approval, append a marker to .agents/memory/scratch/<topic>.md: "PROMOTED to MemPalace at ." The original scratch entry stays in place for the rest of the session for context continuity.

/mddesign:memory recall <query>

Routing rule:

  • If the query starts with "where", "which file", "find", "locate", route to WHERE.
  • If the query starts with "why", "decision", "history", "what did we decide", route to WHY.
  • Otherwise, peek at scratch first; if nothing matches, fall back to WHERE.

Routing target:

  • WHERE → invoke /memory-router and let the router dispatch to QMD.
  • WHY → invoke /memory-router and let the router dispatch to MemPalace.
  • scratch → grep .agents/memory/scratch/**/*.md for the query.

Read the full file on GitHub · 90 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. 1mo ago First seen · 90 lines · 56 tokens per session scan A d55de2146ba2

Subscribe to this mod's changes

memory-layer is a skill published in the GitHub repository OthmanAdi/MDDesign (14 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 56 tokens to every session and 1,231 once invoked, about $0.0002 per session on Opus 5.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

mem-search

Search past coding sessions using natural language. Finds relevant observations, decisions, and context from previous work.

softspark/ai-toolkit · 23 tokens

optimize-learnings

Audit and curate the learnings memory namespace — the one namespace nothing re-derives, so the only one that rots. Runs moflo's mechanical audit to nominate stale, unused, and near-duplicate entries, then decides entry by entry whether to keep, retire, compress, or merge, and propagates the result to the shared…

eric-cielo/moflo · 116 tokens

meditate

Deliberate session retrospective — look back over what you just did, distill the durable, reusable lessons (not session trivia), and write them to the learnings memory namespace, deduped against what is already stored. Use at the END of a meaningful chunk of work to capture high-signal lessons worth keeping long-term.…

eric-cielo/moflo · 83 tokens

memory-team

Guided setup for sharing moflo's durable learnings through a git-tracked artifact — for a whole TEAM on one repo, OR for one person across several MACHINES (a team of one). Use when the user says "share learnings with my team", "commit our moflo memory", "sync memory across my laptop and desktop", "set up…

eric-cielo/moflo · 145 tokens

memory-patterns

Persistent memory patterns for moflo agents — session memory, long-term knowledge, pattern learning, and cross-session context via moflo's node:sqlite + HNSW vector store. Use when building stateful agents or assistants that need to remember across runs.

eric-cielo/moflo · 55 tokens

memory-worktree

Verify, customize, or opt out of moflo's AUTOMATIC durable-learning sharing across git worktrees / Conductor workspaces on one machine. As of the worktree-auto-sharing change this is on by default — learnings converge across a repo's worktrees with no setup. Use when the user asks "is memory shared across my…

eric-cielo/moflo · 134 tokens