11 minute read

21 min read 4335 words

When I started using Claude Code with Claude Opus 5.5 and Claude Fable 5.1, I had a simple question: when the agent builds or runs my code, where does that happen? On my laptop, or on Anthropic’s servers?

The short answer is both, but for different jobs. The model thinks on Anthropic’s servers. The tools run on your machine. This post explains how that works, step by step, with diagrams. I keep the language simple, and I explain each new word the first time it appears.

What you will learn:

  • The two places where work happens: your machine and Anthropic’s cloud
  • The agent loop: how one task becomes many small steps
  • Exactly what data leaves your machine, and what stays
  • Why choosing Opus or Fable doesn’t change where anything runs
  • How a cloud session is different from a local session
  • When your hardware matters for speed, and when it doesn’t

1. The Big Picture: Two Places, Two Jobs

Claude Code is made of two parts that talk to each other over the internet:

Part Where it lives What it does
The model (Opus 5.5 or Fable 5.1) Anthropic’s servers Reads the conversation, thinks, writes text, and decides which tool to use next
The Claude Code app (CLI, desktop app, or IDE extension) Your machine Shows you the chat, runs the tools the model asks for, and sends results back

A tool is an action the app knows how to do: run a shell command, read a file, edit a file, search the code, open a web page, and so on.

In simple words: the model is the brain, and it lives in Anthropic’s cloud. Your machine is the hands. The brain says “run dotnet test”, and your machine runs it.

YOUR MACHINE ANTHROPIC'S CLOUD Claude Code app chat window, permissions, agent loop Tools shell, read/edit files, search, browser Your project & toolchain source files, git, .NET, Node, Docker, CPU, RAM, disk Anthropic API receives each request over HTTPS The model Opus 5.5 or Fable 5.1 thinks, writes, picks the next tool No access to your disk. It only sees what the app sends. conversation + tool results reply + tool calls
Figure 1. The model thinks in Anthropic's cloud. The tools run on your machine.

One important detail: the model can’t touch your disk. It never connects to your machine. It only sees the text the app sends to it. If the app never reads a file, the model never sees that file.


2. The Agent Loop, Step by Step

An agent is a model that can use tools in a loop: it looks at the task, uses a tool, looks at the result, and decides what to do next. It keeps going until the task is done.

Let’s follow one real request: “Fix the failing test.”

You Claude Code app your machine Tools your machine Model Anthropic's cloud ① "Fix the failing test" ② request + instructions + tool list LOOP: repeat while the model asks for tools ③ tool call: run "dotnet test" ④ check permission, run runs on your CPU ⑤ output: "1 test failed" ⑥ tool result (the output text) ⑦ tool call: edit PriceCalculator.cs ⑧ write file to disk ⑨ "edit applied" … run tests again, and so on ⑩ final answer (no more tool calls) ⑪ shows you the result
Figure 2. One task becomes a loop of small round trips between the app and the model.

Here is what happens at each step:

  1. You type a request in the Claude Code app.
  2. The app sends a request to the Anthropic API. It includes your message, the app’s instructions to the model (the system prompt), and a list of tools the model may use.
  3. The model replies with a tool call. A tool call is a small, structured message like “use the Bash tool with the command dotnet test“. The model does not run anything. It only asks.
  4. The app checks permissions and runs the tool on your machine. Depending on your permission mode, it may ask you first (“Allow this command?”).
  5. The tool produces output, for example a test failure message.
  6. The app sends that output back to the model as a tool result.
  7. The model reads the result and asks for the next tool, for example “edit this file”.
  8. The app edits the file on your disk.
  9. The app reports back that the edit worked.
  10. The loop repeats (run the tests again, read another file, …) until the model decides the task is done and writes a final answer without a tool call.
  11. The app shows you the answer.

Key idea: every arrow to the right of the app is a network round trip to Anthropic. Every arrow between the app and the tools stays on your machine.


3. What Data Leaves Your Machine?

This is the part I wanted to understand most. The rule is simple:

Only what goes into the conversation is sent to Anthropic. Everything else stays on your machine.

STAYS ON YOUR MACHINE • Files the agent never opened • The running of commands (builds, tests, servers, Docker) • Your installed SDKs and tools • CPU, memory and disk work • Files the agent creates or edits (the result lands on your disk) The model can't reach any of this unless the app sends it. HTTPS each turn SENT TO ANTHROPIC • Your messages • The system prompt and tool list • Contents of files the agent read • Command output (stdout/stderr) • Search results, web page text • The model's own earlier replies In short: the whole conversation so far, every time.
Figure 3. The conversation crosses the network. Your machine's work does not.

Some practical points:

  • If the agent reads a file, its contents are sent. This includes .env files or secrets if the agent opens them. Be careful what you ask it to read, and use permission rules to block sensitive paths.
  • Command output is sent, not the command’s work. A 5-minute build runs on your CPU. Only the text it prints (for example, “Build succeeded” or an error list) goes to the model.
  • The model’s edits are written by your machine. The model sends the new text of the file, and the app writes it to your disk.

The whole conversation is sent every turn

The Anthropic API doesn’t remember anything between requests. So on every round trip, the app sends the whole conversation so far, not just the newest message. That is how the model “remembers” what it did three steps ago.

Request 1 prompt Request 2 prompt tool call + result Request 3 prompt tool call + result tool call + result Request 4 prompt tool call + result tool call + result tool call + result already sent before (often reused from cache) new in this request
Figure 4. Each request carries the full history. The new part is shown in violet.

Two features keep this fast and affordable:

  • Prompt caching: the server can reuse the unchanged beginning of the conversation instead of processing it again from scratch.
  • Compaction: when the conversation gets too long for the model’s context window (the maximum amount of text it can read at once), Claude Code summarizes the older parts so work can continue.

This is also why very long sessions can feel slower: there is simply more text to send and read on every turn.


4. Does Choosing Opus 5.5 or Fable 5.1 Change Anything?

It changes which brain answers. It doesn’t change where anything runs.

YOUR MACHINE (same either way) Claude Code app Same tools, same files ANTHROPIC'S CLOUD Claude Opus 5.5 model: claude-opus-5-5 Claude Fable 5.1 model: claude-fable-5-1 model ID in each request
Figure 5. Switching models swaps the brain. The hands stay the same.

When you pick a model in the app, Claude Code puts that model’s ID in every API request. The agent loop, the tools, the permission checks, and the files on your disk are exactly the same. Different models can differ in quality, speed, and price, but the workflow and the data flow in this post apply to every model.


5. Local Session vs Cloud Session

So far we talked about a local session: you run Claude Code on your own machine. There is a second option, a cloud session (for example, Claude Code on the web, or moving a desktop session to the cloud). In a cloud session, the tools run somewhere else.

Local session YOUR MACHINE App + tools Your repo ANTHROPIC Model Commands use your CPU and your files. Results land on your disk right away. Cloud session YOUR MACHINE just a browser or the app UI ANTHROPIC'S CLOUD Sandbox container app + tools + copy of your repo Model Commands run in the container, not on your machine. Changes come back as a git branch or a pull request.
Figure 6. In a cloud session, the "hands" move into a sandbox next to the model.
  Local session Cloud session
Where the model runs Anthropic’s cloud Anthropic’s cloud
Where commands run Your machine A sandbox container at Anthropic
Which files it sees Your real working folder A copy of your GitHub repo
Which tools are installed Whatever you installed Whatever the cloud environment has
How you get the changes They are already on your disk A pushed branch or pull request
Can keep working when your laptop is closed No Yes

Rule of thumb: use a local session when the task needs your machine (local databases, your SDKs, the iOS Simulator, private files). Use a cloud session for self-contained work that should keep going without your laptop.


6. Subagents Follow the Same Rule

Claude Code can start subagents: helper agents that take a smaller piece of the task (like “search the repo for every place we call this API”) and report back. Each subagent has its own conversation with the model, but its tools still run in the same place as the main session.

YOUR MACHINE (local session) Main agent Subagent A Subagent B starts Toolsevery agent's commands run here ANTHROPIC'S CLOUD conversation 1 → model conversation 2 → model conversation 3 → model own context own context own context
Figure 7. More agents means more model conversations, but all the commands still run on your machine.

This matters for two reasons. Many subagents running builds at the same time can put real load on your machine. And each subagent only sends its own conversation to the model, which keeps every context small and focused.


7. Does My Hardware Make the Agent Faster?

Now we can answer the speed question with the picture from Figure 2. A task’s time is split into three kinds of work:

  1. Model time: the model reads the conversation and writes its reply. This happens on Anthropic’s servers. Your hardware has no effect here.
  2. Network time: sending each request and getting the reply. Your internet connection matters here.
  3. Tool time: builds, tests, installs, searches. This happens on your machine. Your CPU, RAM and disk matter here.
Small edit to a static website → almost all model time Big .NET solution: build and run tests → big tool blocks: a faster machine helps here model (Anthropic) network tools (your machine)
Figure 8. Where the time goes depends on the task. Illustrative, not measured.
Your machine affects Your machine does NOT affect
How fast builds, tests and installs run How fast the model thinks and writes
How fast large repos are searched How smart the answers are
How smoothly the app, browser pane and simulators run together Which model you get (a new laptop and an old one get the same Opus)

Other things that change speed more than hardware: the model you choose, fast mode and effort settings, how long the conversation has become, and your network.


8. Putting It All Together

Here is the whole flow in one list:

  1. You type a request into Claude Code on your machine.
  2. The app sends the conversation to the Anthropic API, with the model ID you picked (Opus 5.5, Fable 5.1, …).
  3. The model thinks in Anthropic’s cloud and replies with text or a tool call.
  4. The app runs the tool on your machine (local session) or in a sandbox (cloud session), after checking permissions.
  5. The tool’s output is added to the conversation and sent back to the model.
  6. Steps 3–5 repeat until the model gives a final answer.

9. Cheat Sheet

Question Answer
Where does the model run? Always on Anthropic’s servers
Where do my commands and builds run? On your machine in a local session; in a sandbox container in a cloud session
Can the model read my disk directly? No. It only sees what the app puts into the conversation
What gets sent to Anthropic? Your messages, the files the agent reads, command output, and the model’s own replies
Does Opus vs Fable change the workflow? No. It only changes which model answers
Does my hardware make the agent smarter? No
Does my hardware make the agent faster? Only for tool work (builds, tests, installs, searches)
What if a tool isn’t installed on my machine? The command fails in a local session, the same as if you ran it yourself

The one sentence to remember: the brain is in the cloud, the hands are where your session runs.

Leave a comment