/scaffolding:agent-memoryfrom scaffolding
Manages repo-local file-based memory under .scaffolding/ with shared, agent, and conversation tiers for cross-session knowledge accumulation. Reads/writes memory files on demand.
Ships in scaffolding. 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.
None: SKILL.md is the whole skill.
3-tier persistent file-based memory under the repo-local .scaffolding/ directory, for cross-session knowledge accumulation. Vector memory (MCP tools) is covered by the semantic-memory-mcp skill.
| Tier | Path | Scope | Written By | Read By |
|---|---|---|---|---|
| Shared | .scaffolding/agent-memory/shared/KNOWLEDGE.md | Whole project | Any agent | All agents |
| Agent | .scaffolding/agent-memory/agents/{agent-name}/MEMORY.md | Per agent | Owning agent | Own agent + architect |
| Conversation | .scaffolding/conversations/{conversation_id}/agent-memory/context.md | Per conversation | Any agent in conversation | Agents in same conversation |
The Conversation tier lives under .scaffolding/conversations/, which is a symlink to <share>/projects/<repo-name>/conversations (shared across machines). Paths are unchanged; always go through the symlink.
No hook or pipeline injects these files into agent context -- they are read on demand (see On First Turn). The conversation tier is the inter-agent handoff: a downstream agent in the same chain reads what an upstream agent recorded there.
Before starting work, read available memory (skip if files don't exist):
.scaffolding/agent-memory/shared/KNOWLEDGE.md.scaffolding/agent-memory/agents/{your-agent-name}/MEMORY.mdconversation_id is provided in task context: Read .scaffolding/conversations/{conversation_id}/agent-memory/context.mdWrite significant findings to the appropriate tier:
Save here:
Do NOT save:
Save here:
Do NOT save:
Save here:
Do NOT save:
Agents with Write in disallowedTools (reviewer, gitops) cannot write to .scaffolding/agent-memory/ directly. These agents should report findings in their output, and writable agents in the same conversation chain can persist them. Architect has Write and may write memory files (only Edit is disallowed).
[YYYY-MM-DD] for time-sensitive entriesconfidence (high/medium/low) and last_verified [YYYY-MM-DD]; re-verify against live code/config before asserting a stale point-in-time fact, and down-grade or remove ones that no longer holdFile-based memory (this skill) is the hot layer — read in full on first turn under a 200-line budget, so keep it lean: stable, high-level facts and pointers only. Push detailed prose and rarely-needed, fuzzy-discoverable knowledge to the cold layer (vector store) via the semantic-memory-mcp skill — it only surfaces on similarity match and carries no per-turn token cost. Durable source-of-truth facts still get a file here; the cold copy is for natural-language recall.
Local-only carve-out: secrets and memory/MCP recovery procedures NEVER go to the cold vector store. Recovery info must stay readable when the store itself is down (a 401 means you cannot query the store to learn how to fix it), and secrets must not be embedded in a remote/shared backend. Keep these as file memory only.
If memory files don't exist, create them with the appropriate header:
# Shared Knowledge
<!-- Cross-agent project knowledge. Max 200 lines. -->
# {Agent Name} Memory
<!-- Agent-specific patterns and lessons. Max 200 lines. -->
# Conversation {conversation_id} Context
<!-- Decisions and findings for this conversation chain. -->
Conversation memory is plain files: when a task has a conversation_id, read context.md yourself (see On First Turn). No database setup is required for conversation-tier memory.
The /learn command closes the loop between a finished conversation and the
memory tiers above. It distills one conversation into knowledge candidates (via
the distill skill's Conversation-Scoped Distillation mode) and routes each
candidate back into this memory system.
| Candidate kind | Target tier | File |
|---|---|---|
| Cross-cutting project fact | Shared | .scaffolding/agent-memory/shared/KNOWLEDGE.md |
| Domain-specific pattern or lesson | Agent | .scaffolding/agent-memory/agents/{name}/MEMORY.md |
| Decision relevant only to the active chain | Conversation | .scaffolding/conversations/{id}/agent-memory/context.md |
Ingestion is propose-then-confirm: /learn prints the proposed memory diff
and applies it only on explicit confirmation. Writes respect the 200-line
KNOWLEDGE.md limit — overflow routes to the most relevant agent file per the
distill overflow rule. Applied entries are picked up by agents that read the files on the next
task.
If a candidate is a repeatable procedure rather than a situational fact (per
distill's Skill Promotion Criterion), it is not written to memory. Instead
/learn proposes a /create-skill invocation with a pre-filled draft, escalating
the knowledge into a first-class auto-invokable skill. Memory holds facts; skills
hold reusable how-to procedures.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub komluk/scaffolding --plugin scaffolding39 skills in this plugin
/agent-commsSendMessage recipient validation and worktreePath safety (CWE-59). TRIGGER when: validating a SendMessage `to:` recipient against the agent whitelist, or a worktreePath from another agent before acting on it. SKIP: routing topology (agent Comms Protocol); git ops (use git-operations); worktree recovery (use worktree-management)./api-designRESTful API design standards: resource naming, HTTP methods, status codes, pagination, versioning. TRIGGER when: designing new API endpoints, defining error response shapes, or adding pagination/filtering. SKIP: implementing FastAPI route code (use python-patterns); error-handling internals (use error-handling)./context-engineeringOptimize Claude Code context-window usage for accuracy and cost. TRIGGER when: hitting context limits, structuring prompts for an agent, or trimming what gets injected into a task. SKIP: persisting knowledge across sessions (use agent-memory); semantic recall tuning (use semantic-memory-mcp)./database-optimizationSchema design, index strategy, migration safety, and query analysis. TRIGGER when: designing tables or indexes, writing a migration, or diagnosing a slow query. SKIP: writing ORM model code (use python-patterns); generic backend patterns (use python-patterns)./distillKnowledge distillation: candidate extraction, confidence scoring, tier routing. Invoked by /learn and the memory-ingest Stop hook, not loaded proactively by agents. TRIGGER when: /learn or the Stop hook asks to distill, or scoring a candidate. SKIP: file memory writes (use agent-memory); vector store (use semantic-memory-mcp)./docker-templatesDocker multi-stage build templates, image security, and docker-compose patterns. TRIGGER when: writing a Dockerfile, composing services, or hardening a container image. SKIP: CI pipeline definitions (use github-actions-template); runtime monitoring (use monitoring-observability).Other plugins' skills for the same job