Running a program means pointing a core at numbers

What happens when a program runs? A program is a file of numbers. Running it means the system puts those numbers in memory and points a core at them, and every step after that is switches, let through or stopped in a pattern someone designed, out to the light on your screen.

  1. 01The question
  2. 02The harness is a program on your machine
  3. 03Starting a program
  4. 04A core runs the instructions
  5. 05An instruction lights one line
  6. 06Back out as light

01The question

Claude Code can run models other than Claude. People point it at Kimi or GPT and it carries on working, which makes plain what it is: not the model, but the program round the model, the . And that makes it an ordinary program, like any other on your machine. So what does it mean for a program to run? When you type claude, what happens, where, and on what?

The answer goes all the way down. A program is a file of numbers. Running it means the system puts those numbers in memory and points a core at them. Each number lights one line in the core's wiring, and the wiring is switches. Nothing in the chain thinks; the thinking was done once, by whoever designed the shape. This note builds on Your shell finds a tool by searching folders in order, which covers how the shell finds the word you typed.

02The harness is a program on your machine

A language model does one thing: it reads text and writes text. When it wants something done, it writes a : data in an agreed shape, naming a tool, a file and what to change. The harness is ordinary code that acts on it. Does that text appear in the file exactly once? Then replace it and write the file; if not, say why. Then send the result back and ask again.

The two run in different places. The harness is a program like any other, loaded into your memory as a . The model is far too large for a laptop and needs racks of GPUs, so it stays loaded on the provider's servers, answering huge numbers of conversations at once. The API is neither of them: it is the wire between, a request carrying the conversation out over the internet and a reply coming back. Vercel and serverless functions follows a request like it from the server's side.

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

03Starting a program

~/.local/bin/claude is a , and the real program is elsewhere, in ~/.local/share/claude. That split is on purpose. ~/.local/bin is a shared shelf on where many tools put a small entry, so the shell only has to look in one place; each tool keeps its real files in a folder of its own.

Following the link isn't the shell's job. The shell asks the to run a path, and the kernel resolves links as it opens any file, for any program. From there it does the same for every program, whether it was typed or double-clicked.

Fig 01
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.

A program file is bytes: instructions for the processor, and data. Running it means the kernel sets up a new process with its own private memory and a number, its PID, maps the file into so its bytes can be read at memory speed, and points a processor core at the first instruction. A program with windows goes through the same steps; it just has more code once it's running, an event loop waiting for clicks. And one process starts another: the terminal starts the shell, /bin/zsh, and the shell starts claude.

Any program, typed or clicked, starts the same way: its bytes in memory, a process round them, and a core pointed at the first instruction.

04A core runs the instructions

A is the part of the processor that executes instructions: fetch one, carry it out, fetch the next, billions of times a second. One core follows one stream of instructions at a time. Those streams are : every process has at least one, and many have dozens.

There are always far more threads than cores. The system gives each runnable thread a few milliseconds on a core, then takes it off and puts another on, so quickly it looks simultaneous. Each swap is a , and it isn't free. More cores means more threads truly running at once; it doesn't end the taking of turns.

Fig 02
  • 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.

So eight cores doesn't mean eight apps. An open app is mostly idle: a chat app waiting for a message, an editor waiting for a key. It is loaded in memory but asks for no core until it has work. Apple's chips also mix two kinds of core: performance cores, large and fast, and efficiency cores, small and frugal, which the system gives background work. An M1 Pro has eight or ten cores, two of them efficiency cores.

05An instruction lights one line

is numbers. On an Intel Mac, the two bytes 10110000 01100001 mean put the number 97 into a register. Apple's own chips use a different instruction set, ARM, where every instruction is 32 bits, but the idea is the same: a bit pattern, and nothing else.

A pattern means something only because the processor was built to react to it. Part of each core, the decoder, is a tree of that looks at the bits 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. Nothing is read or interpreted; the meaning was fixed when the chip was designed.

The circuits on those lines are gates too, and gates are switches. A transistor lets current through or doesn't, and Thinking harder costs more, one token at a time shows how a few of them make AND, OR and NOT. Wire an AND and an XOR side by side and you have a half adder: two switches in, and the carry gets current only when both are on.

Fig 03
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.

The intelligence isn't in the electricity. It was put into the shape of the wiring, once, and current follows the shape.

Everything that looks like a decision comes down to these. Does claude exist in this folder? Is this file a link? Does this bit pattern match ADD? Each is a yes or a no, a 1 or a 0, and opening a program is millions of them, one after another, too fast to see.

06Back out as light

Not every pattern is an instruction. The letter A is stored as the number 65, 01000001, because the people who drew up ASCII in the 1960s agreed it would be; Unicode kept the same number. That byte is data: the instructions are the verbs, and it is what they work on. To show it, a program runs ordinary instructions that look up 65 in a font, which describes the shape of the letter, and draw that shape.

The drawing ends up in a , a block of memory holding the colour of every pixel, which the display hardware reads from top to bottom 60 or 120 times a second and turns into light. Nothing decides to show you anything: the screen simply keeps reading that memory.

Every layer is a story told about the one under it. At the bottom, current is let through or stopped, in a pattern someone designed to mean something.

Connected

Side threads

Questions that came up once the main idea began to hold, kept as they were asked. Each opens beside the paragraph it grew from.

Terms

Checked

What the chat had wrong or only half right, against sources. The note above already says the corrected thing.

  1. Running a program means the OS copies the whole binary from disk into RAM.The kernel maps the file into the process's memory and reads pages from disk as they are first used, so a program starts before all of it is loaded.Apple, Memory usage performance guidelines
  2. When RAM is full, the system swaps the least-used memory straight to disk.macOS compresses memory that hasn't been used lately first, and swaps to disk when that isn't enough.Apple, Activity Monitor: memory
  3. The M1 Pro's GPU has 224 execution units and almost 1,800 shaders.Apple describes it as up to 16 GPU cores. The finer counts came from a benchmark site, not from Apple, so they are left out.Apple Newsroom, Introducing M1 Pro and M1 Max
  4. The instruction 10110000 01100001 is what a Mac's CPU runs.It is x86, which Intel Macs ran. Apple's chips use ARM64, whose instructions are 32 bits each.Arm, A64 instruction set
  5. The opcode 0000 means ADD and 0001 means SUBTRACT.Made up to show the idea. Real encodings differ by processor and are listed in its manual.Arm, A64 instruction set
  6. To print text, a program writes it to memory wired straight to the screen.A terminal program writes bytes to the terminal; the terminal app draws the letters, usually with the GPU, into a framebuffer, and the display hardware reads that out. Memory-mapped I/O is real, but the program doesn't write pixels.Apple, Metal: drawing to the screen
  7. ENIAC, in 1945, was doing Boolean logic in binary, like a laptop.ENIAC counted in decimal, ten states per digit. Binary machines came alongside it: Zuse's Z3 in relays (1941), and the stored-program computers after it.Penn Engineering, ENIAC
  8. Shannon's 1937 insight was that electrical switches could do Boolean logic.Right, from his master's thesis, published in 1938 as A Symbolic Analysis of Relay and Switching Circuits.MIT, Shannon's thesis
  9. A browser gives every tab its own process.Chromium browsers, Brave among them, separate pages by site rather than by tab; pages from the same site can share a renderer.Chromium, Site Isolation
  10. MCP servers and key bindings go in Claude Code's settings.json.Project MCP servers go in .mcp.json, personal ones in ~/.claude.json, and key bindings in ~/.claude/keybindings.json.Claude Code docs, settings