memory-arch

memory-arch is a skill for Claude Code, Codex from kimsanguine/hplan. It costs 56 tokens per session (2,659 once invoked), scanned A, original, MIT.

A design guide for an agent's memory system: the information it uses during a session and the knowledge it stores and retrieves across sessions. It covers working, episodic, semantic, and procedural memory, along with storage and retrieval choices.

In plain words
What is it for?
Use it to design memory for agents that must retain user preferences, past interactions, domain knowledge, or learned procedures across multiple runs.
Why use it?
It helps decide what an agent should remember, where to keep it, and how to bring back only relevant information within its context limits.

Skill for Claude CodeCodex

Part of the architect plugin — 4 skills shipped together

Install

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.

agentmods
npx agentmods add skills/kimsanguine/hplan/memory-arch
Any agent
npx skills add kimsanguine/hplan --skill memory-arch
Clone the repo
git clone --depth 1 https://github.com/kimsanguine/hplan

Made for: Claude Code, Codex.

Or install architect, the plugin that ships this one along with the rest of its 4 skills.

Wrote 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.

agentmods badge for memory-arch

README.md
[![agentmods](https://agentmods.dev/badge/skills/kimsanguine/hplan/memory-arch.svg)](https://agentmods.dev/skills/kimsanguine/hplan/memory-arch)
Your own site
<a href="https://agentmods.dev/skills/kimsanguine/hplan/memory-arch"><img src="https://agentmods.dev/badge/skills/kimsanguine/hplan/memory-arch.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,659 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00056 $0.02659
Opus 5 $0.00028 $0.01329
Sonnet 5 $0.00011 $0.00532
Haiku 4.5 $0.00006 $0.00266

Measured 5d ago against content hash e6321028dfa0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

memory-arch 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 5d 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.

architect/skills/memory-arch/SKILL.md · 260 lines

How it starts

The opening of the file, as written. The whole thing — 260 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Memory Architecture

에이전트 메모리 시스템 설계 — 단기 컨텍스트, 장기 저장, 검색 전략

Core Goal

  • 단일 실행의 컨텍스트 윈도우를 넘어 실행 간 학습과 기억을 유지하는 메모리 아키텍처 설계하여 에이전트의 진화 가능하게 함
  • 4가지 메모리 유형(Working, Episodic, Semantic, Procedural)을 각각 적절한 저장소에 배치하여 검색 효율성과 비용을 최적화
  • 제한된 컨텍스트 윈도우 내에서 가장 관련성 높은 메모리만 주입하는 검색 및 랭킹 전략 수립

Trigger Gate

Use This Skill When

  • 에이전트가 여러 실행(세션)에서 일관된 동작을 해야 하는 경우
  • 사용자 선호도, 과거 상담 내용, 또는 도메인 지식을 기억해야 하는 에이전트
  • 에이전트가 각 상호작용에서 학습하고 개선되어야 하는 경우

Route to Other Skills When

  • 메모리가 플라이휠(사용 → 개선)의 일부인 경우 → strategy --focus growth-loop (데이터 구조 설계)
  • 멀티 에이전트 간 메모리 공유 필요 → orchestration (에이전트 간 데이터 흐름)
  • 3-tier 시스템에서 workers 간 컨텍스트 전달 → orchestration (Hierarchical pattern 통신 프로토콜)
  • 메모리 저장소의 비용 구조 최적화 → strategy --focus biz-model (인프라 비용 계산)

Boundary Checks

  • 단일 실행 내에서만 메모리 필요 (세션 간 학습 없음) → Working Memory만 구현, 장기 저장소 불필요
  • 컨텍스트 윈도우가 충분히 크면 (1M 이상) → Vector DB 대신 in-context learning으로 단순화 가능
  • 메모리 저장소가 프라이빗이 아니면 (공유됨) → 사용자 격리 로직 추가 필수

개념

에이전트의 지능은 메모리에서 나온다. 단일 실행의 컨텍스트 윈도우를 넘어서, 실행 간 학습과 기억을 유지하는 메모리 아키텍처가 에이전트의 진화를 가능하게 한다.

Instructions

You are designing a memory architecture for: $ARGUMENTS

Step 1 — Memory Type Classification

Memory Type Scope Storage Example
Working Memory Single execution Context window Current task instructions, user input
Episodic Memory Across executions File/DB "Last time user X asked about Y, they preferred Z format"
Semantic Memory Permanent knowledge Embeddings/DB Domain knowledge, best practices, TK entries
Procedural Memory How-to knowledge Instructions/Skills Workflow patterns, prompt templates

Step 2 — What to Remember

For each agent interaction, decide:

Always Store:
- User preferences and corrections
- Successful output patterns
- Error cases and resolutions
- Key decisions and reasoning

Never Store:
- Sensitive personal data (unless explicitly needed)
- Temporary calculation artifacts
- Redundant information already in semantic memory

Read the full file on GitHub · 260 lines

Files

What ships with it

5 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.

Changes

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.

  1. 5d ago First seen · 260 lines · 56 tokens per session scan A e6321028dfa0

Subscribe to this mod's changes

memory-arch is a skill published in the GitHub repository kimsanguine/hplan (2 stars, last pushed 19d ago), licensed MIT. It adds 56 tokens to every session and 2,659 once invoked, about $0.0003 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-31.

Related

Other skills, from other repositories

lore

Use when answering any domain or knowledge question in a project linked to a lore (its CLAUDE.md has a "## Knowledge Base" section naming the lore path), and as the shared contract for all lore- skills. Defines the lore folder layout, page schema, retrieval ladder, index regeneration, and citation rules.

barakgut/lore · 67 tokens

lore-init

Use when the user runs /lore:lore-init [path] [--no-git] — create the lore folder, scaffold its layout with its CLAUDE.md schema, and git-init it unless --no-git. Writes nothing outside the lore folder.

barakgut/lore · 58 tokens

apply

Use when a staged proposal has been reviewed and signed off — REVIEW.md Step 3 ticked reviewed or provisional — and is ready to promote into the live contextualizer.

nick-railsback/skill-engine · 36 tokens

setup

This skill should be used when the user asks to "set up mnemonica", "install mnemonica in this project", "initialize mnemonica", "bootstrap the knowledge docs", "add mnemonica to this repo", or wants Claude-maintained modular documentation installed in a project for the first time.

HAX-Studio/mnemonica · 65 tokens

lore-ingest

Use when the user runs /lore:lore-ingest — find files in the lore's raw/ inbox that are new or changed since their last ledger entry, distill or surgically update wiki pages by content type, update log.md, regenerate the index, and commit.

barakgut/lore · 61 tokens

vibe-debugging-journal

Records resolved bugs in a persistent journal — symptom, root cause, difficulty, fix, prevention. Organized by category for future reference.

ash1794/vibe-engineering · 33 tokens