Skip to content
The AI Agent Factory

30.1 One model, many surfaces

Approved by
Panaversity ·
18 min read

In everyday life. You give two friends your mother's recipe for lentils. One friend cooks it at home, with only what the recipe says. Another gives it to a restaurant kitchen. The kitchen has its own rules for every dish, a shelf of house spices, and a notebook of what this guest liked last time. Both dishes come from the same words, and they taste different. In this section, the recipe is your prompt, and the home cook is the Messages API. The restaurant is an app that adds its own instructions, files and memory.

What you will learn. You practice this in Lab 30, Task 0, where you fill row 1 of the table.

  • What does Claude receive on each surface?
  • Why can a prompt that worked in a Claude project answer differently from your code?
  • What does the Agent SDK add, and what does it load by default?
  • What changes on a cloud platform?
  • What goes in row 1 for each environment?

Why it matters. The model is the same on every surface. What surrounds your words is not. An answer you saw on one surface is evidence about that surface only.

At work. On Monday morning Ana sends you the extraction prompt's next version. "It read my phone photos well in my project," she writes. Before you send the same words through the worker's code, you list what her project put around them that your code will not.

What does Claude receive on each surface?

On the Messages API, only what your request holds. On every other surface, the product adds something. The exam guide asks how Claude "interprets instructions on different surfaces".1 Here a surface is any product or service through which a request reaches the model. That is wider than in 2.4, where a surface was the way a product runs work, by chat or by an agent.

Figure 30.2. The same words, sent four ways. The model is the same. What each sender wraps around the words is not.

SurfaceWhat Claude receives besides your wordsWhat follows for you
The Messages APIOnly what your request holds: your system prompt, your messages, your toolsNothing is added and nothing is remembered. If the model should know it, send it
The Claude appsAnthropic's own system prompt. In a project, the project's instructions and files. Memory from earlier chatsThe same prompt in the app and through the API can give different answers
Claude CodeIts own system prompt, then CLAUDE.md files, settings, tools and skills (Chapter 12)A rule for a coding session goes in CLAUDE.md or a setting, not in an API prompt
The Claude Agent SDKA minimal system prompt unless you ask for more, and the settings files that settingSources namesAsk for the system prompt you want, and name the settings it may load
The hosted workerThe worker's instructions in agents/ap-worker.md, on every session (23.4)A change to the instructions is a change to that file, reviewed and applied
The cloud platformsThe same model through another company's service, with its own keys, regions, prices and model idsSome features are missing or work differently. Check each one you use before you choose the route

The Claude apps are claude.ai, the desktop app and the mobile app. They add Anthropic's system prompt "at the start of every conversation", and Anthropic says that "These updates do not apply to the Claude API."2 Claude Code's instructions arrive in two parts. It has its own system prompt. CLAUDE.md comes after it: "CLAUDE.md content is delivered as a user message after the system prompt, not as part of the system prompt itself."3

Why can a prompt that worked in a Claude project answer differently from your code?

Because the project put three things around it that your code never sends.

  • Anthropic's system prompt. Anthropic publishes one version of it. "Other chats, including those with web search turned on, use other versions, which these pages don't publish."2 So you cannot always read everything Ana's chat was given.
  • The project's instructions and files. "Claude will use these instructions for all the chats within the project." Anything uploaded to the project "will be used across all of your chats within that project."4
  • Memory. "Claude can also remember context from your chats and carry it into new conversations …" And "Each project has its own memory."5

So a good answer in Ana's project is a try, never a test. Some of what made it good may be in her project and not in the prompt. The fix is the API's rule: if the extraction needs it, put it in the request. In practice that means the prompt file the worker sends, which the suite reads (25.1). Ana's try still has value. It told you which version to test next.

What does the Agent SDK add, and what does it load by default?

Less than you may expect in the system prompt, and more than you may expect from settings. With no system prompt set, "the SDK uses a minimal prompt that covers tool calling but omits the rest of the claude_code preset's content, including its security and safety instructions."6 If you want Claude Code's own system prompt, ask for the claude_code preset by name.

CLAUDE.md is a separate switch, settingSources. Left out, it loads user, project and local settings, and CLAUDE.md with them. Only an empty list stops it (30.5).7

One more trap. If you resume a saved session with a changed system prompt, "Claude doesn't see it on the next turn".6 It takes effect after compaction, when the SDK summarizes the older part of a long conversation (22.7), or in a new session. To change instructions in a running session, "send the new instructions in the conversation instead of changing systemPrompt".6

What changes on a cloud platform?

The model is the same. The service around it, and some of its features, are not. The routes have their own names today.

  • Amazon Bedrock, with two endpoints. bedrock-mantle serves the Messages API, and bedrock-runtime serves Amazon's own request forms. Model ids there carry an anthropic. prefix.8
  • Claude Models on Google Cloud, in two kinds: Google managed and Anthropic managed. For Google managed, "Google sets the lifecycle dates", and they "can differ from the Claude API schedule".9
  • Claude Platform on AWS, which Anthropic runs with the Claude API's own model ids. New features arrive "Typically same-day as Claude API".10
  • Microsoft Foundry, where "The deployment name you choose becomes the value you pass in the model parameter".11

Know the routes and how they differ. Some of the differences change this chapter's rows. Bedrock and Google managed have no Files API, which matters in 30.3.89 Bedrock, Google managed and Foundry have no server-side fallback, which matters in 30.4.8911 So check every feature you use on the route you plan to use.

What goes in row 1 for each environment?

Who sends each request in that column, what that sender adds, and how you prove it. The extraction is one Messages API call from your code, so it adds nothing in any column. The hosted worker does add something, its agent file.

Row 1: who sends, and what it addsDevelopmentStagingProduction
The extractionThe worker's code, through the SDK, with the staging key. Adds nothing. By a person: the request in the local logThe portal's morning job calls the Messages API. CI's suite on recorded answers sends nothing. Its live job runs only when the prompt, the model or the golden set changes (Lab 24)Same, in the production workspace
The hosted workerNot run hereAdds agents/ap-worker.md. Proof: claude-lock.staging.json, the agent's versionSame. Waiting: claude-lock.production.json, made by the production apply
The Claude project Ana usedAdds Anthropic's system prompt, the project's instructions and files, and memory. By a personNot hereNot here

Ana's project is a place whose proof can only be "by a person". Nothing in the repository records what her project added, so the check has nothing to compare.

The operating rule: if the model should know it, put it in the request. Treat a result on another surface as a try, and write in row 1 who sends each request and what it adds.

Do this now. Ask your coding agent to list every sender in a project you already have. Copy this line:

List every place in this project where a request goes to a model. For each one, say which product or service sends it, what that sender adds besides the request's own system prompt and messages, and which file shows it. Mark each place where you cannot tell what is added. Change no file.

Check yourself

Question 1 / 6

0 answered

Ana's extraction prompt reads invoice photos well in her Claude project. Sent through the worker's code on the Messages API, the same words give different fields. What is the most likely reason?

  1. Claude Certified Developer - Foundations Exam Guide, version 1.1, Anthropic.↑
  2. System prompts, Claude release notes, Anthropic.↑↑2
  3. How Claude remembers your project, Claude Code docs, Anthropic.↑
Owner
Panaversity