Cross-agent
Claude, Codex, Cursor, Gemini, and custom runtimes all read and write the same per-project memory. No agent has a private context window the others can’t see.
Multi-agent work spans three dimensions, and durable memory has to keep up with all of them:
Cross-agent
Claude, Codex, Cursor, Gemini, and custom runtimes all read and write the same per-project memory. No agent has a private context window the others can’t see.
Cross-project
org-memory/ holds decisions, rules, and timestamped events readable from every project — the shared substrate for org-wide knowledge.
Cross-instance
Opt-in git sync (since v0.3.0) carries memory across laptops, desktops, and CI runners with no central server.
OACP’s memory layer is a single design that spans all three. The same plain markdown file is read by Claude on your laptop, Codex on your desktop, and a CI agent on a build runner — all without a daemon, vendor, or custom store.
Agents without shared memory rediscover the same context every session, contradict prior decisions, and require the human to be the integration layer. The cost compounds:
OACP solves this by treating memory as a first-class artifact: structured markdown files in known locations, read at session start by every agent, written back via a merge decision and durable-memory promotion flow.
Location: $OACP_HOME/projects/<project>/memory/
Every agent assigned to a project reads the same files at session start:
| File | Purpose |
|---|---|
project_facts.md |
Roles, repo structure, architecture, conventions |
decision_log.md |
Timestamped decisions with rationale |
open_threads.md |
Unresolved issues, blocked epics, cross-agent coordination |
known_debt.md |
Verified, unresolved technical debt that should persist across sessions |
memory/archive/ stores older files no longer in the active working set. Use agent-memory archive and agent-memory restore to move files between active and archive.
The key invariant: memory is runtime-agnostic. Claude reads project_facts.md exactly the same way Codex does. There is no Claude-shaped memory or Gemini-shaped memory — only OACP-shaped memory that every runtime understands.
Stable outcomes flow into memory via merge decisions:
An agent finishes a task and produces a merge decision packet that includes a “Durable Memory Updates” section.
Each project’s promotion mechanism extracts approved entries and appends them to the appropriate memory file, deduplicating against existing content.
The next agent — same runtime or different — reads the updated memory at session start and inherits the new context for free.
This separates what an agent observed during a session (transcripts, scratch notes, debug logs) from what survives the session (decisions, facts, open threads). Only verified outcomes get promoted.
Location: $OACP_HOME/org-memory/
Per-project memory ends at the project boundary. Org-memory crosses it.
$OACP_HOME/org-memory/├── recent.md # Rolling summary, ~60K chars, read on demand├── decisions.md # Org-wide decisions (illustrative default)├── rules.md # Standing conventions (illustrative default)├── events/ # Timestamped event entries│ └── YYYYMMDD-HHMMSS-short-slug.md└── debriefs/ # Central session-debrief store (append-only) └── <project>/<YYYY>/<MM>/YYYYMMDD-<agent>-<session>.mdrecent.md is the rolling summary of current org state. Org-memory is retrieved on demand by default (since v0.4.6), separately from the four project files read at session start: an agent reads recent.md and the topical files when a task needs org context, and runtime or project guidance may opt into a bounded startup summary. Keep recent.md to about 60,000 characters (roughly 15,000 tokens) so it stays a summary, not a log.
Topical files (decisions.md, rules.md) are the structured knowledge layer. Adopters pick which topical files to maintain — these are illustrative defaults, not protocol requirements.
Events (events/) are timestamped append-only entries. Agents write events during debriefs:
---created_at_utc: "2026-04-29T17:01:20Z"date: "2026-04-29"agent: claudeproject: my-projecttype: decisionrelated: ["PR #43"]---
Short description of what happened and why it matters.The coordinator curates recent.md and topical files from events. Agents append; the coordinator distills.
Use agent-memory org init to scaffold the directory and agent-memory event write to add events. Debriefs (debriefs/) are the full end-of-session records, append-only and filed by project and month; events distill what other agents need from them.
| Role | recent.md | Topical files | events/ | per-project memory |
|---|---|---|---|---|
| Agent | read | read | read + append | read + write |
| Coordinator | read + write | read + write | read + write | read + write |
Agents only write events (append-only). The coordinator owns curation. This keeps recent.md from drifting into a noisy log while still giving every agent a low-friction write path for new observations.
Available since v0.3.0.
The first two dimensions work on a single machine. The third lets the same memory follow you across machines using one plain git repository rooted at $OACP_HOME.
Memory sync has three states, gated by a single marker file at $OACP_HOME/.oacp-memory-repo:
| State | Trigger | Behavior |
|---|---|---|
| Disabled | No marker file | Startup hooks that pull memory do nothing. |
| Local-only | agent-memory enable (no --remote) |
Memory commits locally for audit history. No remote, no push. |
| Synced | agent-memory enable --remote <URL> or agent-memory clone <URL> |
Session start syncs both ways: allowlisted local changes are committed and pushed, upstream changes come down. agent-memory push publishes at any other time. |
Disabled is the default: scaffolding a home never creates the marker, so every OACP workspace stays Disabled until you opt in. The marker is the single source of truth — copy $OACP_HOME without it and every hook silently does nothing.
Since v0.5.0 the agent-memory CLI runs sync; OACP’s memory layout spec defines what syncs, and the tool owns how. agent-memory resolves the home from $AGENT_MEMORY_HOME, then $OACP_HOME; pass --home <path> to name it explicitly.
The git repo at $OACP_HOME uses a positive allowlist .gitignore. Two tiers sync, plus the ignore file and the marker at the home root:
$OACP_HOME/org-memory/**$OACP_HOME/projects/*/memory/**The canonical allowlist, byte for byte (agent-memory enable writes it as a managed block at the head of the home’s .gitignore):
*!*/!/.gitignore!/.oacp-memory-repo!org-memory/**!projects/*/memory/**projects/*/memory/.cache/# never sync private key material — explicit deny, wins over any future allowlist wideningkeys/Explicitly out of scope:
agents/ runtime state, status.yaml, inbox messageskeys/, denied at any depth.cache/ directories$OACP_HOME (e.g., a project’s local CLAUDE.md)Create the remote. Empty private repo on GitHub, GitLab, or any git host. The remote URL is the only piece of infrastructure you need.
Enable on machine A. Makes the home a git repository, writes the allowlist block, drops the marker, makes one commit, and pushes it:
agent-memory enable --remote git@github.com:your-org/oacp-memory.gitVerify the setup:
agent-memory doctorBootstrap machine B. Clone instead of enabling — --force moves a non-empty home aside before cloning:
agent-memory clone git@github.com:your-org/oacp-memory.git --home "$OACP_HOME" --forceWire the startup hook. In each repository, agent-memory setup claude (or codex) installs the runtime’s session-start hook — the script and its registration. It installs no separate push or session-end hook; the session-start sync itself publishes (step 6):
agent-memory setup claudeThe hook checks for the marker first and does nothing if memory sync is not enabled, so the same setup is safe on machines that have not opted in. oacp setup installs no memory hooks since v0.5.0; rerunning it retires the oacp-memory-pull.sh and oacp-memory-push.sh registrations earlier releases generated.
Daily flow. Session start syncs both ways; wrap-up publishes early:
agent-memory startup --pull. On a home with allowlisted local changes it commits them under the runtime’s name, rebases them onto upstream when behind, and pushes them, before printing the read manifest. A clean home only pullsagent-memory push, run explicitly, publishes the session’s writes now instead of at the next session start. There is no session-end hook; allowlisted changes left unpushed publish at the next session startBoth commands fetch first and never merge. Since agent-memory 0.1.3, both resolve a home whose local memory commits are behind upstream by rebasing them onto it (earlier versions refused). Only a plain pull on a clean home never pushes; every path that commits — push, pull --agent, and the session-start hook — also delivers.
agent-memory pull # clean homeagent-memory pull --agent claude # dirty home: commit allowlisted changes, sync, and pushpull needs a clean home and never pushes. A dirty home needs --agent NAME, which commits only what the allowlist selects, rebases onto upstream when behind, and pushes — the same delivery as push. The session-start hook’s agent-memory startup --pull supplies its runtime name as the agent, so a session start publishes a dirty home’s allowlisted changes.agent-memory pushagent-memory doctor checks the home’s setup: the debrief store’s layout and the sync repository. It reads no memory content and repairs nothing. agent-memory status reports which home resolved, whether its layout is in place, and where sync stands. oacp doctor reports the installed agent-memory version and leaves memory-home checks to it.
Run agent-memory doctor after enabling, on a new machine after cloning, and any time pull or push reports something you don’t recognize.
agent-memory disableRemoves the marker locally while leaving the repository and its history in place. Hooks become no-ops; rerun agent-memory enable to reactivate.
To stay scoped, the protocol explicitly avoids:
The three dimensions compose. A single agent session reads:
org-memory/recent.md — what happened across the org recentlyprojects/<project>/memory/*.md — what every agent on this project knowsagent-memory startup --pull) — the latest version of both, from any machine you’ve worked onWrites flow back the same way: events to org-memory/events/, decisions to per-project memory, then agent-memory push (or the next session-start sync) carries both to the remote so the next session — same agent, different agent, same machine, different machine — picks up where you left off.
OACP gives every agent in a project the same memory directory, $OACP_HOME/projects/<project>/memory/. Claude, Codex, Cursor, Gemini, and any other runtime read project_facts.md, decision_log.md, open_threads.md, and known_debt.md at session start. Stable outcomes are written back through merge decisions and a durable-memory promotion flow, so every agent works from the same context.
Org-memory is shared, cross-project memory at $OACP_HOME/org-memory/. It holds org-wide decisions, standing rules, and timestamped events that every project can read. recent.md is a rolling summary of current org state, and topical files such as decisions.md and rules.md are read when a task needs them. It complements per-project memory rather than replacing it.
Sync is opt-in. It makes $OACP_HOME a plain git repository that tracks only org-memory and per-project memory, with one private remote. Since oacp-cli 0.5.0 the agent-memory CLI runs it: enable sync once with a remote, clone it on each other machine, and let the session-start hook sync, which publishes allowlisted local changes and pulls upstream ones. Push at wrap-up to publish a session’s writes right away. Runtime state and inbox messages stay local.
No. Sync is opt-in and gated by a marker file at $OACP_HOME/.oacp-memory-repo. Without the marker, every sync hook does nothing. Per-project memory and org-memory still work locally; sync only adds cross-machine continuity.
Memory sync never merges. When only upstream moved, pull fast-forwards; when both machines committed, agent-memory 0.1.3 and later rebase the local memory commits onto upstream. A rebase conflict aborts, keeps the local commit, and names the conflicting paths for a human to resolve with git. A failed fetch leaves your files as they are, so agents keep working.
The normative layout — the per-project, org, and cross-machine tiers, the event and debrief schemas, the sync marker and allowlist — is the memory layout spec. What sync does with the allowlist is agent-memory’s contract: see its sync commands.
agent-memory command reference
Memory layout spec on GitHub