A small, runnable memory for an AI coding agent. Clone it, point it at your project, and the agent starts remembering what it learns: the corrections you give it, the way your project really works, the facts that live in no file. So the next session starts smarter than the last one instead of blank.
To use just the memory half as a template: copy .claude/commands/{capture,index,recall,distill}.md,
memory/, and the memory sections of project/CONTEXT.md beside your project, and adapt the
four skills. This particular repo also carries the six
agentic-loop skills, pulled in via
/sync-template - see
project/TEMPLATE-SYNC.md.
Four markdown skills and a folder of plain notes. No framework to install, nothing to configure, no database. The skills are written for Claude Code as drop-in slash-commands in
.claude/commands/, but the patterns are agent-agnostic. Adapt the invocation to whatever coding agent you run.
Almost everything you say to a coding agent is worth keeping. Not just the code it writes - the corrections, the back and forth, the dead ends, the moment you re-explain what you actually meant. Most systems throw all of that away: you fix the agent, it does the thing, the chat scrolls off the top of the screen, and tomorrow it makes the same mistake. That is backwards. The conversation is often the most valuable thing that happened, and it is exactly the part we discard.
In the age of AI, the raw material is not the final answer. It is the whole exchange. Every time you correct an agent you are telling it something true about how your project really works, written down nowhere in the code. Discarded, it is noise. Captured and distilled, it is the knowledge that makes the next session start smarter. All of it is data.
This template gives an agent that memory, as four small skills over a folder of plain notes.
| Skill | What it does |
|---|---|
/capture |
Turns one correction, preference, or fact into a durable note. One fact per file. |
/index |
Read at the start of a session. A one-line-per-note map, so a fresh agent walks in already knowing what past sessions learned. |
/recall |
Given a topic, pulls the ONE relevant note back into context, precisely, instead of dumping the whole store. |
/distill |
Reads the raw inbox stream and promotes only the durable signal into the knowledge base. Noise in, signal out. |
The one that matters most is /distill. Storing things is easy; a transcript of every
conversation is just more noise in a bigger pile. The hard part, and the whole value, is
reading the mess and pulling out the one sentence that was worth the whole conversation. That
filter is what turns a pile of chat into knowledge the system can use.
This repo also carries agentic-loop's six skills (/create-task, /start-task, /next,
/extract-followups, /learn-and-improve, /sync-template) - see
the companion section below.
-
Use this template on GitHub, then clone your copy next to the project you want the agent to remember things about.
-
Open
project/CONTEXT.mdand describe your project in a few lines. This is the one placeholder the skills read to judge what is worth remembering. -
Open the repo in Claude Code (or your agent of choice) and orient:
/indexIt reads the memory map and tells you what is already known. The template ships with two example notes and a raw inbox entry so it is not empty on the first run.
-
Watch the filter work, then capture your own first fact:
/distill # promotes the signal in the example inbox, drops the noise /capture "the build reads config from the root, not per package" -
Mid-task, pull back the one note you need:
/recall "where does config come from"
The example notes and inbox entry are labelled as examples - delete them once you have seen the cycle run and started your own store.
.claude/commands/ the four memory skills, plus six loop skills from agentic-loop
project/CONTEXT.md >>> describe your project here (the one placeholder) <<<
project/TEMPLATE-SYNC.md the bookmark and ledger /sync-template reads and writes
memory/INDEX.md the map: one line per note, read first every session
memory/notes/ the knowledge base: one durable fact per file
memory/inbox/ the raw running stream, drained by /distill
memory/learnings/ agentic-loop's own mistake log, drained by /learn-and-improve
tasks/ the loop's todo/doing/done queue
See memory/README.md for how the store is shaped and why one fact per
file.
Three pillars. Normally two repos: its sibling, agentic-loop, is a small self-improving loop of coding-agent skills: it plans, builds, and verifies its own work, then improves its own instructions from the mistakes it records. That is two of the three pillars, verify and improve. agentic-loop is where an agent gets things done and gets better at doing them.
agentic-memory is where it remembers. agentic-loop's learn-and-improve step produces durable notes about what went wrong; this repo is where notes like that can live and be recalled. Put together, the two are one story: agents that verify, improve, and remember themselves, with a human approving every step. You can run either on its own; they compose cleanly if you run both.
This particular repo runs both from one place: agentic-loop's six skills were pulled in via
/sync-template rather than kept in a second repo, so project/TEMPLATE-SYNC.md tracks that
upstream and future improvements to the loop skills sync in the same way. See
project/TEMPLATE-SYNC.md for what is tracked and the ledger of
what has already been reviewed.
See ADAPTING.md for how to tune the note shape, wire the skills to a different
agent, or fold this memory into an existing workflow. The skills are deliberately short so they
are easy to read and change: a starting point, not a black box.
The next natural addition is a light scoring pass: judging, over time, whether the notes a session recalled actually helped, so distillation can be tuned by evidence rather than feel. It is deliberately left out of the first version to keep the store small and the idea legible.
I build agentic AI systems: multi-agent workflows that implement, review, and verify real software under human oversight. The engineering that matters in agentic AI is not the model, it is what surrounds it: the context an agent reasons over, and whether that context survives from one session to the next. This template is a clean, minimal version of the memory layer I use in my own work.
Two teams on the same model do not stay level for long. The one whose agents remember what they have been taught pulls a little further ahead every day. Your context, not your model, is the moat.
Hamid Heydarian - LinkedIn.
MIT. See LICENSE.