System Prompt Structure and Instruction Hierarchy
Explore how to structure system prompts for Claude agents by ordering instructions effectively, writing clear role and scope boundaries, and balancing inputs from system prompts, user turns, and tool descriptions to maintain predictable, auditable AI behavior.
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 ...