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.
npx agentmods add skills/rjmurillo/ai-agents/memory-gatenpx skills add rjmurillo/ai-agents --skill memory-gategit clone --depth 1 https://github.com/rjmurillo/ai-agentsWrote 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.
[](https://agentmods.dev/skills/rjmurillo/ai-agents/memory-gate)<a href="https://agentmods.dev/skills/rjmurillo/ai-agents/memory-gate"><img src="https://agentmods.dev/badge/skills/rjmurillo/ai-agents/memory-gate.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00109 | $0.01811 |
| Opus 5 | $0.00055 | $0.00905 |
| Sonnet 5 | $0.00022 | $0.00362 |
| Haiku 4.5 | $0.00011 | $0.00181 |
Grade A, and why
memory-gate 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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 196 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Memory Gate
The Memory-First Gate and its investigation protocol, extracted from the
memory router per ADR-063 (memory-skill decomposition). memory still routes
here; an agent about to change an existing system loads this sub-skill instead
of the full memory surface.
The gate is one operation with a single rule: before you change something that already exists, search memory for why it exists. The search uses the canonical Tier 1 script; this sub-skill owns the enforcement semantics (ADR-070) and the Chesterton's Fence framing, not the search implementation.
Triggers
Use this skill when the user says:
memory-first gateto apply the BLOCKING pre-change checksearch memory before changingto recover historical context firstchesterton fence checkto investigate why a system exists before removing it
Memory-First Gate (BLOCKING)
Before changing existing systems, you MUST:
- Search memory for the topic you are about to change.
- Review results for historical context.
- If Tier 1 is insufficient, escalate to Tier 2 (episodes).
- Document findings in your decision rationale.
- Only then proceed with the change.
# Recover the "why" before you change the "what"
SCRIPTS_DIR="${COPILOT_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-.claude}}/skills/memory/scripts"
python3 "$SCRIPTS_DIR/search_memory.py" "[topic]"
Why BLOCKING: under 50% compliance with "check memory first" guidance when it is advisory. Making it BLOCKING achieves 100% compliance, the same pattern as the session protocol gates (ADR-070 gate semantics).
Verification: the transcript, pull request, handoff, Serena memory, or an optional log must show the search before the decision.
The canonical Tier 1 script is search_memory.py. It is shared with the
memory router and lives at
.claude/skills/memory/scripts/search_memory.py. This sub-skill delegates to it
and does not reimplement search.
Memory-First as Chesterton's Fence
Core insight: memory-first architecture implements the Chesterton's Fence principle for AI agents.
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- yesterday First seen · 196 lines · 109 tokens per session scan A 4aeb6817dd2d
memory-gate is a skill published in the GitHub repository rjmurillo/ai-agents (45 stars, last pushed today), licensed MIT. It adds 109 tokens to every session and 1,811 once invoked, about $0.0005 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-09-03.
Other skills, from other repositories
agent-memory
../../../engineering/agent-memory/skills/agent-memory/SKILL.md.
ci-cd-pipeline-builder
../../../engineering/skills/ci-cd-pipeline-builder/SKILL.md.
context-engine
../../../c-level-advisor/skills/context-engine/SKILL.md.
abmind_recall_workaround
Fallback when abmind recall / the abmindrecall tool fails — read memories directly from the SQLite DB.
memory-search
Search persistent memory for facts, decisions, and past conversations.
read-messages
Read back raw conversation messages from the abmind messages table (session list + message dump).