What's actually happening when I open Claude?

A chat over three days, kept as it went: the questions as they were asked, tidied, the answers cut down, figures put in, and what turned out wrong marked where it was said.

  1. 01A harness
  2. 02Without a brain
  3. 03How it seems to decide
  4. 04Anything without a model
  5. 05Scopes
  6. 06Another binary in my project?
  7. 07What goes where
  8. 08One folder?
  9. 09Who follows the link
  10. 10Harness in memory, brain an API?
  11. 11Too many apps
  12. 12Cores
  13. 13Eight cores, eight apps?
  14. 14An M1 Pro
  15. 15The GPU
  16. 16Seeing PIDs
  17. 17Dissecting Brave, and threads
  18. 18Shell or bash
  19. 19The shell in /bin
  20. 20User or personal
  21. 21Machine code to electrons
  22. 22Understand but don't
  23. 23Where it started
  24. 24True and false
  25. 25Algebra
  26. 26Opening Claude as true or false
  27. 27Decoding, and what we see
  28. 28The letter A
Left outThe opening turn, picking up from the chat before, and its recap.
01 · You

I just had a realisation, or a better understanding, of a harness and an LLM. I saw a video where someone used Kimi K3 with Claude Code and it hit me: Claude Code is a harness. I knew it was a harness, but I didn't really think about it. I can literally remove a brain (Opus, Sonnet, whatever) and put in any other model… huh, go figure!

Claude

That's the click. Claude Code the app, the terminal program with its tool loop and file editing, is separate from Claude the model. The reads your prompt, runs the tools, feeds the results back and loops until done. The model makes the decisions inside that loop.

So pointing Claude Code at another model works as long as that model accepts the same shape of request and replies with tool calls the harness can read. It's usually done with an environment variable, such as ANTHROPIC_BASE_URL, pointed at a different address; the harness's code doesn't change.

  • A lot of the real engineering is in the harness: how to apply a file edit safely, when to stop looping, how to fit a huge repo into what the model sees.
  • It's why some good models feel worse in Claude Code: the harness was tuned against Claude's habits, and a different model's replies trip it up.
02 · You

What I want to understand is this part: "The harness is where a lot of the real engineering is… how do I diff a file edit safely, how do I decide when to stop looping, how do I summarise a huge repo into context. None of that is the model." I thought all of that was the model inside the harness doing it. So how does the harness do all this without its brain? That's what's puzzling me.

Claude

Fair: that was too clean. It's a split. The model does one thing, read text and write text. It can't touch your files, loop on its own, or stop in any way that does anything. The harness acts. So it always goes: the model suggests, the harness carries it out and feeds the result back, the model reacts.

  • A safe edit is almost all harness. The model writes an old string and a new one. Checking the string is still there and appears once, writing the bytes, and telling the model why it failed is ordinary code.
  • When to stop is mixed. The model's only lever is to reply without a tool call. The harness reads that as done, and also enforces limits the model has no say over: steps, time, budget.
  • A huge repo leans harness. The model can't see 50,000 files. The harness decides which it's shown, leaving out node_modules and binaries; then the model does the reading.

The model proposes in text. The harness turns text into consequences.

03 · You

So how does the harness do all of these as if it has a brain? You can get technical, but keep it simple, or give me the surface before a rabbit hole, whichever.

Claude

It doesn't decide; it runs code. If-statements and loops, the kind that checks a password. The trick is that the model's output is structured: when it wants to edit a file, it writes a , data in an agreed shape naming the tool, the file and the strings. Once it's data, the harness needs no judgment: is the old string there, exactly once? Then replace it and write the file; if not, say why.

The loop is just as plain. Send the conversation; if the reply has a tool call, run it, add the result, go again; if not, stop. No intelligence in it at all, only "is there a tool call, yes or no".

Fig 01

1 / 7You type a request.

Say hello instead of hi
One turn of an agent, step by step. Ink is the model; outlines are the harness.
04 · You

