Where each agent runs: on the runtime's own machine, on a Kubernetes node, in a container, or on a worker machine that joined to lend what the runtime's machine cannot do. The runtime is the service that runs agents and keeps their threads.
What placement is
Each time an agent starts, the runtime picks the machine it runs on and records why. An agent can run as a process on the runtime's own machine, as a pod on a Kubernetes node, in its own container, or on a worker. A node is one machine in the Kubernetes cluster. A pod is the group of containers one agent runs in on a node. A worker is another machine, a Mac or a Windows PC, that joined the runtime to run agents that need something only it has, such as Xcode.
The runtime records why each agent ran where it did, so you can read the reason instead of guessing.
How it works
The runtime starts every agent and writes its log, wherever the agent runs. An agent that only reads, which means every tool it may use is Read, Grep, Glob, LS or a review tool, goes to a Kubernetes node when the runtime has a cluster. So does a condensate fix, build or review agent on a Claude model, when the runtime names the image its pod runs. Every other agent runs on the runtime's machine unless its start request names another runner or it needs an ability only a worker has. An agent started in bypass mode may use every tool, so it never counts as one that only reads.
A pod reaches only Anthropic and GitHub, so it cannot install packages, and a Claude Code agent in a pod never gets a shell.
Try it
GET /live lists every live agent with its runner, its node and its placement reason. It reads the running runtime and starts nothing.
curl -s http://127.0.0.1:4741/live | jq '.live[] | {threadId, runner, node, placement, placementDetail}'
You should see one object per live agent. runner is process, k8s, container or worker. node is present only for a pod or a worker. placement is one of the values in the next table.
A thread's location holds the same facts for one thread, and is null while no agent runs it:
curl -s http://127.0.0.1:4741/threads/THREAD_ID | jq '.location'
How an agent is placed
The runtime checks these conditions in order. The first that matches decides where the agent runs, and its name is the agent's placement value. An agent that needs an ability is first narrowed to the places that have it, as the next section explains.
| Check | Where the agent runs | placement | What placementDetail holds |
|---|---|---|---|
The start request names a runner: process, k8s, container or worker | That runner | hint | The ranking, when the runner is k8s; the ability match, when the agent needs abilities |
| The agent is not a review agent and may use a tool a pod does not offer, it is a Claude Code fix agent, or it is a condensate agent that is not a fix, build or review agent | The runtime's machine | role | Why a pod cannot do its work |
CONDENSATE_KUBECONFIG is not set | The runtime's machine | not-configured | Nothing |
| The Kubernetes runner would refuse the agent | The runtime's machine | refused | The refusal |
| No branch on origin holds the checkout's current commit, so a pod cannot clone it | The runtime's machine | head-not-on-origin | Nothing |
| The check of the nodes found no node to run on | The runtime's machine | probe-failed | Each node it skipped, and why |
| Every check passed | A node | automatic | The ranking: the node that won, and why |
| Every check passed, but no node took the pod | The runtime's machine | k8s-start-failed | Why no node took it |
| The checks kept the agent on the runtime's machine, which lacks a need, and a worker has every need | That worker | ability | The worker and what it advertises |
The Kubernetes runner refuses an agent whose engine is not Claude or condensate, a condensate agent on a model that is not Claude, a Claude Code fix agent, an agent that resumes a Claude Code session or forks another session, an agent with an MCP server that only the runtime's machine can start, and a checkout with no https://github.com/ or [email protected]: origin. An agent whose start request names k8s is never moved back to the runtime's machine; if the runner refuses it or no node takes its pod, the start fails with the reason.
A condensate agent's pod runs the agent image the runtime names. With none, a condensate agent the runtime placed itself runs on the runtime's machine with placement k8s-start-failed, and one whose start request names k8s fails.
A review agent the runtime placed on a node gets only the Read, Grep, Glob and LS tools, plus the review tools. Workspaces lists the other limits of each runner, and the label a node needs before it takes agents.
When every agent runs in a container
The Docker install sets CONDENSATE_AGENT_ISOLATION=container. The runtime then holds the logins and the proxy's token files, and no agent runs as its process. A start request that names process is refused with a reason that names the setting. One that names container, k8s or worker gets that runner. An agent that needs an ability goes to a worker that has it, or is refused with 409 no-place-for-abilities when none does. Anything else runs in its own container with placement isolated. Only the claude and condensate engines have a container path, and a condensate agent on an OpenCode Go model is refused because the container can spend only a Claude or a Codex login. Nothing falls back to a process; a pod that no node takes fails.
When an agent needs an ability
An ability is something only some machines can do, such as run the iPhone simulator or drive a desktop. Each place advertises the abilities it has, and a start request can list the abilities the agent needs in spec.needs. The agent then runs only on a place that has every one of them. An agent that needs nothing is placed as described above.
The runtime checks its own machine once, when it starts. A Mac with Xcode advertises xcode and ios-sim. A Windows machine advertises windows. A runtime in a Linux container advertises none. A Kubernetes node advertises what its labels say. The full list is in Reference.
This request asks for an agent that needs the iPhone simulator, on a runtime in Docker that has none:
curl -s -X POST http://127.0.0.1:4741/spawn -H 'content-type: application/json' \
-d '{"type": "build", "spec": {"cwd": "/work/app", "needs": ["ios-sim"]}}'
You should see a refusal with status 409, and no thread is created:
{
"error": "No place advertises every ability this agent needs (ios-sim): head (process) advertises none and lacks ios-sim.",
"code": "no-place-for-abilities",
"reason": "no-ability",
"needs": ["ios-sim"],
"missing": ["ios-sim"],
"places": [{ "place": "head", "runner": "process", "abilities": [], "lacks": ["ios-sim"] }]
}
head is the API's name for the runtime's own machine. On a Mac with Xcode, the same request starts the agent, and its placementDetail begins with the match, such as Needs ios-sim: head advertises xcode, ios-sim, desktop-mac.
A runner named in the start request is not a way around a need. If the request names process and the runtime's machine lacks the ability, the start is refused. A node that lacks a need is passed over, and the detail says what it lacks.
An agent's tools can add needs. The imessage, calendar, spotify and mac MCP servers need a Mac desktop, so an agent that has one of them needs that ability as if it had asked for it. Only the process runner starts these servers, so a node or a container never takes such an agent, whatever the node's labels say.
On a place that advertises ios-sim, every agent is refused a command that boots the simulator, because booted simulators push the machine's load far past its limit. A place without the simulator has no such rule. An agent on a worker runs under the worker's rules.
If a machine lost an ability after an agent was created, the agent's first message fails with the same refusal, and the log line carries the reason no-ability.
Workers
A worker is a machine that joins a runtime to run the agents the runtime's own machine cannot. A runtime in Docker has no Xcode, so a Mac joins as a worker and an agent that needs xcode runs there. A Windows PC joins the same way, and an agent that needs powershell runs on it. An agent whose start request names the worker runner goes to a worker whether it needs anything or not. When the runtime's own machine has every need, the agent stays there.
The worker is a small program that runs on the Mac or the PC as your own user. It checks its abilities the same way the runtime does, registers with the runtime, and registers again every 30 seconds. A worker that has not registered for 90 seconds is no longer a place. Only the Claude CLI's input and output cross to the worker. The thread, its hooks and its middleware stay in the runtime. The worker starts the CLI with saving turned off, so no conversation is left in your Claude folder on the worker. Each agent runs in an empty folder that is removed when the agent ends, because no checkout is copied to a worker yet.
A worker runs Claude agents only. The runtime refuses to send it another engine, a resumed session, a fork, local plugins or a Mac-only MCP server. The worker gets the agent's placeholder credentials, never a real token.
Every call is authenticated both ways. The worker registers with a worker bearer, a secret the runtime issues for one named worker, and refuses any call that does not carry the random key it sent inside that registration, so only the runtime it registered with can start an agent on it. A worker listens on its loopback address or its tailnet address only. A tailnet is the private network Tailscale makes between your own machines.
Join a Mac
Issue the worker's bearer on the runtime's machine, from the repository root:
bun run --cwd packages/agents-host broker-peer rotate-worker mac-worker
You should see one line, the bearer. It is shown this once. Save it on the Mac in a file only you can read. Then start the worker on the Mac with the runtime's address and the bearer set as the settings under Reference. When the runtime is on another machine, also set the worker's listen address to the Mac's tailnet address.
bun run --cwd packages/agents-host worker
You should see worker_listening with its address and abilities, then worker_registered. A refusal logs worker_register_failed with the status and reason. On the runtime's machine, GET /placement now lists the worker under workers, with its name, address and abilities. An agent started with "needs": ["xcode"] on a runtime that lacks Xcode now runs on it, and GET /live shows runner worker, node mac-worker and placement ability.
Join a Windows PC
The PC needs Tailscale signed in to the same tailnet as the runtime, and the Claude CLI from its own Windows installer. Issue a bearer as above, with a name such as win-worker. On the PC, in Windows PowerShell, put the bearer in the worker's token setting without echoing it, then run the installer from a clone of the repository with the runtime's HTTPS address:
$env:CONDENSATE_WORKER_TOKEN = [Net.NetworkCredential]::new('', (Read-Host 'Worker bearer' -AsSecureString)).Password
powershell -ExecutionPolicy Bypass -File scripts\windows\worker\install-worker.ps1 -RuntimeUrl https://runtime.example.ts.net
The script installs the worker's own copy of Bun, then the clone's packages, and starts the worker as a scheduled task in your desktop session, so it starts again at every sign-in. It keeps the bearer in a folder in your Windows profile that only you and the system can read. GET /placement now lists the worker with ["windows", "powershell", "desktop-win"]. The log is worker.log in %LOCALAPPDATA%\Condensate\worker. Run the script again with -Uninstall to remove the worker. A shell or PowerShell command on a worker runs outside any sandbox; the runtime still judges every command under the same deny rules.
How a node is chosen
The runtime ranks the nodes each time it starts a pod. It reads every node that carries the agent label, and the CPU and memory every pod in the cluster requests. It skips a node that is not Ready, is cordoned, has no internal address, or whose kubelet does not answer within 2 seconds, and names each skipped node in the reason. On each remaining node it cuts the agent's measured size to half of that node's free space, and passes over a node where the cut size is under 1 millicore or 1 MiB.
A node more than 300 ms away ranks after every closer node, however empty it is. Among the rest, the node left most free wins: the runtime adds the agent's request to the node, then averages the share of CPU and the share of memory left free. On a tie, the shorter round trip wins, then the name that sorts first. The runtime's own machine is always last.
The pod is pinned to the winner by its kubernetes.io/hostname label. If Kubernetes marks the pod Unschedulable, the runtime removes it and tries the next node. Any other failure, such as an image pull or the clone, ends the tries, because it fails the same way on every node.
One round-trip reading is one TCP connect to the node's kubelet port, taken every 15 seconds. The runtime keeps the newest 20 readings of each node, drops any older than 5 minutes, and uses the 95th percentile, so one slow connect never decides where your agent runs. With fewer than 3 fresh readings, as just after the runtime starts, it takes the missing readings when the agent starts.
A placementDetail for a review agent reads like this:
k3s-worker-m5 won: k3s-worker's round trip of 310 ms is over 300 ms, so it ranks after every node under it. The agent asks for 250m CPU and 1024Mi memory. Ranking: 1. k3s-worker-m5 (97% free after it, 114 ms round trip); 2. k3s-worker (98% free after it, 310 ms round trip, over 300 ms); 3. the runtime's own machine.
How an agent's size is measured
Every 15 seconds the runtime reads the CPU and memory of each live agent. For a pod it reads the Kubernetes metrics API, summing the pod's containers. For a process it reads ps, finding the agent's process by an environment variable and adding every process under it. When an agent finishes, or the runtime stops, it writes the agent's peak CPU and memory to the agent_peaks table in threads.db, with the agent's kind: its role, its engine, and whether it has a shell.
| Rule | What it means |
|---|---|
| A pod is sized from pod peaks only | A whole process tree on the runtime's machine, test runs included, is not comparable to a pod |
| With 3 or more pod peaks, the kind asks for their 95th percentile | The runtime reads the newest 20 peaks of the kind |
| With fewer, the kind asks for its role's starting size | Review agents start at 250 millicores and 1 GiB. Fix and build agents start at 1 core and 2 GiB. Any other role starts at the review size |
| The memory limit is 1.5 times the largest peak | A runaway agent is stopped on its own node. There is no CPU limit |
| The request is cut to half of the node's free space | The pod fits beside what already runs there |
When every node is full, or every node with free space refused the pod, the runtime writes a "too big" row for the agent's kind at half of what the pod asked for. The next pod of that kind asks for no more than that, and a second refusal halves it again. A pod of that kind that runs and finishes lifts the limit. A review agent the runtime placed itself then runs on the runtime's machine with placement k8s-start-failed. An agent whose start request named k8s fails.
The heavy-command queue
A heavy command inside an agent, such as a test run, a type check or a build, waits in a heavy-command queue so that agents on one machine do not all load it at once. The runtime's machine has one queue, in the runtime. Each Kubernetes node can have its own, served by a DaemonSet named node-queue on a Unix socket that every agent pod mounts. When neither queue answers, the command waits until the machine's 1-minute load is under 45.
A command is charged for the CPU it uses, not only the weight it declares. Every 10 seconds the queue reads the CPU the command's process group has used and charges the larger of the declared weight and the measured cores, so a command that declares weight 1 and then uses ten cores is charged 10. A node queue grants nothing at a 1-minute load of 45 or more, lets one heavy command run at a time, and grants at most 40 percent of the node's cores, and at least 2.
The runtime does not install the daemon. Apply it once per cluster, from the repository root:
bun packages/agents-host/src/gate-daemon.ts manifest --image <agent image> | kubectl apply --server-side -f -
The --server-side flag is needed, because a client-side apply copies the daemon's script into an annotation that Kubernetes limits to 256 KB. On a node with no daemon, the wrapper falls back to the load check.
Limits
A 15-second reading can miss a short memory spike, and a runtime that is killed, not stopped, loses the peaks of the agents still running. The runtime does not measure workers, so the first worker by name that has every need wins.
Reference
Settings, ports and paths
| Name | What it is |
|---|---|
CONDENSATE_KUBECONFIG | The Kubernetes configuration the runtime uses. Unset, every agent runs on the runtime's machine with placement not-configured. |
CONDENSATE_AGENT_IMAGE | The image a condensate agent's pod runs. Unset, a condensate agent the runtime placed itself runs on the runtime's machine with placement k8s-start-failed, and one whose start request names k8s fails. |
CONDENSATE_AGENT_ISOLATION | container puts every agent in its own container and refuses a process runner. The Docker install sets it. |
CONDENSATE_ISOLATED_REPOS_ROOT | With isolation on, the folder where the runtime looks for a workspace's repository when an agent starts with no working path. /repos by default. |
CONDENSATE_CONTAINER_BACKEND | launcher runs container agents through the Docker install's agent-launcher service. Unset, the container runner drives Apple's container command. |
CONDENSATE_USAGE_KEY | The variable the runtime sets on each agent's process, so ps readings can find it. |
CONDENSATE_GATE_SOCKET | The variable each agent pod gets, pointing at the node queue's socket, /run/condensate/queue/queue.sock. |
| Port 10250 | The kubelet port one round-trip reading connects to. |
| Port 4741 | The runtime's default port, where GET /live and GET /placement answer. |
GET /live and location
GET /live field | location field | What it is |
|---|---|---|
runner | runner | process, k8s, container or worker |
node | machine | The node for a pod, or the worker's name. location.machine is the host name for a local process or container. |
pod | The pod's name on Kubernetes, null anywhere else | |
placement | reason | One of the values in the table under "How an agent is placed" |
placementDetail | detail | The ranking, the refusal, or the nodes the check skipped. For an agent that needs abilities, it begins with the match. |
GET /placement
GET /placement shows each place as the runtime last measured it, and starts no command. places[] carries, for each place, its capacity, usage, requests, the number of live agents, its roundTripMs, its abilities, and for the runtime's machine its heavy-command queue. workers[] lists each registered worker with its address, abilities and seenAt. kinds[] lists each kind of agent with its number of peaks and the size its next pod asks for.
Abilities
| Ability | Advertised when |
|---|---|
xcode | The machine is a Mac and xcrun is on the runtime's PATH |
ios-sim | The same as xcode |
imessage | The machine is a Mac and a BlueBubbles server answers at CONDENSATE_BLUEBUBBLES_URL, http://127.0.0.1:1234 by default |
apple-vm | The machine is a Mac, the container command is on PATH, and CONDENSATE_CONTAINER_NETWORK is set |
desktop-mac | The machine is a Mac and a person is signed in at its desktop |
windows | The machine runs Windows |
powershell | The machine runs Windows and powershell.exe is on PATH |
desktop-win | The machine runs Windows and the runtime runs in a desktop session |
A Kubernetes node advertises an ability with the label condensate.dev/ability/<name>=true. A name in spec.needs that is not in this table is refused with status 400. The imessage MCP server needs imessage; the calendar, spotify and mac servers need desktop-mac.
Workers
| Name | Where it is set | What it is |
|---|---|---|
POST /workers/register | The runtime | A worker joins. Needs Authorization: Bearer <worker bearer> and the body name, address, abilities and channelKey. Answers name, abilities and ttlMs, 90000. |
CONDENSATE_WORKER_PROXY_URL | The runtime | The proxy address a worker reaches, on the tailnet. An agent behind the proxy is refused on a worker until it is set. |
bun run broker-peer rotate-worker <name> | The runtime | Issues a worker bearer for <name> and revokes the one before it. |
CONDENSATE_WORKER_RUNTIME_URL | The worker | The runtime it joins: HTTPS, or HTTP on loopback. |
CONDENSATE_WORKER_TOKEN | The worker | The worker bearer. The part before the dot is the worker's name. |
CONDENSATE_WORKER_HOST | The worker | The address it listens on: 127.0.0.1 by default, or its tailnet address. |
CONDENSATE_WORKER_PORT | The worker | The port it listens on. Unset or 0 takes any free port. |
scripts\windows\worker\install-worker.ps1 | A Windows worker | -RuntimeUrl is required. -ListenHost defaults to the PC's tailnet address, -Port to 4790. -Uninstall removes the worker. |
| Refusal | Status | When |
|---|---|---|
worker-unauthorized | 401 | The registration carries no bearer, or one the runtime did not issue as a worker bearer |
worker-name-mismatch | 403 | The body names a different machine than the bearer |
worker-address-refused | 400 | The address is not ws://<host>:<port> on loopback or the tailnet, or it is a loopback address from another machine |
worker-channel-unauthorized | 401 | A call to the worker without its key |
Read next
- Workspaces, for the limits of each runner and the label a node needs before it takes agents.
- Threads and the runtime, to follow the agent's work wherever it ran.
- What is Condensate, for what the runtime does once the agent is running.