Home / Blog / Building my AI harness in 2026 news update
Tech News

Building my AI harness in 2026 news update

Valentin Haudiquet launched Rhema Code, an open-source terminal interface and Rust agent harness that replaces bloated toolsets with a single bash call.

By Dillip Chowdary • Nov 29, 2026 • Source: vhaudiquet.fr

Building my AI harness in 2026 news update
Image: vhaudiquet.fr

At a glance

Product
Rhema Code and Rhema
Author
Valentin Haudiquet
Crate
rhema-host-agent
Language
Rust
Baseline tool count
1 tool
Context window capacity
1M tokens

Software engineer Valentin Haudiquet launched an open-source terminal user interface called Rhema Code along with its modular Rust harness framework named Rhema, as detailed in vhaudiquet.fr's report. The project explores alternative software engineering patterns for AI agents by paring tool execution down to an absolute minimum and addressing context growth through progressive conversation blurring rather than typical summarization. Haudiquet structured the core execution harness within a dedicated crate named rhema-host-agent to coordinate dependencies and examine tool calling mechanics under real coding conditions.

This report examines how Rhema handles agent interaction loops, API communication protocols, tool minimalism, external protocol integration, and the emerging concept of code mode. It is written for systems engineers, AI tool builders, and software architects designing agentic developer interfaces. Haudiquet's implementation demonstrates that reducing model friction often comes from subtracting specialized tooling layers rather than accumulating distinct function declarations.

01Three components of an execution loop

At its foundation, an AI harness relies on a model loop, a provider API client, and a tool execution environment. The client transmits conversation history to an external service and receives generated tokens until the model emits an end-of-turn marker. When the model invokes a function, the harness intercepts the special token sequence locally, runs the command, and returns the output to continue the loop.

This sequence operates inside an ongoing user-feedback cycle where developers submit instructions and receive responses across successive turns. Because large coding models frequently encounter input boundaries, the harness must monitor total token consumption. Each subsequent turn resends earlier prompts, conversation messages, and tool outputs back across the network, steadily compounding cost and latency.

Modern coding models generally support context windows of 1M tokens, treating tokens roughly as four-character representations. If a session consumes the entire allotment without active context management, the execution stops abruptly. Rhema Code monitors these turn exchanges to keep agent workflows responsive without exceeding strict memory boundaries.

02Structured schemas in provider endpoints

Provider communication across modern models relies predominantly on OpenAI-compatible or Anthropic-compatible API interfaces. Implementations from OpenAI, DeepSeek, OpenRouter, and local engines like llama.cpp standardize on a chat completion endpoint at POST /v1/chat/completions. The request body packages the system instructions, user dialogue, and formal tool specifications within a single JSON payload.

Model providers have replaced informal system prompt instructions with native JSON schema definitions to declare function calls. Instead of asking a model to emit custom formatting, the API payload encodes function parameters, required arguments, and property descriptions directly. This standardization allows harnesses to validate model arguments before running commands on the host system.

Rhema configures this endpoint by transmitting explicit schemas for supported operations alongside initial user messages. The client monitors the completion response for function calls, unpacks the arguments against the schema, and executes the designated handler before posting results back to the endpoint.

03Minimal tools versus single shell execution

Advertisement

Tech Pulse Daily

Get tomorrow's pulse first

Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.

Agent architectures often provide default toolsets for text manipulation and shell execution. The Pi coding agent, for example, establishes a baseline containing four tools: read, write, edit, and bash. These specific operations reflect the conventional belief that automated software development primarily requires file editing and command execution.

Agent HarnessBuilt-in ToolsPrimary Tool Strategy
Pi Coding Agentread, write, edit, bashDistinct file operations and terminal execution
Rhema CodebashSingle shell tool replacing dedicated file utilities

Haudiquet observed that models frequently ignore specialized tools like dedicated grep utilities, preferring to run grep directly through bash. This tendency forces harness developers to add steering prompts forbidding shell-based search commands. Rhema resolves this friction by eliminating specialized tools entirely and exposing only bash, allowing the model to perform reads, edits, and file writes using standard utilities like cat, grep, sed, and echo.

04Extending capabilities through external protocols

Software tasks frequently extend beyond command-line interfaces into visual or specialized domains such as KiCad PCB layouts, Blender 3D designs, or Excalidraw diagrams. While terminal utilities like the GitHub CLI gh handle repository operations via shell access, graphic applications lack command-line tools. Harnesses solve this limitation by integrating the Model Context Protocol, or MCP.

MCP allows external applications to operate as servers that advertise specialized tools, prompts, and resources over JSON-RPC. A harness running an MCP client connects directly to these servers and dynamically appends the discovered operations to its active toolset. This mechanism allows developers to extend agent functionality without modifying the underlying harness engine.

Note: MCP integration introduces context overhead when users attach numerous servers, as single integrations like GitHub can expose around 90 tools on their own.

05Code mode and terminal piping

When harnesses expose dozens of distinct MCP tools, models struggle with tool selection, experience slower inference, and exhaust context limits. Cloudflare introduced code mode to address this challenge by replacing raw tool lists with a TypeScript API. Under this design, the harness exposes a single codemode execution tool, enabling the model to chain operations programmatically, script intermediate logic, and discover server endpoints dynamically through progressive disclosure.

Command
curl https://api.api/query | jq '.field.description'

Implementing code mode requires shipping a sandboxed execution runtime capable of resolving dynamic APIs. The Pi agent embeds QuickJS to evaluate code mode scripts, while OpenCode built a custom interpreter for a JavaScript-like syntax. Rhema achieves the same composability and filtering benefits without an embedded language runtime by relying on standard bash pipes to chain utilities and extract specific fields.

Frequently asked questions

What is Rhema Code?

Rhema Code is a terminal user interface for an AI coding agent built on top of a modular Rust harness framework called Rhema.

Why does Rhema expose only the bash tool to the model?

Rhema provides only bash because models can already read, write, and edit files using standard shell commands like cat, sed, and grep without needing redundant specialized tools.

What problem does code mode solve for AI agents?

Code mode prevents context bloat and tool confusion caused by dozens of MCP tools by replacing large tool lists with a programmatic scripting environment.

Sources

Dillip Chowdary

Author

Dillip Chowdary

Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.

Related on Tech Bytes

Advertisement

5-min tech signal

Weekday briefing for engineers who skip the noise.

No spam · Unsubscribe anytime

Advertisement

✈️ CareerPilot

Your AI job-search copilot

Match your resume against live Ashby, Greenhouse & Lever openings — fit scores, job-specific resume optimization and email alerts.

Find matching jobs →

Free Tools

Browse all tools →