Can the harness do anything without the brain?

Claude

Almost nothing useful. Without a model it can read what you type, load its settings, connect to an API, and carry out a tool call once it's told exactly which. It can execute a tool call; it can never decide to make one. Which file matters, what the bug is, what to change, whether it's finished, what to say back: all of that is the model.

A car and its driver: the engine idles and the doors open, but nothing goes anywhere until someone steers. The harness is a capable machine with no destination of its own.

05 · You

Okay! Going back to a conversation about scope, for others in the project or just me; I can't remember how to frame it. Can you remind me what this is? There's something I'm looking for.

Claude
  • User scope: ~/.claude/settings.json. Yours, in every project.
  • Project scope: .claude/settings.json inside the project, committed to git. Everyone who clones it gets it.
  • Local scope: .claude/settings.local.json inside the project, kept out of git. Yours, in this project only.
06 · You

Remind me what these installs are again; I'm just trying to remember. Then: we have the claude binary in the home directory, in ~/.claude somewhere, but when I open a project and call claude there's also a .claude/settings.json in there. How is it different from the one at home, and how do they work together? Do I have another Claude harness binary in my project folder?

Claude

The installs. npm's global packages go in Node's shared folder with a link on PATH. Bun keeps its own folder, ~/.bun. Claude Code does the same as Bun: its files in ~/.local/share/claude, its entry in ~/.local/bin/claude.

No second binary. There's one Claude Code on the machine, whatever folder you're in. The two .claude folders hold settings, not programs, and they stack: start claude in a project and the one program loads your own settings first, then the project's on top.

07 · You

What are examples of things I'd set up globally for my Claude, versus in a project shared with other teams and me?

Claude
  • Yours, everywhere: your preferred model, a personal CLAUDE.md ("keep answers short"), your own slash commands, tools you connect for yourself.
  • The project's, committed: permission rules (deny rm -rf for everyone), a project CLAUDE.md ("we use strict TypeScript; run the tests before committing"), shared tool servers, team commands like /deploy.
  • Yours, in this project: exceptions the team shouldn't get, like allowing curl while you debug.

The split exists so a new teammate gets the shared rules on git clone, while personal tweaks stay personal.

08 · You

~/.local/share/claude holds the real files and ~/.local/bin/claude is the binary. I thought you said Claude is one folder. Why isn't the binary in the same directory?

Claude

~/.local/bin isn't Claude's folder. It's a shared shelf on where many tools put a small entry, so the shell only has to look in one place. Claude's own things, its versions and its code, stay in ~/.local/share/claude, easy to delete in one go. The entry in ~/.local/bin is a tiny pointing in there: your name on the lobby's directory, not your flat.

09 · You

So the symlink in .local/bin is a pointer to the actual binary file, which the shell runs, yes? When the shell sees it's a symlink, does it follow the path to the actual binary it can run? Where's the connection point…

Claude

Nearly: the shell doesn't do the following. A symlink is a tiny file holding nothing but a path. The shell finds ~/.local/bin/claude on PATH and asks the system to run it. The system's file code opens it, sees a link, reads the path, and opens that instead, link after link, until it reaches a real file. It's the same code that handles every file opened on the machine, so the shell never knows there was a link.

You

Ooohh! That's how an app, CLI or GUI, gets loaded into memory!!!

Claude

Yes, and you've gone past symlinks to how any program starts. Double-click an icon and Finder asks the system to run a file; type claude and the shell asks. From there it's the same: find the real file, read its bytes into , set up a new with its own memory and a number, its PID, point the processor at the first instruction, and go.

Fig 02
Step 1 of 6
  1. 1The shell/bin/zsh
  2. 2The kernelXNU, macOS's; everything else asks it
  3. 3The disk~/.local/share/claude/versions/…
  4. 4MemoryRAM, nothing of claude in it yet
  5. 5A coreOne of the processor's, idle until pointed

zsh reads claude and searches PATH. It finds ~/.local/bin/claude.

