System Prompt Structure and Instruction Hierarchy
Explore how to design system prompts that guide Claude's behavior effectively. Understand the importance of instruction order, role and scope definitions, and how Claude integrates instructions from prompts, user inputs, and tool descriptions to produce reliable AI outputs.
Every agent built in this course has had a system prompt. Until now, we treated it as a single block of text. This lesson examines its internal structure: how instruction order affects what Claude prioritizes, how to write role and scope instructions that shape the entire conversation, and how Claude resolves conflicts when the system prompt, the user turn, and the tool descriptions all contain instructions that point in different directions. By the end of this lesson, we will be able to:
Explain why instruction order in the system prompt affects Claude’s behavior
Write a role statement and scope boundary that set the agent’s operating envelope
Identify the three sources of instructions in an agent and how Claude weighs them
Apply a four-section system prompt template that produces predictable, auditable behavior ...