In an earlier post I described a markdown memory I built for an AI coding agent, and said it became legacy when Kiro, the assistant I use, shipped its own memory. This is the follow-up. In October and November 2026 I designed a layered memory system and an agent harness for a small team. I shared it so nobody on the team had to invent the same wheel again, and the team uses it in daily work.

The design is mine, and I built it with AI coding agents. The repository is private, so this post is about the design. The measurements I quote come from my own dated notes in the repo.

The idea: each fact has a right place

“Remember this” hides a question: remember it for whom, and for how long? A personal preference, a team decision and a note about where I stopped yesterday have different readers and different lifetimes. Putting them in one pile means either nobody else can see what they need, or everyone has to read what only I need.

So the design has levels:

Kind of factWhere it livesWho sees it
How I work, machine facts, things true across projectsthe assistant’s built-in memory, globalme
My working notes about this projectthe same memory, scoped to the repome
A decision or pattern a teammate must seemarkdown files committed in the repothe team, through git
Knowledge useful beyond this repoa shared git-backed memory serverthe wider group
”Where was I”a short handoff note, ignored by gitme, for about a week

The last row isn’t memory on purpose. The built-in memory has only a global and a per-repo scope, so a session level had nowhere to live, and I decided a handoff note is the honest tool for it.

flowchart TD
  F["A fact worth keeping"] --> Q1{"Personal or machine-specific?"}
  Q1 -->|yes| U["Built-in memory, global"]
  Q1 -->|no| Q2{"Must a teammate see it?"}
  Q2 -->|yes| T["Committed team notes"]
  Q2 -->|no| P["Built-in memory, this repo"]
  T --> Q3{"Useful beyond this repo?"}
  Q3 -->|yes| S["Also publish to the shared server"]

In short: ask whether the fact is personal, then whether a teammate needs it, then whether it matters beyond the repo, and the first match decides where it goes.

Two rules keep this honest. The first match wins, and a fact never goes into two stores, because a duplicate drifts and the copy nobody tests ends up winning. And if a fact fits two places, it goes to the team notes, since only git-tracked files reach a teammate.

Decisions I’d defend

One file per entry. My first memory kept five shared files and appended entries to them. For a team working on branches, I tested two people adding an entry on separate branches. The shared file conflicted. One file per entry merged cleanly. That is a measurement from my notes, on throwaway repositories. So I kept the layout and took only the ideas I liked from the old design: tags, links between entries, an index and a health check. So far only the tags and links are built.

A map of where things live, never a list of entries. Entry lists for the built-in and server stores change without a commit, so a copy goes stale at once, and for a personal store it would also leak one person’s inventory. The map describes the levels and how to read your own view of each.

A warning when your clone is stale. A teammate’s new note reaches you only after a git pull, and nothing prompts it. A hook that runs at the start of a session checks when the clone last fetched and says so if it was a week ago. I considered pulling automatically and rejected it, because a surprise pull can be destructive.

Five rules for the entries, which came from failures I found in an existing shared memory store before I used it: update an entry instead of appending a new snapshot (one subject there had fourteen); say whether an entry is still true; don’t store a measurement without its population; don’t duplicate what a skill or rule already says; and never store one person’s standing preferences as “always apply”, because anyone who loads them inherits them.

The harness around it

Six agents, each with one job: a lead that routes work and writes the handoff, an investigator, an analyst, a developer for the health checks we build, a scribe and a reviewer. Two are read-only, two write only documents, and only one changes source code. The reviewer exists because a wrong number is worse than none. A review of one of our own documents once found six errors in a document that had already passed a check, including a contributor who didn’t exist, produced by matching names as substrings. The reviewer’s rule is to verify by a different method than the author used.

How it’s built:

  • One script generates every agent config. Prompts stay short and the substance sits in plain markdown rule files, so the team can review rules in a merge request instead of reading escaped JSON.
  • Rules and steering are separate folders because they load differently. Steering loads for every agent and can’t be scoped. Rules load only when listed, so one agent’s rules can reach that agent alone.
  • Every path is repo-relative or home-relative, and the setup script fails if it finds an absolute home path. Anyone can clone it anywhere.
  • Every reply starts with a fixed marker line. If it’s missing, the reader knows the rules weren’t loaded, usually because the context window overflowed and evicted them without warning.
  • Tokens never go in command arguments, because on a shared machine other users can read them in the process list.

What was wrong or rough

My notes record these, and I’d rather say them than leave them out.

  • I was wrong once about memory writes. An early note said the assistant had no way to write to its built-in memory. The cause was an agent whose tool list simply left the memory tool out. The note was wrong, and it was corrected with a dated correction instead of a quiet edit.
  • Validation checks shape, not intent. The assistant’s config validator accepted a config that gave write access to the read-only reviewer. The generator’s drift check is the real guard, and it is currently noisy for a formatting reason. A few hand-added blocks would also be wiped by a re-run.
  • “Read-only” is behaviour, not a sandbox. The shell allow and deny lists were enforced on the version I tested, but an allowed command can still write through a redirect or an output flag.
  • Some setup doesn’t travel with the repo. Global edits to a person’s home folder have to be repeated by each teammate, and the shared server needs per-machine values.
  • The index is still written by hand. I set the trigger for generating it, and for a health check, at a second writer or about fifteen to twenty entries. There are twenty now, so by that count the trigger is already met.

What I took from it

Memory is a routing problem before it is a storage problem, and the first design question is who needs to read the fact. Put a visible marker where silent failures happen. Write your corrections where readers will see them. And the cheapest safety is the boring kind: one generator, one place to edit, and a check that fails loudly.

If you’re skimming for skills: designing memory and context for AI agents, agent harness and permission design, git-based team workflows, and writing documentation that stays honest.