Persistent project-scoped memory for Claude Code. Auto-loads on session start, structured by schema, hot/cold layered.
> /plugin marketplace add yucai0302/memory-loop> /plugin install memory-loop@memory-loop
FAQ
memory-loop is a Claude Code plugin with 1 hand-picked skill for development work, indexed on Flowy. Install it with the command on its page. It includes memory-loop. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
Repo: yucai0302/memory-loop
The agent forgets. The repo doesn't.
Run these two commands in Claude Code:
/plugin marketplace add yucai0302/memory-loop
/plugin install memory-loop@memory-loop
Select Install for you (user scope), then restart Claude Code.
Loop Engineering by Addy Osmani describes a shift in how we work with coding agents:
"You shouldn't be prompting coding agents anymore. You should be designing loops that prompt your agents."
A loop needs five building blocks โ automations, worktrees, skills, connectors, and sub-agents โ plus one place to remember stuff:
"A markdown file, or a Linear board, anything that lives outside the single conversation and holds what's done and what is next... the model forgets everything between runs so the memory has to be on disk and not in the context. The agent forgets, the repo doesn't."
memory-loop is that sixth piece, built as a Claude Code plugin. Install it once, and every project you open gets a persistent, structured memory that loads automatically at session start and updates as you work.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Session starts โ
โ โโโ SessionStart hook fires automatically โ
โ โโโ First time? Creates .claude/memory/ โ
โ โโโ Copies default schema.yaml โ
โ โโโ Generates empty MEMORY.md โ
โ โโโ Injects memory content into context โโโบโ Claude sees past decisions,
โ โ goals, and gotchas instantly
โ Agent works โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโบโ
โ โ
โ Task complete? โ
โ โโโ /memory-loop:save โ
โ โโโ Agent reads schema โ writes entries โ
โ โ
โ Session ends โ
โ โโโ Stop hook fires โ
โ โโโ Warns if MEMORY.md needs compression โ
โ โ
โ Memory too large? โ
โ โโโ /memory-loop:compress โ
โ โโโ Archives old entries โ archive.md โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
your-project/
โโโ .claude/
โโโ memory/
โโโ MEMORY.md โ hot layer, injected every session
โโโ archive.md โ cold layer, created on first compress
โโโ schema.yaml โ your customizable schema
Tip: Commit these files to share memory with your team, or add
.claude/memory/to.gitignoreto keep them local.
One command. Works across all your projects.
claude plugin install github:yucai0302/memory-loop
That's it. The plugin activates on the next Claude Code session.
| Command | Scope |
|---|---|
claude plugin install github:yucai0302/memory-loop | All your projects (default) |
claude plugin install github:yucai0302/memory-loop --scope project | This project only, committed to repo |
claude plugin install github:yucai0302/memory-loop --scope local | This project only, gitignored |
The plugin fires automatically on session start. No manual setup needed.
[memory-loop] Initialized project memory at .claude/memory/MEMORY.md
[memory-loop] Edit .claude/memory/schema.yaml to customize tracked fields.
======= PROJECT MEMORY (memory-loop) =======
# Project Memory
## Project Context
_Not yet set..._
...
=============================================
[memory-loop] Memory loaded (312 chars). Update it with /memory-loop:save
/memory-loop:save
The agent reviews what happened in the session and writes structured entries:
Memory updated:
+ Completed: "Set up authentication middleware | JWT + Redis session"
+ Gotcha: "[auth] Token expiry not propagated to frontend โ add 401 interceptor"
- Active Goal: "Implement login flow" (marked done)
Open the project again. The session start hook automatically injects everything the agent learned last time. No prompting needed.
/memory-loop:status # show file size and section counts
/memory-loop:compress # archive old entries when memory grows large
Edit .claude/memory/schema.yaml in your project. Changes take effect on the next session.
version: "1.0"
hot_layer:
sections:
- name: "Project Context"
description: "Project type, core tech stack, architecture overview."
max_items: 1
format: "prose"
- name: "Active Goals"
description: "Tasks currently in progress."
max_items: 5
format: "- [goal description] | started: YYYY-MM-DD"
- name: "Decisions"
description: "Key technical decisions."
max_items: 10
format: "- YYYY-MM-DD | chose X over Y | reason: Z"
- name: "Gotchas"
description: "Known bugs, traps, constraints the agent must respect."
max_items: 20
format: "- [module] problem โ workaround / rule"
- name: "Completed"
description: "Recently finished tasks, rolling window."
max_items: 10
format: "- YYYY-MM-DD | task | outcome"
compression:
trigger_chars: 8000 # warn when MEMORY.md exceeds this
keep_recent_decisions: 5 # keep N newest on compress
keep_recent_completed: 3 # keep N newest on compress
Any section you add to hot_layer.sections is picked up automatically:
- name: "API Contracts"
description: "External API endpoints this project depends on and their quirks."
max_items: 15
format: "- [service] endpoint | note"
| Command | When to use |
|---|---|
/memory-loop:save | After completing a task โ writes session learnings to MEMORY.md |
/memory-loop:status | Check file size, section health, compression recommendation |
/memory-loop:compress | When warned about file size โ archives old entries to archive.md |
You can also trigger saving naturally in conversation:
Why project-scoped and not global? Memory is specific to a codebase. Decisions and gotchas in project A are noise in project B.
Why a markdown file and not a vector database?
At the scale of a single project's working memory, full injection beats semantic retrieval. No retrieval gaps, no missed critical gotchas. When the file grows large, /memory-loop:compress archives old entries โ the structured hot/cold split happens over time, not at write time.
Why warn instead of auto-compress? Compression moves information. That should be a deliberate act, not something that silently drops context you might need.
Why not write to CLAUDE.md? CLAUDE.md is for project conventions you write once. MEMORY.md is dynamic state that changes every session. Mixing them makes both harder to manage.
yq (optional โ for per-project compression thresholds)brew install yq # macOS
snap install yq # Linux
Issues and PRs welcome.
If you build a custom schema for a specific domain (chip design, data science, game dev, etc.), consider contributing it to examples/ so others can start with something relevant.
MIT ยฉ yucai0302
.claude-plugin/
marketplace.json
agents/
memory-compressor.md
assets/
banner.svg
commands/
compress.md
save.md
status.md
hooks/
hooks.json
README_CN.md
README.md
scripts/
check-compress.sh
session-start.sh
skills/
memory-loop/
SKILL.md
templates/
MEMORY.md.tpl
schema.yamlยฉ 2026 Flowy ยท Free and open source
Built for Claude Code ยท Not affiliated with Anthropic