Skip to content

Context Architecture

Every Claude Code session draws context from multiple sources that layer on top of each other. Understanding how they relate is critical.

Claude Code auto-loads only CLAUDE.md from the project root at session start. This is Claude Code’s built-in mechanism for persistent project context. AGENTS.md is not auto-loaded — despite the name suggesting otherwise.

Our recommended approach is to create AGENTS.md using Shopify’s official Liquid rules from theme-liquid-docs/ai/liquid.mdc as a starting point, then symlink CLAUDE.md to it:

Terminal window
ln -s AGENTS.md CLAUDE.md

This ensures Claude Code loads your rules (via the CLAUDE.md symlink) while keeping AGENTS.md as the editable source of truth.

Context comes from four layers. The platform agent is the key differentiator — it carries all platform-specific conventions that commands reference at runtime.

LayerSourceQuestion It AnswersMaintained By
1CLAUDE.md”What is this project? What are the base coding rules?”Engineers (local)
2Platform agent”How do I build for this stack? What are the component patterns, file structure, validation rules?”Engineering Leadership (MCP server)
3Dev MCP conventions”What universal rules apply to all projects? How do I use the MCP toolchain?”Engineering Leadership (MCP server)
4CONVENTIONS.md”What exists in this project right now? What are the token values, component APIs, icons?”Claude Code + Engineers (local)
Knowledge typeWhere it livesWhy
Liquid snippet/block/section rulestheme-developer agentPlatform-specific — only relevant for Liquid themes
React/Remix component ruleshydrogen-developer agentPlatform-specific — only relevant for Hydrogen
GraphQL organization, Sanity patternshydrogen-developer agentPlatform-specific
”No hardcoded values”, “extract icons from Figma”Dev MCP conventionsUniversal — applies to all platforms
MCP toolchain (Figma, Playwright, Context7)Dev MCP conventionsUniversal — same tools for all projects
Project token values, component inventoryCONVENTIONS.mdProject-specific — varies per project
Session starts
CLAUDE.md auto-loaded → project type, tech stack, base rules
Platform agent activated → component patterns, build rules, validation
get_conventions loaded → universal rules, MCP toolchain, communication style
CONVENTIONS.md read → tokens, component library, icons, logos
Engineer runs a command (e.g. "build")
│ → Command references "the active agent" for platform details
Composition plan output
│ → Uses the agent's component taxonomy and plan fields
Build phase (composing from existing primitives, bottom-up)
│ → Follows the agent's build order and creation rules
CONVENTIONS.md updated (if new components were created)
Playwright visual QA against design reference