Does holaOS Support Code Generation? AI-Driven Development Guide

Yes, holaOS supports native AI-driven code generation through dedicated harnesses for OpenAI Codex and Claude-Code, integrated via the Model Context Protocol (MCP) to spawn CLI tools and automatically insert generated files into workspaces.

holaOS, developed by holaboss-ai, is an open-source runtime environment designed for autonomous AI agents. The platform includes built-in holaOS code generation capabilities that allow agents to write, refactor, and manage source code using state-of-the-art large language models without leaving the workspace environment.

How holaOS Implements Code Generation

The platform implements code generation through a dual-harness architecture that wraps popular AI coding assistants and exposes them as standardized tools through the Model Context Protocol.

The Codex and Claude-Code Harnesses

holaOS defines dedicated harnesses in runtime/harnesses/src/codex.ts and runtime/harnesses/src/claude-code.ts that register the code-generation models. The Codex harness (codexHarnessDefinition) launches the run-codex CLI command and establishes a bidirectional JSON-RPC protocol, registering the gpt-5.3-codex model. Similarly, the Claude-Code harness (claudeCodeHarnessDefinition) spawns the Claude-Code binary and exposes its /v1/completions endpoint.

Runtime Integration via MCP

The system integrates these harnesses into the agent toolchain through two critical server components. runtime/api-server/src/runtime-agent-tools.ts imports the harness functions (such as runCodex) and adds them to the agent-level toolset. Then, runtime/api-server/src/runtime-tools-mcp.ts registers the code_generate capability, mapping tool IDs like codex_generate to HTTP routes (e.g., /api/v1/capabilities/runtime-tools/codex/generate). This MCP layer handles authentication, model selection, and result parsing, making the models available as callable tools within any workspace.

Using holaOS Code Generation Features

Developers and agents can request code generation through either the TypeScript MCP client or direct REST API calls.

Generating Code with the Codex Harness

The MCP client provides a typed interface for requesting TypeScript, Python, or other language outputs:

import { createMcpClient } from '@/utils/mcp-client';

// Initialise an MCP client for the current workspace
const mcp = await createMcpClient({ workspaceId: 'my-ws' });

// Call the Codex code-generation endpoint
const result = await mcp.callTool('codex_generate', {
  // Prompt describing the desired code
  prompt: `Write a TypeScript function that returns the nth Fibonacci number.`,
  // Optional model selection; defaults to the first registered model
  model: 'gpt-5.3-codex',
  // Desired filename (the runtime will write the file automatically)
  filename: 'fib.ts',
});

console.log('Generated file:', result.file_path);
// → "/workspace/my-ws/fib.ts"

This call routes through runtime-tools-mcp.ts, which translates the tool ID codex_generate into the internal runCodex implementation.

Generating Code with Claude-Code

To use the alternative Claude-Code harness, call the corresponding tool ID:

const result = await mcp.callTool('claude_code_generate', {
  prompt: `Create a Python script that reads a CSV file and prints the sum of a column called "price".`,
  model: 'claude-3-5-sonnet',   // model name taken from the harness definition
  filename: 'sum_prices.py',
});

console.log(result.file_path); // → "/workspace/my-ws/sum_prices.py"

REST API Integration

External services can bypass the MCP client and call the generation endpoint directly:

curl -X POST https://hola.example.com/api/v1/capabilities/runtime-tools/codex/generate \
  -H 'Content-Type: application/json' \
  -d '{
        "prompt":"Write a Rust function that computes the factorial of n.",
        "filename":"factorial.rs"
      }'

The endpoint returns file metadata and a download URL, allowing non-TypeScript services to leverage holaOS code generation capabilities.

Key Source Files and Architecture

Understanding the following files is essential for customizing or debugging the code generation pipeline:

Together, these components enable holaOS to generate source code on-the-fly, insert files directly into the workspace file system, and iterate on code through subsequent AI tool calls.

Summary

  • holaOS code generation is natively supported through dedicated harnesses for OpenAI Codex and Claude-Code.
  • The system uses the Model Context Protocol (MCP) to expose generation models as callable tools within agent workspaces.
  • Generated files are automatically written to the workspace file system, enabling immediate use by linters, test runners, and other tools.
  • Both programmatic TypeScript clients and standard REST APIs are supported for requesting code generation.

Frequently Asked Questions

Does holaOS support code generation natively?

Yes. According to the holaboss-ai/holaOS source code, code generation is a core platform capability implemented through first-party harnesses in runtime/harnesses/src/codex.ts and runtime/harnesses/src/claude-code.ts, not through third-party plugins or external integrations.

Which AI models does holaOS use for code generation?

The platform currently supports OpenAI Codex (specifically the gpt-5.3-codex model) and Claude-Code (using models like claude-3-5-sonnet). These are registered via harness definitions and can be selected by name when calling the generation tools.

How does holaOS integrate generated code into workspaces?

When a generation request is processed through runtime/api-server/src/runtime-agent-tools.ts, the resulting code is returned as a JSON object containing a file_path. The runtime automatically writes this content to the specified location within the workspace file system, making it immediately available for editing or execution.

Can external services use holaOS code generation via API?

Yes. The system exposes REST endpoints such as /api/v1/capabilities/runtime-tools/codex/generate defined in runtime-tools-mcp.ts. External services can authenticate via standard headers and request code generation using JSON payloads without requiring the TypeScript MCP client.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →