Once the Condensate plugin is installed, every Claude Code or Codex session sends its hook events to the middleware, which can block a prompt or tool call, add a note to the agent's next message, or record what it saw. The same session reaches the middleware's MCP gateway and sees your upstream tools, the code-mode tools and the plugin's skills.
The addresses below are the developer setup's. If you used the installer, the middleware is on port 24787, so use http://127.0.0.1:24787 wherever this page says 4787.
Before you start
You need the middleware running, Bun installed, and a checkout of the repository with bun install --frozen-lockfile run from its root. curl -sS http://127.0.0.1:4787/healthz answers {"ok":true,"sessions": when the middleware is up, and bun --version must print 1.3.13, the version the repository pins. The middleware shows how to start it.
Hooks work with no upstream configured. The MCP gateway does not, and answers 404 until CONDENSATE_MCP_UPSTREAMS lists at least one server.
Make the key
Condensate does not mint the key. You make one random value and give it to both sides. The middleware checks it as CONDENSATE_LOCAL_API_KEY, and each agent sends it as CONDENSATE_KEY. The plugin stores nothing, so each agent reads CONDENSATE_KEY from the environment of the shell that starts it.
-
Make the key, readable only by you:
mkdir -p ~/.config/condensate/middleware (umask 077 && openssl rand -hex 32 > ~/.config/condensate/middleware/api-key) -
Start the middleware with it. From the repository root:
export CONDENSATE_HOST=127.0.0.1 export CONDENSATE_LOCAL_PRINCIPAL_ID=local-dev export CONDENSATE_LOCAL_API_KEY="$(cat ~/.config/condensate/middleware/api-key)" export CONDENSATE_MCP_UPSTREAMS='[{"name":"tools","url":"http://127.0.0.1:9000/mcp","auth":"none"}]' bun apps/middleware/backend/index.tsReplace the upstream with a server you run. To see the code-mode tools as well, set
CONDENSATE_CODE_MODE=opt-inandCONDENSATE_CODE_MODE_PRINCIPALS=local-dev. The boot log has a"msg":"local_key_auth_enabled"line when the key is in force.With the installer in native mode, put
CONDENSATE_LOCAL_API_KEY=...andCONDENSATE_MCP_UPSTREAMS=...in~/.local/state/condensate-fresh/middleware.envas plainKEY=valuelines, then stop the installer with Ctrl-C and run./scripts/install.sh nativeagain. The installer leaves both empty. The docker mode does not read this file yet. -
Check the key against the gateway:
curl -sS http://127.0.0.1:4787/mcp \ -H "x-api-key: $(cat ~/.config/condensate/middleware/api-key)" \ -H 'content-type: application/json' \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'A working key returns
result.tools, which includesharness__set_modeand your upstream's tools named<upstream>__<tool>. 401 means the key does not match, 404 means no upstream is configured, and 503 means the middleware has no key set.
Claude Code
-
From the repository root, build the plugin's generated files.
bun packages/condensate-plugin/generate.tsprintsGenerated 0 files.when everything is current, which a fresh checkout is, because git tracks the generated files. -
In the shell that will start Claude Code, set the key, and the address if it is not the default:
export CONDENSATE_KEY="$(cat ~/.config/condensate/middleware/api-key)" export CONDENSATE_URL=http://127.0.0.1:4787 -
Start
claudefrom that shell and add the checkout as a marketplace, with the absolute path of the repository root, then install the plugin:/plugin marketplace add /absolute/path/to/condensate /plugin install condensate@condensate -
Exit and start a new
claudesession from the same shell, so the hooks and the MCP server load withCONDENSATE_KEYset.
The same steps work outside a session as claude plugin marketplace add and claude plugin install. To install from GitHub instead of a checkout, skip step 1 and add the marketplace as condensate-dev/condensate. The repository is private, so the clone uses your git credentials.
To check it, note sessions from /healthz, send any prompt in the new session, and read /healthz again. sessions is one higher, and the middleware's output shows an auth_ok line and a verdict line for the prompt. /mcp in the session lists the Condensate server as connected, with the tools the tools/list check returned. A prompt denied with a reason starting condensate-hook: means the hook ran but could not get a verdict, and the reason names the fault.
Codex
These steps follow Codex 0.160, the version the runtime pins. Codex loads the plugin's hooks from packages/condensate-plugin/.codex-plugin/plugin.json and starts a small stdio bridge that forwards MCP requests to ${CONDENSATE_URL}/mcp with the key in x-api-key. Codex passes CONDENSATE_KEY and CONDENSATE_URL from its own environment to the bridge, so a key set anywhere else does not reach it.
- Build the generated files, as for Claude Code.
- Add the checkout as a marketplace with
codex plugin marketplace add /absolute/path/to/condensate, orcondensate-dev/condensateto install from GitHub. - Export
CONDENSATE_KEYandCONDENSATE_URLin the shell that will start Codex, as above. - Run
codex, then/plugins, and install the Condensate plugin from the Condensate marketplace.codex plugin add condensate@condensatedoes the same without the menu. - Review the plugin's hooks and trust them. Codex does not run a plugin's hooks until you do.
- Exit and start a new
codexsession from the same shell.
Check it the same way as Claude Code. The verdict line says "harness":"claude-code" under Codex too, because both CLIs run the same hook script.
If it does not work
| Symptom | Cause | Fix |
|---|---|---|
Every prompt and tool call is denied with condensate middleware unreachable | The hook cannot reach the middleware, so it fails closed. | Start the middleware, or point CONDENSATE_URL at it, and start a new session. CONDENSATE_HOOK_FAIL_OPEN=1 lets every fault continue, which removes the policy check, so keep it to local development. |
Denied with CONDENSATE_KEY is not set | The CLI started from a shell without the key. | Export CONDENSATE_KEY in the shell that starts claude or codex, then start a new session. |
Denied with condensate middleware returned HTTP 401 | The key does not match CONDENSATE_LOCAL_API_KEY. | Use the same value on both sides, and check it with the tools/list request. |
Denied with condensate middleware returned HTTP 503 | The middleware has no key set, which is the installer's default. | Set CONDENSATE_LOCAL_API_KEY and restart the middleware. |
The Condensate MCP server fails, or Codex logs middleware returned HTTP 404 | No upstream is configured, so there is no /mcp. | Set CONDENSATE_MCP_UPSTREAMS and restart the middleware. |
No codemode__ tools | Code mode is off, or your principal is not listed. | Set CONDENSATE_CODE_MODE=opt-in and add your principal id to CONDENSATE_CODE_MODE_PRINCIPALS. |
A plugin change does not show up after generate.ts | Each CLI keeps its own installed copy. | Uninstall the plugin (claude plugin uninstall condensate@condensate, codex plugin remove condensate@condensate), install it again, and start a new session. |
| Skills are missing | The marketplace copy predates the commit that started tracking the generated skills. | Refresh the marketplace (claude plugin marketplace update condensate, codex plugin marketplace upgrade condensate), reinstall the plugin, and start a new session. |
Three skills are not bundled. hindsight-docs and transitions-dev each need a large set of reference files, and install-anti-slop copies from a repository checkout that a plugin install does not have.
Read next
- The middleware covers hook verdicts, consent tiers and code mode.
- Connect an upstream adds MCP servers to the gateway.
- Connect explains what the middleware decides and why.