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 skills add simbajigege/book2skills --skill agent-memory-implementationgit clone --depth 1 https://github.com/simbajigege/book2skillsWrote 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/simbajigege/book2skills/agent-memory-implementation)<a href="https://agentmods.dev/skills/simbajigege/book2skills/agent-memory-implementation"><img src="https://agentmods.dev/badge/skills/simbajigege/book2skills/agent-memory-implementation.svg" alt="Measured on agentmods" height="20"></a>- NVIDIA SkillSpector pass
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.00129 | $0.02179 |
| Opus 5 | $0.00064 | $0.01090 |
| Sonnet 5 | $0.00026 | $0.00436 |
| Haiku 4.5 | $0.00013 | $0.00218 |
Grade A, and why
agent-memory-implementation 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 8d 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.
How it starts
The opening of the file, as written. The whole thing — 186 lines — stays where its author put it; the contents beside it link to each section on GitHub.
memory-architect
Restructures memory files into the 2-layer architecture that Claude Code's autoDream service uses internally — designed to keep the always-loaded index small while making deeper knowledge accessible on demand.
The 2-Layer Architecture
Claude Code's memory system (services/autoDream/) uses this structure:
MEMORY.md ← Layer 1: Always loaded, pointer-only index (~200 lines max)
├── topic-file.md ← Layer 2: Domain knowledge, loaded when relevant
└── another-topic.md
Layer 1 — MEMORY.md index: Loaded into every conversation. Must stay under ~200 lines (lines beyond 200 get truncated). Each entry is a one-line pointer: - [Title](file.md) — one-line hook. No content, just pointers. This is what Claude scans to decide what to load.
Layer 2 — Topic files: Contain the actual knowledge. Claude loads these on demand when their pointer appears relevant. Can be as long as needed. Each file has YAML frontmatter with name, description, and type.
No archive layer: The autoDream system does not maintain an archive directory. Stale, superseded, or contradicted memories are deleted or corrected in place (see consolidationPrompt.ts Phase 3–4). The memory directory is always the current truth, not a history log.
How Claude Code Writes Memories Automatically
Understanding the auto-extraction pipeline helps you restructure files in a way that works with the system rather than against it.
The extraction forked agent
At the end of every query loop (when the model returns a final response with no pending tool calls), Claude Code fires a forked agent in the background via executeExtractMemories() in services/extractMemories/extractMemories.ts. This agent:
- Receives the last N user/assistant messages as context
- Scans the memory directory for existing files (reads only frontmatter — the
descriptionfield is the primary signal) - Decides what is worth saving from this conversation
- Writes or updates
.mdfiles inside the memory directory, then updatesMEMORY.md
What ships with it
4 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.
- 8d ago First seen · 186 lines · 129 tokens per session scan A ee9c772df586
agent-memory-implementation is a skill published in the GitHub repository simbajigege/book2skills (160 stars, last pushed 13d ago), licensed MIT. It adds 129 tokens to every session and 2,179 once invoked, about $0.0006 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.
Other skills, from other repositories
crewai-multi-agent
Multi-agent orchestration framework for autonomous AI collaboration. Use when building teams of specialized agents working together on complex tasks, when you need role-based agent collaboration with memory, or for production workflows requiring sequential/hierarchical execution. Built without LangChain dependencies…
langchain
Framework for building LLM-powered applications with agents, chains, and RAG. Supports multiple providers (OpenAI, Anthropic, Google), 500+ integrations, ReAct agents, tool calling, memory management, and vector store retrieval. Use for building chatbots, question-answering systems, autonomous agents, or RAG…
memory-search
Search conversation history and semantic memory to recall previous discussions, decisions, and context. Use when the user asks to "search memory", "what did we discuss", "remember when", "find previous conversation", "check history", or before starting work to recall prior decisions.
agent-memory-mcp
A hybrid memory system that provides persistent, searchable knowledge management for AI agents (Architecture, Patterns, Decisions).
agent-memory-systems
Memory is the cornerstone of intelligent agents. Without it, every interaction starts from zero. This skill covers the architecture of agent memory: short-term (context window), long-term (vector stores), and the cognitive architectures that organize them. Key insight: Memory isn't just storage - it's retrieval. A…
conversation-memory
Persistent memory systems for LLM conversations including short-term, long-term, and entity-based memory Use when: conversation memory, remember, memory persistence, long-term memory, chat history.