condensate

Engines

The three engines that run an agent, which models each runs, and agents Condensate only watches.

On this page

Pick the program that runs your agent: Claude Code, Codex, or Condensate's own engine.

What an engine is

An engine is the program that runs an agent. It sends your request to a model, runs the tools the model asks for, and sends the results back to the model. Condensate has three engines, named by id: claude runs Claude Code, codex runs Codex, and condensate is Condensate's own engine. An older engine, pi, still runs the models condensate cannot reach, such as Cerebras and custom models. Dex, Condensate's browser app, shows pi as "API".

Every agent runs on one engine, which you name when you start it. The runtime is the service that runs agents and keeps their threads; threads and the runtime explains what a thread holds.

The engine decides what runs the agent, which tools the agent has, which of your accounts pays for it, and how a long task behaves when the conversation outgrows the model's context window.

How it works

Explore the three integration paths
CondensateOwns the agent loop
Model APIReturns text or tool calls
ToolsResults return to the loop
Loop owner: CondensateProvider transport: pi-ai. Runtime: agents-host.
Switch paths to see which component owns execution. Connecting MCP tools alone does not turn an external session into a durable Condensate thread.

On the condensate engine, Condensate's own code owns the loop. It calls the model's API, runs the tool the model asks for, and sends the result back, all inside the runtime's process. On claude and codex, Condensate keeps the thread and the vendor's CLI runs the session; Condensate's tools and hooks connect to that session. On every path the model only proposes a tool call. The engine decides whether to run it, under the rules set for that agent.

A turn is one message to an agent and its full reply, tool calls included. You ask an agent to explain a function. The model asks to read the file. The engine reads the file and sends its text back. The model then explains the function, or asks for another tool. Every engine produces this shape: a request, tool calls the engine runs, and a reply.

The engines

EngineEngine idWhat runs the agentTools it gives the agent
Claude CodeclaudeThe Claude CLI, through the Claude Agent SDKClaude Code's own tools
CodexcodexThe Codex CLI, as codex app-serverCodex's own tools
Condensate's own enginecondensateCondensate's own code, inside the runtimeread, edit, write, bash, grep, glob and ls, the agent's MCP tools, and the runtime's own tools
The API engine, being replacedpiCondensate's older code, inside the runtimeSeven file and shell tools plus the runtime's own tools

Which models run on which engine

The model id decides which engines may run it. An agent you start without naming an engine gets the default.

Model idEngines that can run itDefault
A Claude id, such as claude-opus-5-5, fable, opus, sonnet or haikuclaude or condensateclaude
An OpenAI id, such as gpt-6.1-sol or codex-*, but not gpt-oss-*condensate, pi or codexcondensate
An OpenCode Go idcondensate or picondensate
A Cerebras id, or a custom model with its own keypipi

A model id alone never picks Codex. Name codex when you start the agent. The condensate engine reaches only Claude, OpenAI and OpenCode Go providers, so the start check refuses it for a Cerebras or custom model. The runtime checks the model and engine before the agent starts, and a pair that does not match is refused with no model call made. Each engine also needs a matching account; Accounts says which kind.

Condensate's own engine

The condensate engine starts no CLI. Each turn it sends the conversation to the model, runs the tool calls the model asks for, and sends the results back, until the model replies without a tool call. It keeps each agent's conversation in one log file in the runtime's data folder.

Each agent runs on the one account the runtime picked for it. A Claude model runs on a Claude login, an OpenAI model on a Codex subscription, and an OpenCode Go model on an OpenCode key or login.

The engine starts the agent's MCP servers when the agent gets its first message. The agent's allowed-tools list picks which of their tools it gets, and its denied-tools list removes tools. If a server does not start, its tools are left out, the agent's instructions name that server, and the thread shows an error. The log keeps the tool list the agent was sent, so the provider can reuse its cache. When a server changes between starts, the agent gets the new list at its next start and misses the cache once; the runtime log then has a condensate_engine_loop_tools_refrozen line naming what changed.

To use the engine from your own code, call the runtime's HTTP API or the SDK. Do not import the engine package directly.

The runtime restarts under a condensate agent

The thread waits until you press Resume or send a new message. The engine then reopens the agent's log and the conversation goes on. A tool call the stopped process left without a result is answered first. A call that only reads, such as read or grep, runs again. A call that can change something, such as edit, write or bash, does not run again; its answer says the process stopped.

A condensate agent hands work to a child

An agent can hand a task to a child agent on the same model. The child starts from the parent's conversation, up to the reply that asked for the child, so its first request reuses the provider's cache of that conversation. A parent has at most 6 live children by default. If the child cannot start from the parent, for example because the parent is gone, it starts with an empty conversation and its brief, the written task that starts its work, and the engine logs why.

The middleware hears from a condensate agent

The middleware is the Condensate service that watches what agents do and can add notes or block calls. The middleware explains it. The condensate engine sends it four kinds of event.

EventWhat the middleware can do
UserPromptSubmit, with your messageAdd a note that follows it. It cannot block the message.
PreToolUseBlock the call, add a note to the agent's next step, or stop the turn
PostToolUse, after every call that ran, with is_error set for a failed callAdd a note or stop the turn. The engine never sends PostToolUseFailure.
Stop, with the agent's last replyA note keeps the agent working, with the note as the next message. The same note works once, and a turn goes on at most 3 times this way.

A middleware that does not answer lets the tool call go ahead on this engine. A message you send during a turn joins the conversation before the next model request.

Claude Code and Codex

The claude engine runs the Claude CLI that the Claude Agent SDK bundles. The codex engine runs the Codex CLI's app server. In both cases the CLI runs the agent. Condensate starts the session, records each turn in the thread, and passes your messages in.

The codex engine needs exactly one Codex CLI version, 0.160.0 in this build. Any other version is refused when the agent starts, with the path and both versions in the message. On macOS the engine runs the CLI bundled in the ChatGPT desktop app unless you set CONDENSATE_CODEX_BIN, so an update of that app can stop the engine until the versions match again. On Linux and on Windows through WSL, set CONDENSATE_CODEX_BIN to a Codex CLI of that version.

Placeholder keys

Agents never hold your real model credentials. Each agent gets placeholder values in place of tokens and keys, and an outbound proxy on your machine swaps in the real credential on each request to the provider. This holds for every engine. The runtime does not start if the proxy is set up wrong or does not answer, and a start that would give an agent a real credential is refused. CONDENSATE_PROXY=off turns the proxy off, and agents then hold real credentials. Accounts covers the setup.

Agents that Condensate does not run

You can keep running Claude Code or Codex yourself and still use Condensate's tools and rules. The agent keeps its own model connection. Two connections do this. The agent connects to Condensate's MCP endpoint, so Condensate can check each tool call before it reaches the tool. And Condensate's plugin installs a hook command that sends each of the CLI's events to the middleware.

The plugin registers for 12 events. The middleware acts on four: it can block UserPromptSubmit and PreToolUse, add a note after PostToolUse and PostToolUseFailure, and keep the agent working after Stop. If the middleware does not answer, or the plugin has no key, the plugin blocks UserPromptSubmit and PreToolUse and lets every other event go ahead. Connecting tools alone does not make an outside session a Condensate thread. Hooks and the plugin shows the setup.

Choose an engine

You want toUse
Child agents that start from the parent's conversation and its cache, with one readable log per agentThe runtime with condensate, named at the start even for a Claude model
Long tasks that outgrow the context window, or Claude Code's own tools and skillsThe runtime with claude
Codex agents in the runtimeThe runtime with codex
Tools and rules for an agent you already runMCP and the Condensate plugin

Limits

The condensate engine never shortens a conversation. It sends the whole conversation on every call, so a long task can outgrow the model's context window, while claude, codex and pi do shorten it, as context windows explains. It does not support questions the agent asks you during a turn. Its bash tool has no sandbox, and runs in the agent's working folder with the runtime's environment and the agent's own. Pausing a condensate agent and resuming it in another process is built in the engine, and the runtime does not use it yet.

Reference

SettingWhat it does
CONDENSATE_CODEX_BINThe Codex CLI binary the codex engine runs. Unset, the engine runs the CLI inside the macOS ChatGPT desktop app. The version must be 0.160.0.
CONDENSATE_PROXY=offTurns the credential proxy off.
CONDENSATE_LOOP_MAX_LIVE_FORKSThe most live children one condensate agent may have. The default is 6.
LimitValue
Output of one model call on condensate32,000 tokens, or less if the model allows less
Times a Stop note keeps a condensate agent working3 for each of your messages, and never twice with the same note