OpenCode V2 documents instructions as privileged context. It combines built-in context, discovered AGENTS.md files, and dynamic sources such as skills, references, MCP, and session context. For durable project guidance, OpenCode recommends AGENTS.md.
OpenCode does not document a separate user-facing semantic memory database. Its session instruction deltas are runtime/session infrastructure and should not be treated as the primary migration source.
Global:
$XDG_CONFIG_HOME/opencode/AGENTS.md, normally ~/.config/opencode/AGENTS.md.Project:
AGENTS.md from the current Location up to and including the home directory when the Location is inside home.AGENTS.md below the Location can be discovered later when a tool reads or lists a target path.AGENTS.md files.OPENCODE_DISABLE_PROJECT_CONFIG=1 skips project AGENTS.md discovery but not the global file.MEMORY.md-style index. Nested AGENTS.md discovery is target-scoped instruction loading, not a pointer to separate memory bodies.instructions array in config, but current docs state those entries are parsed/retained and not resolved into active instruction sources.Recommended import order:
AGENTS.md files from root/nested directories.~/.config/opencode/AGENTS.md only with explicit user-scope opt-in.Suggested mapping:
config.pattern.discovery or config.manual unless they encode a durable project fact.Important importer behavior: