ZCode should treat ~/.zcode/AGENTS.md as the user's default instruction file and merge it with the workspace AGENTS.md resolved for the current session.
workingDirectory upward until the detected project root, or filesystem root when no project root is detected.~/.zcode/AGENTS.md.HOME resolves the user directory first. On Windows-style environments, USERPROFILE is used when HOME is absent. If neither is set, Node's homedir() is used.priorityFiles includes AGENTS.md. Custom priority sets that omit AGENTS.md must not load ~/.zcode/AGENTS.md.When both sources exist, ZCode injects both in this order:
~/.zcode/AGENTS.md.AGENTS.md.Workspace instructions appear later so they can narrow or override broad user defaults for work inside the repository.
Each loaded source renders as its own block inside the context_prefix announcement, in merge order:
Contents of <path> (user's private global instructions for all projects):Contents of <path> (project instructions, checked into the codebase):The full shape (fixed preamble, Project Memory index, order against other announcements) is defined in
docs/design/v2/loop/meta-user-context.md. This document only owns source resolution and merge order.
ResolvedUserInstructions keeps its historical single-source fields for compatibility, while also exposing a sources array for multi-source rendering. Existing callers that only inspect filePath or content continue to receive a deterministic primary path and merged content.