/project-toolkit:memoryfrom project-toolkit
Thin router for the tiered memory system. Points callers at the focused sub-skills for each operation: search, reflexion write, memory-first gate, maintenance, and consolidation.
Ships in project-toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Thin router across the tiered memory system. Each operation lives in a focused sub-skill (ADR-063 memory-skill decomposition); this router points you at the right one so a caller loads only the surface it needs.
| Scenario | Use Memory Router? | Alternative |
|---|---|---|
| Not sure which memory operation you need | Yes | - |
| Tier 1 search only | No | memory-search sub-skill |
| Record a completed session | No | memory-reflexion sub-skill |
| Pre-change memory-first gate | No | memory-gate sub-skill |
| Health, token count, benchmark | No | memory-maintenance sub-skill |
| Periodic durable/dated consolidation, index tidy | No | memory-consolidate sub-skill |
| Agent needs deep multi-source context | No | context-gather skill |
| Human at CLI | No | /memory-search command |
See the context-gather skill for the multi-source pre-work gather and its references/context-retrieval.md for the source-priority strategy (the former context-retrieval agent folded into that reference, which moved here from the retired knowledge-graph skill).
The router delegates every operation to a focused sub-skill. Load the one that matches your task; each carries a smaller context than the full memory surface.
| Sub-Skill | Operation | Load When |
|---|---|---|
memory-search | Tier 1 semantic search (Serena) | You need facts, patterns, or rules |
memory-reflexion | Tier 2 episode extraction | You are recording a completed session |
memory-gate | Memory-First Gate (BLOCKING) and Chesterton's Fence protocol | You are about to change an existing system |
memory-maintenance | Health check, token count, size validation, benchmark, density | You are maintaining the memory stores |
memory-consolidate | Periodic durable/dated consolidation, overlap merge, index tidy | You are doing a periodic memory cleanup pass |
Use this skill when the user says:
search memory for semantic search across tiers (routes to memory-search)check memory health for system status (routes to memory-maintenance)extract episode from session for session replay (routes to memory-reflexion)memory-first gate before changing an existing system (routes to memory-gate)consolidate memory for a periodic durable/dated review and index tidy (routes to memory-consolidate)What do you need?
│
├─► Current facts, patterns, or rules?
│ └─► memory-search sub-skill (Tier 1)
│
├─► About to change existing code, a constraint, or a protocol?
│ └─► memory-gate sub-skill (search the "why" first, BLOCKING)
│
├─► Record what happened in a completed session?
│ └─► memory-reflexion sub-skill (Tier 2 episode extraction)
│
├─► Store new factual knowledge directly?
│ └─► Follow the Serena Protocol below, then
│ curating-memories to keep it accurate
│
├─► Check health, count tokens, benchmark, or improve graph density?
│ └─► memory-maintenance sub-skill
│
├─► Periodic pass: separate durable from dated, merge overlaps, tidy the index?
│ └─► memory-consolidate sub-skill
│
└─► Not sure which tier?
└─► Start with memory-search (Tier 1), escalate if insufficient
For deeper guidance on picking a tier, see references/tier-selection-guide.md.
Serena is this repository's memory. Earlier sessions and other agents wrote to it, so it may already hold what you are about to rediscover. Tool names below are bare; each harness adds its own prefix.
--project (this repository's
.mcp.json does), the project is active when the session starts. Call
activate_project only when a Serena tool reports that no project is
active.initial_instructions once per session..serena/memories/ with your file tools and make writes
as file edits. search_memory.py reads the files, so search still works./memory-search (search_memory.py "<keywords>").
Use what comes back. The memory-gate sub-skill makes this BLOCKING for
changes to existing systems.read_memory by its name. Browse one folder with
list_memories and a topic. Never read the whole store.search_memory.py matches memory names, not content. On a miss, grep the
keyword rows of memory-index.md and the domain *-index.md files, then
read the memory a row names. Still unsure which topic holds it: ask the
user in an interactive session. Unattended, record the gap and continue.
Do not sweep every topic.knowledge-persistence rule, Placement
contract).edit_memory instead of adding a second one.<topic>/<name>, reusing an existing topic folder. Keep one concept
per file. Say who, what, when (absolute date), why, and the source.memory-index.md in the same change, with (0) as
the token count. Add a row to the domain *-index.md when one exists. See
Index-Table Insertion below.Serena writes to the checkout active at server start (--project root),
not your cwd. Call mcp__serena__write_memory, edit_memory,
delete_memory, or rename_memory only from that checkout. A linked worktree
(git rev-parse --git-dir differs from --git-common-dir) never qualifies.
In one, unsure, or without a shell, do not call them: edit .serena/memories/
files in your own checkout, or return the change to the parent session. Delete or
rename only when asked. New memory: <topic>/<name> plus a memory-index.md line.
See universal.md MUST NOT 11.
delete_memory or rename_memory, or blank a memory with
edit_memory, unless the user asks. Report what should go and let the
user decide.The memory system uses progressive disclosure: list names, read details, deep
dive on cross-references. This prevents loading a large memory when a small slice
answers the query (up to an 87% token reduction). The memory-search sub-skill
owns the Tier 1 index-then-read flow; start there.
Atomic files plus indexes are deliberate: there are no embeddings, so the
filename is the activation vocabulary. Do NOT consolidate atomic memories to
cheapen listing; it breaks discovery and cross-links. On add, update the domain
*-index so the next agent finds the memory by name.
These conventions govern writing a new Serena memory and registering it in its
domain index. They are the load-bearing rules absorbed from the former memory
agent. For in-file obsolete-marking, use the curating-memories
skill. For cross-file deduplication, use the memory-consolidate skill. For
cross-linking, use the memory-maintenance skill.
<topic>/<descriptive-name>, lowercase with hyphens, under an
existing topic folder when one fits (for example pr-review/security).{domain}-{description}, kebab-case, no prefix
(for example pr-enum-001). File name and entity ID are separate; do not
conflate them.Domain index files (skills-*-index.md) contain ONLY a two-column table. When
you add a memory you MUST insert AFTER the last existing DATA row, never after
the header or the delimiter:
| Keywords | File | <-- header row
|----------|------| <-- delimiter row (SKIP THIS)
| existing | file | <-- data rows; insert after the LAST one
Inserting after the header or delimiter corrupts the table and breaks name-based discovery for every reader. Do not add titles, statistics, or prose to an index file.
## Relations
- **supersedes**: [previous-file-name]
- **depends_on**: [dependency-file-name]
- **related_to**: [related-file-name]
supersedes (new version replaces old), depends_on (requires another memory),
related_to (loose association).
[YYYY-MM-DD] [Source]: [Observation content]
Source forms: [agent-name], [doc:path], [decision:ADR-NNN], [user],
[ext:source]. Reasoning over actions: record WHY a choice was made, not just
WHAT was done.
When observations contradict, prefer the most recent, create a new memory with a
supersedes relation, and prefix with [REVIEW] when accuracy is uncertain.
| Data | Location |
|---|---|
| Serena memories | Serena memory store (travels with the repository) |
| Episodes | Local episode store (see memory-reflexion) |
| Anti-Pattern | Do This Instead |
|---|---|
| Skipping the memory-first gate | Route to memory-gate before changing existing systems |
| Loading the full router for one operation | Load the focused sub-skill instead |
| Tier confusion | Follow the decision tree; start at Tier 1 |
| Consolidating atomic memories | Keep one concept per file; update the index on add |
Router-owned references, shared across the memory sub-skills. Operation-specific references travel with their sub-skill (ADR-063).
| Document | Content |
|---|---|
| tier-selection-guide.md | When to use each tier |
| zettelkasten-memory-agents.md | Atomic memory principle and auto-linking |
| codebase-knowledge-graph.md | GitNexus pattern for structural context via MCP |
| Operation | Verification |
|---|---|
| Routed to sub-skill | Sub-skill SKILL.md loaded and its verification gate applied |
| Search completed | Result count > 0 OR logged "no results" |
| Episode extracted | JSON file in .project-toolkit/memory/episodes/ |
| Health check | All tiers show "available: true" |
Verification checklist:
Match the request to a sub-skill using the decision tree and When-to-Use matrix.
Load the selected sub-skill and run its operation against the canonical scripts.
Return structured results to the caller with source attribution.
The router owns the canonical memory scripts. Sub-skills delegate to these paths (ADR-063); the router does not duplicate them.
| Script | Purpose | Exit Codes |
|---|---|---|
search_memory.py | Search across Serena and the episode store | 0=success, 1=error |
count_memory_tokens.py | Token counting with tiktoken caching; lists the 200 largest files, --limit 0 lists all | 0=success, 1=error |
test_memory_size.py | Memory atomicity validation | 0=pass, 1=violations |
test_memory_health.py | System health dashboard | 0=success |
extract_session_episode.py | Episode extraction; --validate checks the store at rest, --fix repairs backwards commit order; --dry-run extracts without writing | 0=success, 1=error, 2=violation or bad flag |
repair_episode_causal_links.py | Restore causal edges in flattened episodes; --check or --dry-run reports without writing | 0=success, 1=an episode is invalid, 2=episodes dir missing |
migrate_causal_version.py | One-shot migration: stamps causal_order_version=2 on legacy episodes; --dry-run previews counts without writing | 0=all stamped, 1=some skipped, 2=bad path |
measure_memory_performance.py | Serena search benchmark, by phase | 0=success, 1=error |
improve_memory_graph_density.py | Graph density improvement | 0=success, 1=error |
convert_index_table_links.py | Index table link conversion; --dry-run previews | 0=success, 1=error |
convert_memory_references.py | Convert backtick memory references to Markdown links; --dry-run previews | 0=success, 1=error |
invoke_memory_cross_reference.py | Cross-reference memories | 0=success, 1=error |
Invoke via the portable root form:
"${COPILOT_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-.claude}}/skills/memory/scripts/test_memory_health.py" --format table
| Skill | When to Use Instead |
|---|---|
memory-search | Tier 1 search only; smaller context than the router (ADR-063) |
memory-reflexion | Tier 2 episode extraction (ADR-063) |
memory-gate | Memory-First Gate and Chesterton's Fence protocol (ADR-063) |
memory-maintenance | Health, token count, size, benchmark, density (ADR-063) |
memory-consolidate | Periodic durable/dated consolidation, merge, index tidy |
memory-enhancement | Add citations, verify code references, track confidence |
memory-documentary | Narrative cross-system memory reports |
curating-memories | In-file obsolete-marking (supersession markers) |
CLAUDE.md (opens in a new tab)__init__.py (opens in a new tab)conftest.py (opens in a new tab)memory_core/__init__.py (opens in a new tab)memory_core/memory_router.py (opens in a new tab)memory_core/reflexion_memory.py (opens in a new tab)memory_core/schema_validation.py (opens in a new tab)memory_core/url_validation.py (opens in a new tab)references/codebase-knowledge-graph.md (opens in a new tab)references/tier-selection-guide.md (opens in a new tab)references/zettelkasten-memory-agents.md (opens in a new tab)resources/schemas/episode.schema.json (opens in a new tab)scripts/README-count-tokens.md (opens in a new tab)scripts/README-test-size.md (opens in a new tab)scripts/__init__.py (opens in a new tab)scripts/convert_index_table_links.py (opens in a new tab)scripts/convert_memory_references.py (opens in a new tab)scripts/count_memory_tokens.py (opens in a new tab)scripts/extract_session_episode.py (opens in a new tab)scripts/improve_memory_graph_density.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
memory-router, tiered-memory, memory-system, sub-skill-router
104 skills in this plugin
/adr-generatorCreate comprehensive Architectural Decision Records (ADRs). Researches the destination directory to detect existing template conventions, gathers context, determines next ADR number, generates the ADR, validates completeness, and saves. Supports multiple ADR formats (MADR, Nygard, Alexandrian, project canonical). Use when documenting technical decisions, creating new ADR files, or capturing rationale so future readers can revisit a choice. Use when you say "write an ADR", "document this decision", "document these design choices", "record why we chose this", "capture the rationale", or "for future maintainers", or when creating an ADR-like markdown file under docs/decisions/, docs/adr/, docs/architecture/, architecture/decisions/, or .project-toolkit/architecture/. Do NOT use to debate or review an existing ADR (use adr-review)./adr-reviewMulti-agent debate orchestration for Architecture Decision Records. Automatically triggers on ADR create/edit/delete. Coordinates architect, critic, independent-thinker, security, analyst, and high-level-advisor agents in structured debate rounds until consensus. Use when you say "review this ADR", when an ADR is created/edited/deleted, or when reviewing, accepting, or updating a decision file under .project-toolkit/architecture/, docs/architecture/, docs/decisions/, docs/adr/, or architecture/decisions/, including intent like "review this decision record" or "check this rationale for future maintainers". Do NOT use to author a new ADR (use adr-generator)./agent-harness-referenceField reference for Claude Code and GitHub Copilot CLI hook contracts. Covers hook locations, events, matchers, payloads, decisions, exit codes, timeouts, plugin roots, and cloud limits with official URLs and versioned probes. Use for `harness contract`, `copilot cli hook behavior`, `hook payload format`, `stale plugin root`, `Errno 2 _dispatch.py`, or before changing cross-harness hooks. Do NOT use to run the porting campaign (in the ai-agents repository, use `ai-agents-portability-campaign`)./ai-agents-external-claimsVerify external, vendor, and third-party claims (numbers, attributions, structure) against authoritative primary sources before they land in a repo artifact or external deliverable. Covers stake-holding sources, round-number tells, citation-chain drift, and the walk-the-gate-or-file-conservative discipline. Use when you say `verify an external claim`, `check a vendor number`, `is this stat real`, `validate a third-party citation`. Do NOT use for running an experiment (use `ai-agents-research-methodology` in the ai-agents repository) or command-injection scanning (use `security-scan`)./analysis-provenanceIdentify code ownership before modifying validators or linters. Checks file headers for provenance indicators, reviews documentation, and determines provenance as UPSTREAM, LOCAL, VENDOR, or UNKNOWN. Prevents accidental modification of upstream tools./analyzeSystematic multi-step codebase analysis producing prioritized findings with file-line evidence. Covers architecture reviews, security assessments, and code quality evaluations through guided exploration, investigation planning, and synthesis. Use when you say "analyze this codebase", "run security assessment", "architecture review of this system", "find code smells", or "review code quality" across multiple files. Do NOT use for single-file maintainability scoring (use code-qualities-assessment) or CWE-78 injection pattern scanning (use security-scan).Generated from the plugin's indexed repository (rjmurillo/ai-agents) — no native marketplace selected
npx claudepluginhub p/rjmurillo-copilot-cli-agents-src-copilot-cli2 plugins in one repository ship this exact skill · first indexed Nov 13, 2026
Other plugins' skills for the same job