Tutto.Praxis · talking deck
Praxis: built from Anthropic's Claude with the Anthropic API

Building with the
API underneath
the chat window.

Eleven ideas, one per screen. This is the layer Claude Code and every other app sits on. Each slide is a thing to point at while you explain. Take the silences.

01
Tutto.The shape of the course
Where we're going

The whole course on one screen

Four moves: make the call, make it reliable, extend its reach, then compose the pieces into systems.

Make the call

  1. 1 Anatomy of a request
  2. 2 Shaping the output

Make it reliable

  1. 3 Prompt evaluation
  2. 4 Prompt engineering

Extend its reach

  1. 5 Tool use
  2. 6 Anthropic's own tools
  3. 7 RAG
  4. 8 Beyond text
  5. 9 Prompt caching

Build systems

  1. 10 MCP
  2. 11 Workflows vs agents
02
Tutto.Lesson 1 · Make the call
Lesson 1

One request, and the API forgets you

You send a model, an optional system line, and the whole message list. It replies once. There's no memory. To continue, you append the reply and send it all again.

request model · which Claude max_tokens · length cap system · who it should be messages[] · the conversation Anthropic API response an assistant message + stop_reason · why it stopped stateless: append the reply to messages[] and send the whole thing again

A "multi-turn conversation" is just this loop run by hand: the model holds nothing between calls, so the growing messages[] list is the memory. Same key, same shape, whatever language you call from.

Key conceptMinimum request = model + messages + max_tokens in the body, API key in the headers. Keep the key in an env var / .env, never hardcoded. → teacher notes (incl. web-app: key stays server-side).

03
Tutto.Lesson 2 · Make the call
Lesson 2

Four dials on the same request

You don't change the model to change the behaviour. You turn these.

system sets the role, rules and tone who it should be temperature 0 = steady, higher = looser how random streaming tokens arrive as they're made no waiting for the end structured force clean JSON, not prose output you can parse

The system prompt does the heavy lifting. It's where the role and rules live. Temperature trades reliability for variety; streaming is about feel; structured output is how you get data a program can actually use.

Key conceptFor clean JSON with no prose to strip, use forced tool use (tool_choice): define a tool whose schema is the shape you want, read back the validated object. → teacher notes (prefill+stop-sequences is the lighter, flat-JSON alternative).

04
Tutto.Lesson 3 · Make it reliable
Lesson 3

Stop guessing whether a prompt is good

An eval is a test suite for prompts: a set of cases, run automatically, graded, scored. Change the prompt, re-run, watch the number move.

Dataset test cases Run prompt on each Grade score each answer Score one number code-based model-based improve the prompt and run it again

Two ways to grade: code-based for anything exact (is it valid JSON? does it contain the answer?), model-based for judgement (is this tactful? is it on-topic?): you ask another Claude call to score it against a rubric.

Key conceptThe eval loop: build test cases → Claude generates responses → grade them → score → refine and re-run. The step after generation is grading; model-based grading uses another AI to judge. → teacher notes.

What's a "model grader"? The model-based half: another Claude call that scores an output against a rubric. The go-to when "right" is a judgement (tone, relevance, helpfulness) that code can't check exactly.

How far do you trust it? Write a clear rubric, have it return a one-line reason with the score, and check it against human marks on a sample before you lean on it across hundreds of cases.

05
Tutto.Lesson 4 · Make it reliable
Lesson 4

Four techniques, in order of leverage

When the output is wrong, you rarely need a bigger model. You need a clearer prompt. Reach for these in order.

Clear & direct say exactly what you want Specific spell out the details XML tags label the parts cleanly Examples show, don't just tell ↑ more leverage

Examples (few-shot) move quality the most: a couple of worked input→output pairs teach format and edge cases that paragraphs of instruction can't. XML tags matter because Claude is trained to respect them: <document>…</document> reads cleaner than quotes.

06
Tutto.Lesson 5 · Extend its reach
Lesson 5: if you take one thing away

Tool use is a round trip you complete

Claude can't run anything. It can only ask. You describe the tools; it replies "call this, with these arguments"; you run it and hand back the result; it continues.

Claude decides it needs a tool Your code runs the real function (API, database, math) Answer grounded in real data stop_reason: tool_use you send back a tool_result when it has enough You define each tool with a name, a description, and a JSON schema for its inputs.

The loop can repeat. Claude can call several tools across several turns before it answers. This single mechanism is what every agent is built on: the model proposes, your environment executes, the result comes back.

So a tool is a special Anthropic endpoint? No. There's one Messages endpoint. A tool is a plain function in your own code; Claude only ever returns a request to call it (name + arguments) and waits for your result.

Is it a config file that sets Claude's behaviour? No. A tool is your code, plus a declaration (name, description, input schema) that tells Claude the function is available, not how it should behave.

07
Tutto.Lesson 6 · Extend its reach
Lesson 6

Some tools you don't have to build

Most tools are yours to implement. A few ship with the API. You switch them on and Anthropic runs them server-side.

