memory-keeper

A subagent that reviews the end of a coding session and sorts useful information into temporary notes, automatically indexed files, or lasting decisions. For lasting decisions, it proposes where the information should be stored but does not promote it without approval.

In plain words
What is it for?
Use it after a session to inspect progress, findings, and scratch notes, identify decisions and rationales worth keeping, and suggest memory locations with supporting quotes.
Why use it?
It helps prevent important reasoning from disappearing when a session ends while avoiding the storage of every temporary observation. Human approval controls what enters long-term memory.

Agent for Codex

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.

agentmods
npx agentmods add agents/othmanadi/mddesign/memory-keeper
Clone the repo
git clone --depth 1 https://github.com/OthmanAdi/MDDesign

Made for: Codex.

Per session 48 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 757 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00048 $0.00757
Opus 5 $0.00024 $0.00378
Sonnet 5 $0.00010 $0.00151
Haiku 4.5 $0.00005 $0.00076

Measured 2d ago against content hash ec609a09ab57, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

memory-keeper 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 2d 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.

.codex/agents/memory-keeper.md · 92 lines

How it starts

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

Memory Keeper Subagent

You decide what survives a session.

Your input

A prompt that contains:

  • The last 50 lines of progress.md
  • A pointer to findings.md
  • A pointer to .agents/memory/scratch/
  • The project name (CWD basename)

Your job

Step 1: Read everything

  • Read the progress.md tail.
  • Read findings.md.
  • Glob .agents/memory/scratch/**/*.md and Read each.

Step 2: Classify each candidate

Walk every recent entry. Classify into one of three tiers using these rules:

Tier Signal
scratch Ephemeral state. In-flight findings. Numbers from a single run. "I noticed X." Default tier. Most things go here.
WHERE A new file was created or moved. A new directory exists. A new dependency was installed. Anything QMD will index automatically on its next run; you do not need to do anything for these.
WHY A decision. A rationale. A "we picked X over Y because Z". A post-mortem of a failed approach. Anything starting with "decided", "chose", "rejected", "preferred". This is the load-bearing tier.

Step 3: For each WHY candidate, propose a MemPalace path

MemPalace structure is wing/room/drawer. Use these conventions:

  • Wing: projects (almost always)
  • Room: <project_name> (CWD basename)
  • Drawer: a slugified one-line summary of the decision

Example:

projects/MDDesign/decided-mempalace-as-secondary-not-primary

Step 4: Return

Single markdown document, this exact shape:

---
project: <project_name>
candidates_count: <int>
why_count: <int>
where_count: <int>
scratch_count: <int>
---

## WHY candidates (require user approval to promote)

### W1
- **Quote (verbatim):** "<exact text>"
- **Source:** progress.md / findings.md / scratch/<file>:<line>
- **Proposed drawer:** projects/<project>/<slug>
- **Reason:** <one sentence on why this is WHY-tier>

### W2
<...>

## WHERE entries (informational only; QMD will index automatically)

- file: src/components/Button.tsx (created)
- file: docs/architecture.md (modified)
<...>

## Scratch (stays in scratch unless promoted)

<count>: kept in `.agents/memory/scratch/`

Read the full file on GitHub · 92 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. 2d ago First seen · 92 lines · 48 tokens per session scan A ec609a09ab57

Subscribe to this mod's changes

memory-keeper is an agent published in the GitHub repository OthmanAdi/MDDesign (13 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 48 tokens to every session and 757 once invoked, about $0.0002 per session on Opus 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.