Search⌘ K
AI Features

System Prompt Structure and Instruction Hierarchy

Explore the impact of instruction order within system prompts on Claude's responses. Understand how to write clear role and scope statements, balance instructions from system prompts, user input, and tools, and apply a four-section prompt template to enhance agent reliability and behavior predictability.

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 ...

Why order matters