From a word typed to a program running. Each step is done by whatever is in ink.

An app with windows only has more on top: libraries to draw with, and a loop waiting for clicks instead of running to the end.

10 · You

So the harness we were talking about is the one in memory, and the brain is an API?

Claude

Close. The harness is in memory: a process in your RAM, on your machine. But the API isn't the brain; it's the wire to it. The model is far too large for a laptop and needs racks of GPUs, so it stays loaded on the provider's servers, serving huge numbers of conversations. The harness sends the conversation over the internet and gets text back.

The harness is local, in your RAM. The model is remote, in someone else's. The API is the wire between them.

That's also why it feels the same on a cheap laptop as an expensive one: the heavy work never happens on yours.

11 · You

Mmh. My mind is blown; I understand RAM better, technically. So when a laptop gets slow, does it mean it has too many program files loaded into RAM? Translation: "I have too many apps open"?

Claude

Basically, yes, in two ways. RAM runs out. Every open app holds a share until it quits. When RAM is full the system doesn't refuse; it moves the least-used memory out to the disk, into , to make room. The disk is far slower than RAM, so everything grinds. The processor is crowded. Too many things wanting to compute at once, so they take turns, and the switching costs time. The first feels like a freeze, the second like stutter.

12 · You

I want to get into cores; it's still a fuzzy concept for me. You said something I want to go down a rabbit hole on: "Your CPU can only actually execute one (or a few, with multiple cores) instruction streams at once."

Claude

A is a piece of the chip that does one narrow thing, very fast: fetch an instruction, carry it out, fetch the next. One core follows one stream of instructions at a time. Before multi-core chips, the system faked running five apps by giving each a few milliseconds and switching, so fast it looked simultaneous. Each switch is a , and it isn't free.

Eight cores are eight of those on one chip, each truly running its own stream at the same instant. You always have more running than cores, so the taking turns carries on over all of them. Cores raise the ceiling; they don't end the juggling.

13 · You

First, "the core is really doing one thing at a time, just switching insanely quickly": my reaction, hahaha, I feel so stupid. Second, the next stupid rabbit-hole question: if a CPU has eight cores, does it mean I can only open eight apps before it starts to get slow? Haha.

Claude

Not stupid: nobody explains context switching until you need it. And no. An open app is mostly doing nothing: a chat app waiting for a message, an editor waiting for a key. It's loaded in memory, idle, asking for no core until it has work. Eight cores limit how many things can compute hard at the same instant, not how many can be open. At any millisecond maybe two or three apps are busy and the rest of the cores are idle.

Fig 03
  • AVideo export
  • BBrowser page
  • CMusic
  • DChat app
  • EEditor
  • FSync
Waited for a core
15 times
Context switches
10
Six threads, most of them idle, shared over the cores. Each column is a few milliseconds.
14 · You

So I have the first MacBook with the M1 Pro chip.

Claude

Then your cores aren't all alike. An M1 Pro has ten, eight performance and two efficiency, or eight in the base model, six and two. Performance cores are big and fast and cost power; efficiency cores are small and frugal. The system sends background work, music playing, a chat app syncing, to the efficiency cores, and keeps the performance cores free for what you're leaning on.

15 · You

I understand the CPU a little better. Can we get into the difference with the GPU? They always say the GPU runs many instructions at the same time, not one at a time. I want to see that difference technically.

Claude

A CPU core is a generalist, built for code full of decisions, with big caches and branching logic, so a chip has only a handful. A has thousands of small units that barely decide anything, so they can be packed in by the thousand.

Brighten a 4K image: about eight million pixels, each multiplied by 1.2. A CPU loops through them, eight or ten at a time. A GPU gives the same instruction to thousands of units at once, each with a different pixel. One instruction, many pieces of data: SIMD. Running a model is mostly that shape of work, multiplying huge tables of numbers, which is why the model runs on GPUs and not on your laptop.

