Skip to content

Bring Your Own Harness

You already have an AI coding agent. Maybe two. Maybe Claude Code is your daily driver, you’ve been eyeing OpenAI’s Codex CLI, and Aider is sitting in your pip list from that one weekend project.

ModelReins doesn’t replace any of them. It harnesses them. Each agent becomes a worker. The router picks the best one for each job. When one hits a cap, the others pick up.

This walkthrough wires Codex CLI as a worker on your laptop. The same pattern works for any harness with a non-interactive CLI mode.

Anthropic just told subscription users that third-party harnesses don’t get to run on their plan limits anymore. OpenAI has its own caps. Local models don’t have cloud caps but they have RAM. No single agent is bulletproof.

ModelReins is the layer that admits this. Your fleet has all of them. The router routes around whichever one is currently broken.

For Codex CLI:

Terminal window
npm install -g @openai/codex
codex login

For Aider:

Terminal window
pip install aider-chat

For OpenClaw or anything else: install however its docs say. If it has a non-interactive mode (something like tool exec "<prompt>" or tool --message "<prompt>"), it will work as a ModelReins worker.

Terminal window
mkdir -p worker/codex-mybox
cd worker/codex-mybox

Step 3: Drop in a start.bat (Windows) or start.sh (Mac/Linux)

Section titled “Step 3: Drop in a start.bat (Windows) or start.sh (Mac/Linux)”
Terminal window
@echo off
cd /d "%~dp0"
set MODELREINS_URL=https://app.modelreins.com
set MODELREINS_TOKEN=mr-yourname-xxxxxxxxxxxxxxxxxx
set MODELREINS_WORKER=codex-mybox
set MODELREINS_WORKER_TYPE=codex
set MODELREINS_WORKER_MODEL=gpt-5-codex
set MODELREINS_WORKER_TAGS=code,architecture,review,refactor,general
set MODELREINS_PROVIDER=codex
set MODELREINS_SKIP_PREFLIGHT=1
set MODELREINS_POLL_MS=5000
node "%~dp0..\daemon.js" codex-mybox

The provider name (MODELREINS_PROVIDER=codex) tells ModelReins which preset to use. Built-in presets: claude, codex, aider, ollama-cli, ollama-http, lmstudio, 1minai. The preset knows the right command, prompt arg, and flags — you don’t have to.

Terminal window
./start.bat

You’ll see the rein banner and Ready — waiting for jobs.... The worker is now polling the brain every 5 seconds for jobs assigned to its name.

Open the Saddle in VS Code. The new worker shows up in the Target row at the bottom of the cockpit. Click it to pin all dispatches to that worker, then hit Dispatch Job with any prompt.

DISPATCH standard / auto → codex-mybox
Prompt: refactor this function for clarity

It runs. Output streams back into the saddle. You just used Codex CLI as a ModelReins worker.

You took an AI agent that Anthropic doesn’t want running under your subscription, dropped it onto your own machine, and gave it a job through ModelReins. The job ran on your hardware, billed against your OpenAI account, and the result came back through the same saddle you use for Claude Code.

Now do it again with Claude Code as a second worker. And Ollama as a third. Now you have three independent providers in a single fleet, and the router picks between them. When Anthropic caps your subscription at 5pm, your fleet keeps running on Codex and Ollama. When OpenAI rate-limits you, the fleet keeps running on Claude and Ollama. When the internet dies, Ollama keeps running.

That’s the harness around your harnesses. That’s the rein.

If your tool isn’t in the preset list, drop a yaml file into providers/yourtool.yaml:

name: yourtool
display_name: "Your Tool"
command: yourtool
prompt_arg: "exec"
extra_args: "--non-interactive --skip-confirm"
output_format: lines
capabilities:
- code_gen
- file_edit
cost_model: per_task

prompt_arg is whatever flag (or subcommand) the tool uses to take a single prompt. extra_args is the bag of flags that put the tool in headless mode (skip git checks, bypass approvals, no interactive prompts). output_format: lines is the safe default — use stream-json only if the tool actually emits Anthropic-style stream events.

Then point a worker at it:

Terminal window
set MODELREINS_PROVIDER=yourtool

That’s the entire integration. Same pattern for everything.