Search⌘ K
AI Features

System Prompt Structure and Instruction Hierarchy

Explore how the order and content of system prompts influence Claude's behavior in AI agents. Learn to write clear role statements, set scope boundaries, and balance instructions from system prompts, user turns, and tool descriptions. This lesson helps you design a four-section system prompt template for predictable, auditable AI responses, essential for reliable agent architecture.

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