Left outTwo turns looking for, then planning, an app to animate bytes moving from disk to a core.
16 · You

How do I see the PIDs? I think I've seen people open these things to monitor them.

Claude

Activity Monitor (Spotlight, then its name) lists every process with its PID, its share of the processor and its memory. In a terminal, ps aux takes a snapshot and top keeps updating. claude is in there, the harness, a process with its own PID like any other.

Left outA turn asking for the app's brief.
17 · You

Okay, pick something and dissect it for me, and point back to what we've talked about. Also, threads?

Claude

Brave Browser Helper (Renderer) is listed eight times, each with its own PID. The browser gives its pages separate processes, each with its own memory, so one crashing page can't take the rest down. It costs RAM and buys stability.

Threads. A process is a container; are the streams of instructions inside it, sharing its memory. One of those renderers shows 24 threads: rendering, scripts, network. Threads are what actually take turns on the cores. Your machine shows 585 processes but 3,677 threads, over eight or ten cores, with the processor 88% idle: most of them waiting, just as we said.

18 · You

A reminder again. You said the shell finds the path to the binary through the symlink. I just want to remember the difference between a shell and bash.

Claude

A is the kind of program: it reads what you type and runs it. Bash is one shell, the way a Honda is one car. zsh is another, the default on a Mac since 2019, which is why your file is ~/.zshrc; fish and sh are others. echo $SHELL says which you're in. Finding commands on PATH is something every shell does.

19 · You

And the shell is a program in /bin, the first citizens we talked about.

Claude

Exactly: /bin/zsh, /bin/bash, beside ls and cp. And it's loaded like everything else: open a terminal and it asks the system to run your shell, which becomes a process with its own PID. That running zsh reads claude, walks PATH and asks the system to start the next process. Every command you run is one process starting another.

20 · You

"/usr/local/bin: user-installed tools (Node and so on). ~/.local/bin: personal user tools (Claude Code and so on)." What's the difference between user and personal?? Things are clearer now; I want this explained again.

Claude

That was sloppy wording. The difference is how many accounts share it. /usr/local/bin is outside every home folder and shared by every account on the machine, so writing to it usually needs admin rights. ~/.local/bin is inside yours: only you can use what's there, and no admin rights are needed. On a laptop with one account it hardly shows; on a shared machine, a node in /usr/local/bin works for everyone and a claude in your ~/.local/bin only for you.

21 · You

So how does machine code become electrons? This is the next click I'm looking for.

Claude

is numbers: 10110000 01100001 is a real instruction, roughly "put 97 in a register". Binary because a wire has two states, current or none. A transistor is a switch that lets current through or not, depending on another signal; a few wired together make , AND, OR, NOT; enough gates make the circuit that adds.

Executing an instruction: its bits arrive from RAM as voltages on a bundle of wires, the core's control unit routes signals to the right gates, the switches open and close in that pattern, and the voltage on the output wires is the answer. Every layer above, PATH, processes, threads, is a story told on top of current let through or stopped.

22 · You

Still so lost, and I don't know what to point at. I open Claude, its instructions are bits, which in turn determine the flow of electrons!! It's like I understand but still don't!!

Claude

Then one operation, fully. Two switches, A and B, and two wires out. The carry wire is built so current reaches it only if both are on: AND. The sum wire only if exactly one is: XOR. Turn both on, and the carry gets current and the sum doesn't: 1 and 0, which is 10 in binary, two. That's a half adder.

Fig 04
A
B
ABCarrySumA + B
00000
01011
10011
11102

1 + 1 = 2. Carry 1, sum 0: 10 in binary.

A half adder. Set the two inputs and watch which outputs carry current. 1 + 1 comes out as 10, two in binary.

There's no decision anywhere. The intelligence isn't in the electricity; it was put into the shape of the wiring, once, and current follows the shape.

23 · You

I think this is it: "humans found clever ways to wire together millions of these simple on/off decisions so that the pattern of electricity happens to match something useful to us." Where did it start? What was the first thing we did that started becoming a computer????