Your tools you write and run the code anything you can call: your APIs, your database, your business logic Anthropic's tools you opt in; the server does the work text editor edits files in place web search live results, cited code execution runs Python in a sandbox Fine-grained tool calling streams the arguments as they're generated, you can start acting before the full request is finished.

The text editor and code execution tools are exactly what powers Claude Code and the analysis features. The Files API lets a request reference uploaded files (PDFs, datasets) without re-sending them every call.

Key conceptThe code execution tool's main limit: it runs Python in an isolated sandbox with no network access. The Files API is the upload-once / reference-many store that also moves inputs in and outputs (charts) back out. → teacher notes.

08
Tutto.Lesson 7 · Extend its reach
Lesson 7

RAG: give it knowledge it was never trained on

You can't fit a whole knowledge base in one prompt. So you index it once, then retrieve only the few chunks each question needs and paste them in.

Once: build the index documents chunk embed index Per question: retrieve & answer question retrieve augment paste chunks in Claude answers Best retrieval combine two indexes: embeddings meaning & synonyms BM25 exact keywords & codes

Embeddings catch meaning ("car" finds "vehicle"); BM25 catches exact terms (an error code, a part number). A multi-index pipeline runs both and merges the hits. That's what production RAG actually does.

09
Tutto.Lesson 8 · Extend its reach
Lesson 8

The same API takes more than text

Four capabilities ride on the request you already know: two change what goes in, two change what comes out.

Richer inputs Images read charts, screenshots, photos PDFs text and layout, page by page Richer outputs Thinking reasons first, then answers Citations points to the source it drew the claim from

Extended thinking gives the model room to work through hard problems before committing to an answer. Citations turn "trust me" into "here's the passage", the backbone of any answer a business has to stand behind.

Key conceptPDF vs image: a PDF is read as text and images (a document block, supports citations); an image is vision-only. PDFs cost more per page but give the richer, citable understanding. → teacher notes.

10
Tutto.Lesson 9 · Extend its reach
Lesson 9

Pay for the long part once

Most prompts start with the same big block: a system prompt, tool definitions, a document. Cache that prefix and later calls read it instead of re-paying for it.

First call · writes the cache stable prefix: system, tools, documents (cached here) today's question cache breakpoint Later calls · read the cache same prefix: read from cache, far cheaper & faster next question cost ↓↓

The rule: only an exact, unchanged prefix is reused, so put everything stable first and the variable part last. Cache lifetimes are short (minutes), so it pays off across a burst of related calls, the heart of any responsive, repeated-context app.

Key conceptCaching needs two things: mark the block cache_control: ephemeral and clear the minimum length (~1,024 tokens on Sonnet 4.x, ~4,096 on Opus 4.5+). Under the minimum it silently runs uncached, with no error. → teacher notes.

11
Tutto.Lesson 10 · Build systems
Lesson 10

MCP: one standard plug for tools and data

Without it, every app wires up every integration by hand. With it, a server exposes its capabilities once and any client can connect.

Claude Code your app clients MCP one shared protocol A server exposes tools: actions to call resources: data to read prompts: ready-made flows

A server publishes three things (tools, resources, prompts) and the inspector lets you test it before wiring it to a client. Build the integration once; plug it into Claude Code, your own client, or anyone else's.

Exposing document contents? That's a resource: read-only data Claude can pull in. Actions it performs are tools; pre-tested instructions (like a formatter) are prompts.

Defining a tool in Python? Easiest way is the @mcp.tool() decorator (FastMCP). The function's name, docstring and type hints become the tool, no schema by hand.

How do client and server talk in dev? Almost always stdio: the client runs the server as a subprocess over stdin/stdout. No ports, no auth. HTTP is for remote.

Why three primitives, not one? Different owners. Model picks tools, the app loads resources, the user invokes prompts, so each is offered the right way.

12
Tutto.Lesson 11 · Build systems
Lesson 11

Workflows vs agents: who decides the path

Both chain LLM calls. The difference is control: in a workflow you wire the steps; in an agent the model chooses them as it goes.

Workflows: you fix the path chain · step after step route · pick one branch parallel · run at once, merge Agent: the model decides the path think act observe loops against its environment

Choose by predictability. If you can draw the steps in advance, a workflow is cheaper and more reliable. If the path depends on what's found along the way, you need an agent. Claude Code is one. Most production systems mix both.

Want it to handle the unexpected? Give the agent a few general tools and let it pick, not one narrow tool per case you predicted. General tools recombine into paths you never scripted.

One long prompt it keeps half-ignoring? Chain it. Split the rules across a few small steps so each call holds less, and check the output between them.

13
Tutto.Praxis
The whole thing, in one line

Make the call. Trust it.
Give it reach.
Compose it into systems.

A stateless request is the unit. Evals and prompting make it reliable; tools, RAG and the model's own capabilities give it reach; MCP and the workflow-vs-agent choice are how you build something real.

tutto.one/praxis · daniel@tutto.one

14
← → or space · F11 fullscreen