Memory
Your canonical memory lives in memory/AGENTS.md and renders to each agent’s
native memory file — CLAUDE.md for Claude, AGENTS.md for OpenCode.
Compose from fragments
Section titled “Compose from fragments”Keep the top-level file small and pull in reusable pieces with @import:
# Coding conventions
@import ./fragments/style.md@import ./fragments/security-rules.md~/.agentsync/memory/├── AGENTS.md└── fragments/ ├── style.md └── security-rules.md…where each fragment holds a focused piece:
Prefer clarity over cleverness.Never log secrets.At apply time agentsync expands the imports and writes the fully-composed memory into each agent’s native file, wrapping each fragment in HTML-comment boundary markers (so the expansion can be reversed — see below):
# Coding conventions
<!-- agentsync:fragment style.md -->Prefer clarity over cleverness.<!-- /agentsync:fragment style.md --><!-- agentsync:fragment security-rules.md -->Never log secrets.<!-- /agentsync:fragment security-rules.md -->Edit a fragment once and every agent’s memory updates on the next apply.
The managed-file banner
Section titled “The managed-file banner”Every rendered memory file is prepended with a short agentsync notice — a blockquote naming the file and pointing edits back at the canonical source:
<!-- agentsync:managed memory-banner -->> **Managed by [agentsync](https://agentsync.cc) — do not edit `CLAUDE.md` directly.**> To change it, edit `.agentsync/memory/AGENTS.md` (or the relevant> `.agentsync/memory/fragments/*.md` fragment) and run `agentsync apply`.> Direct edits here are reported as drift and overwritten on the next apply.<!-- /agentsync:managed memory-banner -->
# Coding conventions…It nudges an agent (or a teammate) editing the native file toward the canonical source instead.
Per-agent rendering
Section titled “Per-agent rendering”| Agent | Native memory file |
|---|---|
| Claude Code | ~/.claude/CLAUDE.md |
| OpenCode | ~/.config/opencode/AGENTS.md |
| Codex | ~/.codex/AGENTS.md |
| Cursor | AGENTS.md (project root) |
| Gemini CLI | ~/.gemini/GEMINI.md (user) · GEMINI.md (project root) |
Memory is ✓ native on Claude, OpenCode, Codex, and Gemini CLI — the same
markdown, full fidelity (~/.codex/AGENTS.md for Codex, ~/.gemini/GEMINI.md for
Gemini). Cursor keeps user-level rules in app-local storage, so memory projects to
a project-root AGENTS.md only (◐). See the
capability matrix for detail.