Give your coding agents a project memory. MemoryCustodian helps agents remember what matters: decisions, constraints, rejected ideas, and project context — across sessions, agents, and teams.
> /plugin marketplace add waittim/MemoryCustodian> /plugin install memory-custodian@memory-custodian-dev
What's inside
Give your coding agents a project memory.
MemoryCustodian helps agents remember what matters: decisions, constraints, rejected ideas, and project context — across sessions, agents, and teams.
It stores memory as plain Markdown in your repo and routes a bounded context pack using manifest rules, the supplied task category, and explicit scope.
Durable memory. Minimal context.
New agent sessions often start by relearning decisions your repository already made: architecture constraints, preferred workflows, rejected approaches, and the current project shape. The usual workaround is to paste more into prompts or platform instruction files, which makes every task heavier.
MemoryCustodian moves durable project context into the repository. Humans can review it like code, and agents can load a small context pack before work:
brief.md for the current project shapedecisions.md and constraints.md when planning, implementing, or debuggingdo-not-use.md when avoiding rejected pathsrules/, profiles/, and areas/ only when the manifest says they applyThis is project memory, not chat history.
Just ask your coding agent:
Install the MemoryCustodian skill from https://github.com/waittim/MemoryCustodian, then initialize it.
Or initialize your project from the CLI:
memory-custodian init --project-root /path/to/project --agent all
Use --agent codex, --agent claude, --agent gemini, or --agent all to create the bootstrap file(s) your agent reads.
Initialization creates the core protocol files in docs/memory/:
docs/memory/
manifest.md # Routing rules and protocol metadata
subjects.md # Stable identity registry for subjects
brief.md # High-level project purpose and direction
decisions.md # Architectural and technical decisions
constraints.md # Non-negotiable technical constraints
do-not-use.md # Rejected paths, deprecated patterns, and tombstones
inbox.md # Candidate memory awaiting confirmation
Tip: Curate the initial TODOs in
brief.mdfrom authoritative project files before relying on memory;statusandcheckwill flag an uncurated brief.
| Host | Recommended Method |
|---|---|
| Codex App / CLI | Repo-local marketplace from this checkout |
| Claude Code | Personal skills directory install or --plugin-dir |
| Gemini Agents | Agent Skill installed into the personal skills directory |
| Any Shell / CI | Editable Python install (pip install -e .) or bundled wrapper |
codex plugin marketplace add .
codex plugin add memory-custodian@memory-custodian-dev
# For permanent personal skill install:
./install.sh claude
# Or for local session testing:
claude --plugin-dir .
./install.sh gemini
# Or link directly:
gemini skills link ./skills/memory-custodian
python3 -m pip install -e .
# Or use the direct script wrapper:
scripts/memory-custodian --help
MemoryCustodian turns project memory into a small, explicit workflow:
AGENTS.md, CLAUDE.md, GEMINI.md tell the agent where project memory lives.manifest.md, then brief.md, then only the task-relevant files named by the manifest.rules/, profiles/, areas/, and archive/ remain out of default context until explicitly triggered.areas/ files.inbox.md.The manifest routes a bounded context pack from explicit task and scope inputs without semantic guessing or LLM ranking.
# Read context for an implementation task with explanation
memory-custodian read --task implementation --path cli/memory_custodian/read.py --explain
# Strict routing: fails closed on INCOMPLETE, AMBIGUOUS, or INVALID scope
memory-custodian read --task implementation --strict-routing --path cli/memory_custodian/read.py
# Load specific rules and profiles, or omit local overlays
memory-custodian read --task artifact --rule output --profile docs
memory-custodian read --task implementation --no-local
Canonical tasks: general, planning, implementation, artifact, preferences, history, and maintenance.
Enable path-matched areas:
memory-custodian enable area/backend --path 'cli/**' --path 'tests/**/*.py'
Record durable memory when a decision, constraint, preference, or rejected approach should survive the current session:
# 1. Register a Subject
memory-custodian subject add "Context routing" --kind feature \
--canonical-ref feature:context-routing --evidence user-confirmed
# 2. Add an active decision or constraint (requires Subject ID and Evidence)
memory-custodian add "We chose manifest-first loading." --type decision \
--subject MC-SUBJ-... --facet architecture --evidence user-confirmed
# 3. Add area-scoped decision with rationale
memory-custodian add "Persist sync retry backoff." --type decision --area sync \
--subject MC-SUBJ-... --facet behavior \
--reason "Keep retries bounded across launches." --evidence repo:docs/architecture.md
# 4. Record an unconfirmed observation as candidate memory in inbox.md
memory-custodian add "The parser may require JSON." --type constraint \
--candidate --evidence agent-observed
# 5. Supersede an older decision
memory-custodian add "Use the new retry contract." --type decision \
--subject MC-SUBJ-... --facet interface \
--supersedes MC-DEC-20260701-a1b2c3d4 --evidence user-confirmed
Forgetting is preview-first and enforces explicit deletion scope:
# Preview soft-forgetting a topic (prints Plan ID)
memory-custodian forget "old deployment note" --mode soft
# Apply confirmed plan
memory-custodian forget "old deployment note" --mode soft --apply --confirm-plan <PLAN_ID>
# Forget a specific entry by stable ID (relation-safe: blocked if referenced)
memory-custodian forget --id MC-DNU-20260801-a1b2c3d4
# General status and protocol health
memory-custodian status
memory-custodian check
# Focused diagnostics
memory-custodian check --routing
memory-custodian check --reachability
memory-custodian check --freshness
memory-custodian check --privacy
memory-custodian check --security
# Detect structural collisions and duplicate owners
memory-custodian check --conflicts
# Git merge-aware conflict review against a base branch
memory-custodian check --conflicts --merge-base origin/main
# Manage Exception-To relations between conflicting constraints
memory-custodian exception add MC-CON-20260801-a1b2c3d4 --to MC-CON-20260801-e5f6a7b8
memory-custodian exception remove MC-CON-20260801-a1b2c3d4
# Preview reconciliation for distinct invariants
memory-custodian reconcile preview --entry MC-CON-... --entry MC-CON-... \
--resolution distinct --title "Distinct invariants" --evidence user-confirmed
# Check budgets and compact oversized memory files
memory-custodian compact
# Archive oldest decision entries when over budget (requires explicit confirmation)
memory-custodian compact --target decisions.md --apply --archive-oldest --confirm-plan <PLAN_ID>
# Preview and apply migration to Protocol 0.7 (and Entry schema 2)
memory-custodian migrate
memory-custodian migrate --apply --confirm-plan <PLAN_ID>
Personal output preferences and machine workflows can live outside the repository under the private user state root:
# Enable local overlay for this repository's project_id
memory-custodian local enable
# Explicitly bind the normalized repository root
memory-custodian local link
0700 and regular files use 0600.docs/memory/: Reviewable, diffable, committable, and rollback-safe like code.AGENTS.md, CLAUDE.md, and GEMINI.md only point to the manifest.MC-DEC-..., MC-SUBJ-...) and required Evidence prevent phantom rules and accidental overwrites.docs/memory/: This repository's dogfood memory set.skills/memory-custodian/: The reusable agent skill and normative references/.cli/memory_custodian/: The Python standard-library CLI implementation.adapters/: Platform bootstrap snippets for Codex, Claude Code, Gemini, and generic agents.templates/: Minimal and optional memory module scaffolding.evals/: Contract scenarios and deterministic evaluation suites.The included NightNotes demo demonstrates a new agent session recovering an existing JSON storage decision, offline/standard-library constraints, and a rejected SQLite approach:
MemoryCustodian was developed prior to OpenAI Build Week (v0.7.0 baseline) and expanded during Build Week with Codex and GPT-5.6 (v0.8.0 through v0.9.1). Codex accelerated repo-wide implementation across the protocol, CLI, skill adapters, and test suites, while GPT-5.6 assisted in formalizing the boundary between semantic agent judgment and deterministic CLI enforcement.
FAQ
memory-custodian is a Claude Code plugin with 1 hand-picked skill for development work, indexed on Flowy. Install it with the command on its page. It includes memory-custodian. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it