Skip to content

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.

Keep the top-level file small and pull in reusable pieces with @import:

~/.agentsync/memory/AGENTS.md
# Coding conventions
@import ./fragments/style.md
@import ./fragments/security-rules.md
layout
~/.agentsync/memory/
├── AGENTS.md
└── fragments/
├── style.md
└── security-rules.md

…where each fragment holds a focused piece:

~/.agentsync/memory/fragments/style.md
Prefer clarity over cleverness.
~/.agentsync/memory/fragments/security-rules.md
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):

~/.claude/CLAUDE.md (rendered by apply)
# 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.

Every rendered memory file is prepended with a short agentsync notice — a blockquote naming the file and pointing edits back at the canonical source:

~/.claude/CLAUDE.md (rendered by apply)
<!-- 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.

AgentNative memory file
Claude Code~/.claude/CLAUDE.md
OpenCode~/.config/opencode/AGENTS.md
Codex~/.codex/AGENTS.md
CursorAGENTS.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.