We started building a real agent today. Before the code, one idea that does most of the work: the system prompt.
1. What a System Prompt Is
The constant context you give the model: its role, tone and rules. The user’s questions change with every turn; the system prompt doesn’t.
The practical lesson: when an agent misbehaves, fix the system prompt before you touch the code. It’s faster, cheaper and usually the actual problem.
2. Same Idea Everywhere
We drove the point home with the same trick on three platforms:
- Claude: tutor styles
- OpenAI Playground: a professional, calm customer-care agent for a food-delivery app
- Google AI Studio (Gemini Flash): thinking levels, and a deliberately sarcastic persona
Identical question, wildly different answers. Nothing changed but the system prompt. The sarcastic-aunt persona was the joke, but it makes the point better than a polite one would: the model has no fixed personality of its own.
3. Today’s Build: The Tutor Agent
An agent that adapts its teaching style to what the learner needs:
| Mode | For |
|---|---|
| Detailed explanation | Learning a topic from scratch |
| Quick revision | Prepping for an exam or interview |
| Explain like I’m 10 | No background knowledge at all |
One agent, three system prompts. That’s the whole design.
4. query or client?
query— no memory needed. One question, one answer. We’re using this today.ClaudeSDKClient— use it when the conversation has to remember earlier turns.
Start with query. Add the client only when you actually need continuity.
5. Setting the System Prompt in Code
from claude_agent_sdk import query, ClaudeAgentOptions
options = ClaudeAgentOptions(
system_prompt=(
"You are a patient tutor. Explain concepts to a complete beginner, "
"using simple language and one concrete example."
),
max_turns=1,
)
async for message in query(prompt="What is an API?", options=options):
print(message)
Change the string, change the agent. No other code moves.
6. Project Setup
mkdir claude_demo_agents
cd claude_demo_agents
uv init .
uv add claude-agent-sdk python-dotenv ipykernel
code .
Then create a tutor/ folder with exercise1_message_exchange.py, and copy your .env in at the project root.
ipykernelis what lets you run notebooks in this project.- Every project gets its own dependencies. Installing system software (via
aptorbrew) is not the same as adding a library. Project-level isolation is what stops one project breaking another. - Select the right interpreter in VS Code: Command Palette (Ctrl+Shift+P, or Cmd+Shift+P on Mac) → Python: Select Interpreter → pick the one inside this project’s
.venv. Wrong interpreter is the most common cause of “but I installed it!” - Keep your key in
.env, load it withload_dotenv()andos.getenv, and drive the script fromif __name__ == "__main__":.
7. API Keys
- A Claude API key is needed for these exercises. About $5 (₹500) is enough to work through them.
- No key yet? Gemini has a free tier via Google AI Studio and the concepts are identical, though the class code will be Claude-specific.
✅ Action Items
- Install uv if you haven’t, then set up the project exactly as above.
- Get your Claude API key loaded from
.env. - Write the three tutor system prompts and run the same question through each. Notice how much the answer changes.
- New students: watch the previous four recordings to get your environment ready before the next session.
⏭️ Next up: message streams and options, then giving the tutor agent memory.

1 comment