MemLayer Plugins
A self-learning memory system for Claude Code, the Gemini CLI, and Codex CLI that enables persistent learning across task executions.
Must be used with MemLayer.
Overview
MemLayer provides your AI agents with episodic memory capabilities, allowing them to:
- Log task executions as episodes with outcomes, errors, and context
- Extract patterns from past experiences, especially failures
- Promote proven strategies into reusable skills
- Retrieve relevant context before starting new tasks
- Learn from mistakes to avoid repeating them
Installation
One-Command Installers (curl)
Use these from the target project directory.
Gemini CLI
curl -fsSL https://raw.githubusercontent.com/shafty023/MemLayer-Plugin/main/install-gemini.sh | bash
This installs the Gemini plugin and configures memlayer MCP in .gemini/settings.json.
Then run /mcp auth memlayer in Gemini to complete MCP login.
By default, installer checkout ref is main (override with MEMLAYER_REPO_REF).
Claude Code
curl -fsSL https://raw.githubusercontent.com/shafty023/MemLayer-Plugin/main/install-claude.sh | bash
This adds the plugin marketplace, installs memory@ProcIQ, and configures the memlayer MCP server in Claude.
Codex CLI
curl -fsSL https://raw.githubusercontent.com/shafty023/MemLayer-Plugin/main/install-codex.sh | bash
This installs the memory-usage skill into ${CODEX_HOME:-~/.codex}/skills, updates the current repo's AGENTS.md, configures MCP, and prints the codex mcp login memlayer step for you to run explicitly.
By default, installer checkout ref is main (override with MEMLAYER_REPO_REF).
Claude Code
-
Add the marketplace to Claude Code:
/plugin marketplace add shafty023/MemLayer-Plugin
-
Install the memory plugin:
/plugin install memory@ProcIQ
-
Configure the prociq MCP server with your API key (see prociq.ai for setup)
For more details on plugin installation, see the official documentation.
Gemini CLI
See the Gemini Plugin Documentation for installation and setup instructions.
Codex CLI
See the Codex Plugin Documentation for installation and setup instructions.
Project Structure
MemLayer-Plugin/
├── .claude-plugin/ # Claude marketplace registration
├── codex/ # Codex CLI installer and policy template
│ ├── setup.sh
│ └── templates/
├── gemini/ # Gemini CLI installer and manifest
│ ├── manifest.json
│ └── setup.sh
└── plugins/
└── memory/ # Claude Code plugin and shared skill source
├── .claude-plugin/
│ └── plugin.json # Plugin manifest
├── commands/ # CLI commands
│ ├── audit.md # /memory:audit - inspect memory state
│ ├── teach.md # /memory:teach - inject knowledge manually
│ └── forget.md # /memory:forget - remove episodes
├── hooks/ # Integration hooks
│ ├── hooks.json
│ └── scripts/
│ ├── session-start.sh
│ └── user-prompt.sh
└── skills/
└── memory-usage/
└── SKILL.md # Canonical memory system usage guide
Commands
/memory:audit [episodes|patterns|skills]
Inspect the current state of the memory system. Shows statistics, recent episodes, high-confidence patterns, and skill inventory.
/memory:teach <lesson>
Manually inject knowledge into the memory system without task execution.
/memory:teach When using Detox with animations, always add explicit waitFor timeouts of at least 5000ms
/memory:forget <episode-id|query>
Remove specific episodes from memory. Can search by query or delete by ID.
Core Concepts
Episodes
Records of task execution containing:
- Task goal and approach taken
- Outcome (success/partial/failure)
- Error details if applicable
- Tools used and file patterns involved
- Importance score (0.0–1.0)
Patterns
Derived learnings extracted from multiple episodes:
- Root cause analysis
- Recommended strategy
- Trigger conditions (errors, keywords, tools)
Skills
Mature, high-confidence patterns promoted to reusable knowledge that gets surfaced when relevant tasks arise.
Notes
Persistent freeform knowledge entries that never decay (unlike episodes):
- Recording important discoveries that shouldn't fade
- Documenting project-specific knowledge
- Manual teaching via
/memory:teach command
- Reference material that should always be findable