CLAUDE CODE AGENTS: FUNDAMENTALS - Chapter 2, Exercise 1 Frontmatter vs. System-Prompt Body: Two Different Jobs ==================================================================================== QUESTION: Explain the difference in purpose between an agent's frontmatter and its system-prompt body, using this chapter's own terms. SOLUTION / EXPLANATION: The frontmatter is structured, machine-readable configuration - a fixed set of fields (name, description, tools, model) that control the agent's identity and its hard boundaries. These fields aren't instructions the agent reads and interprets; they're settings enforced around the agent before it even starts working. The tools field in particular is enforced structurally - a tool left off that list simply isn't available to the agent, regardless of anything written elsewhere. The system-prompt body, by contrast, is the agent's actual briefing - written in plain language, describing its role, how it should approach a task, and any conventions it should follow. This is content the agent reads and acts on, the way a new colleague would read a briefing document, rather than a hard constraint enforced around it. So the core distinction is: frontmatter defines what the agent structurally CAN do (its boundaries, enforced regardless of instructions), while the system-prompt body defines how the agent SHOULD behave within those boundaries (guidance it follows, not a hard limit). A well-designed agent needs both working together - tight, appropriate boundaries from the frontmatter, and clear, self-contained guidance from the body about how to act within them. -------------------------------------------------------------------------- WHY THIS WORKS AS AN ANSWER: It distinguishes structural enforcement (frontmatter, especially the tools field) from interpreted guidance (the system-prompt body) rather than treating both as just "settings," and explains why an agent needs both working together rather than either one alone.