Claude

With a thesis, not a machine. In 1937 Claude Shannon showed that circuits of switches carry out Boolean logic exactly: switches in series are AND, in parallel OR. Before him logic was philosophy and mathematics; after him you could wire it up. From there the history is a better switch: relays that click, vacuum tubes, the transistor in 1947, many transistors on one chip in 1958, billions today. A half adder works the same in relays as in your M1 Pro.

24 · You

"Humans first proved, on paper, that logic (true/false, and/or) could be represented as algebra." Where did true and false, and and/or, come from, and why did it matter?

Claude

From arguments. Around 350 BCE Aristotle noticed that some arguments hold because of their shape, whatever they're about: if all X are Y and Z is an X, Z is Y. Logic took every statement as either true or false, and studied the shapes.

In 1854 George Boole wrote it as algebra: true as 1, false as 0, AND behaving like multiplication. Checking an argument became a calculation, and anything that can calculate could, in principle, do logic. Shannon, eighty years later, showed switches could.

25 · You

A small caveat. What does algebra mean?

Claude

Mathematics with symbols standing for any value. 2 + 3 = 5 is arithmetic, one case; x + y = z is algebra, a rule for every case. The word is from al-jabr, in a ninth-century book by al-Khwarizmi, whose name also gives us algorithm. Boole's move was to point that toolkit at statements instead of numbers: A AND B, for any true or false A and B.

26 · You

I understand that logic came from philosophy, then became maths, or algebra, and then physical parts, the transistors. Going back to our Claude example, I still don't see how opening Claude on my CPU is a true or false.

Claude

Take the PATH search. Is claude in this folder? Yes or no. The whole search is that question in a loop, and stopping to run the file is a branch: if found, run it, else keep going. Every if and every loop in any program is that shape.

  • Following a link: is this file a symlink?
  • Decoding an instruction: does this bit pattern match ADD? Match MOVE?
  • Adding: is this bit 1 AND that bit 1?

Opening Claude isn't one intelligent act. It's millions of yes-or-no questions in sequence, so fast that the result looks like "Claude opened".

27 · You

This part is very solid: "You're picturing opening Claude as one big, intelligent-feeling action. It's actually millions of true/false questions, asked in sequence, so fast that the effect looks like intelligence." Explaining it as a scale of yes/no questions has made me understand "mathematising" logic, and true and false being 1 and 0. What's still fuzzy is the instruction itself, and decoding. I like this starting point [an image of the bit pattern] but don't understand how it becomes an instruction (I'm not sure what I'm asking here). And once the instruction reaches the CPU and is executed, what's the feedback? What happens next that we see?

Claude

How bits mean something. They don't, by themselves. The core has a decoder, a tree of gates that looks at the , the part of the instruction that says which operation, and sends a signal down one line out of many: the line that sets the adding circuit going, or the one for moving a value. Change one bit and a different line lights. The meaning is selected, not read; it was fixed when the chip was designed.

What we see. The program writes its result to output. Memory wired to the screen is read many times a second by a display controller, which turns the bytes into voltages for each pixel, and the pixels turn them into light. Nothing decides to show you anything.

Left outA turn asking for a second brief, for the decoder and the screen.
28 · You

So if I understand you correctly, does it mean, for example, that the letter A has an equivalent bit instruction the CPU uses to display that A on my screen?

Claude

Close, but A is data, not an instruction. Instructions say what to do; data is what they do it to. A is the number 65, 01000001, because the people who drew up ASCII in the 1960s agreed it would be; Unicode kept it. Nothing about those bits is A-shaped.

Press A and the byte 65 lands in memory. The terminal's instructions, ordinary ADDs and MOVEs and compares, use 65 to look up a glyph in a font, more bits that describe the letter's shape, and draw that shape into the , which the screen reads out as light.

The instructions are the verbs. The character code and the font's shape are the data they work on.

Terms