graph TD
subgraph Context
M[<b>Model System Prompt</b><br/>'You are a helpful assistant...']
A[<b>Agent System Prompt</b><br/>Tool definitions + Hierarchy]
G[<b>Global Instructions</b><br/>'~/.gemini/GEMINI.md' or '~/.agents.md']
L[<b>Local Instructions</b><br/>'./GEMINI.md' or './agents.md']
U[<b>User Context / Persona</b><br/>'Act as Hadley Wickham...']
H[<b>Conversation History</b><br/>Past messages, tool outputs]
P[<b>User Request</b><br/>'Fix this bug']
end
LLM[LLM Reasoning Engine]
M --> A
A --> G
G --> L
L --> U
U --> H
H --> P
P --> LLM
5 The Core Brain: Models and Prompts
The most fundamental part of any coding agent is the Model—the “brain” that processes your requests. However, the model doesn’t work in a vacuum; it is wrapped in an Agent Harness (e.g. OpenCode, Claude Code, Codex, Google Antigravity CLI, many others).
5.1 Models
In this workshop we are going to use a variety of models, at the link below you can see a comparison of the characteristics, performance, and costs of the models we will be using, as well as some other popular models that you can try on your own.
5.2 Model vs. Agent System Prompts
An agent’s behavior is governed by layers of instructions. It is helpful to distinguish between the instructions given to the model and those that define the agent harness.
5.2.1 The Model System Prompt
This is the base set of rules provided by the model provider (e.g., OpenAI, Anthropic, Google). It typically contains safety guidelines and a persona like “You are a helpful AI assistant.” These instructions are often “hard-coded” or pre-configured by the provider before the agent harness adds its own layer.
5.2.2 The Agent System Prompt
The Agent Harness (the software you use to interact with the model) provides its own set of instructions. Depending on the harness, these might include:
What it is (e.g. “you are OpenCode, an agent that can read and write files, run code, and use tools to help users with coding tasks”).
How to use tools (like reading files or running bash commands).
Where and how to access documenatation on how to configure the agent harness (that is, you can actually ask most agent harnesses to change certain settings by asking them using natural language.)
Key Insight: The agent harness often does not have access to the underlying Model System Prompt. They are separate layers of instruction that are combined (concatenated) before being sent to the LLM provider that does the actual processing.
5.3 Configuration Files: Global and Local Instructions
The behavior of an agent harness is often guided by specific configuration files that provide context about you and your project. In our workshop, we focus on a hierarchy of Instruction Files (typically named GEMINI.md for Google’s models, CLAUDE.md for Anthropic’s models, and AGENTS.md for most other agents including OpenAI Codex).
5.3.1 Global vs. Local Instructions
Harnesses typically look for instructions at two levels:
Global Instructions (
~/.gemini/GEMINI.mdor~/.agents/AGENTS.md): These are your personal preferences that follow you across all projects. They might include your preferred coding style (e.g., “I always use the Tidyverse”), your language preferences, or general rules about how you want the agent to communicate.Local (Project) Instructions (
./GEMINI.mdor./AGENTS.md): These are specific to a single repository. They define the overall project architecture, naming conventions, and project-specific workflows. Local instructions usually take precedence over global ones for that specific project in case of a conflict.
This may differ from agent to agent, so refere to the documentation of the specific agent harness (OpenCode, Antigravity CLI, Gemini CLI, Claude Code, Codex), or just as the agent itself.
5.4 Prompt Layering Architecture
The final prompt sent to the LLM service is a “sandwich” of different instruction layers. Understanding this hierarchy helps you write better prompts and understand agent behavior.