getlatentic

agent-harness: Run Claude Code and Other Agents from Rust

agent-harness is a Rust framework for calling Claude Code, OpenAI Codex, OpenCode, and compatible agents from code. It normalizes their output into one typed event stream so applications can switch agents without changing their event-handling loop.

View on GitHub Compare
Stars
2
Forks
0
Stars, last 30 days
+2
Last commit
2 months ago
Contributors
1

Our take

Newless than six months old

Health score

38/100

How it is scored
Activity
56
Community
4
Issues
21
Pull requests
69

+2 stars in the last 30 days

  • Fewer contributors than 91% of the projects we track

A promising, actively developed Rust integration layer for coding agents, but its very early, single-contributor status makes it a higher-risk choice for production dependencies.

Good fit if

  • You are building in Rust and need a shared event interface for Claude Code, OpenAI Codex, ACP agents, or OpenAI-compatible models.
  • You want to expose application-defined tools to an agent without deploying a separate MCP server.
  • You can work with an alpha-stage API and its Apache-2.0 licensing option.

Look elsewhere if

  • You need an API with established production maturity: the project is less than six months old, its latest release is an alpha, and its contributors are concentrated in one person.
  • Your project requires demonstrated issue-resolution history; the supplied health data records no issues closed in the recent period.
  • You need a language other than Rust or cannot use a dependency licensed under Apache-2.0 or MIT.
All health signals
Last commit2026-09-05 (2 months ago)
Commits, last 90 days25
Releases, last 12 months6 (latest v0.6.0-alpha.2, 2026-09-05, pre-release)
Contributors1
Issues closed, last 90 days0
Pull requests merged, last 90 days26 (typically merged in 0 days)
Project age5 months

Checked on 2026-11-09 with the GitHub API.

Project history

Daily GitHub snapshots since Oct 7, 2026. History covers stars and forks; health signals are not tracked historically.

Selected snapshot

Stars

4

Forks

0

Change since Dec 4, 2026: 0 stars·0 forks

Overview

agent-harness is a Rust framework for using Claude Code, OpenAI Codex, OpenCode, and other coding agents from Rust programs. Instead of making each application launch an agent and parse its distinct output, it provides a common Harness interface and normalized RunEvent stream for text, tool calls, reasoning, plans, usage, and lifecycle events.

It also includes an OpenAI-compatible agent that speaks the chat API and runs its tool loop in Rust, plus cli-stream, a standalone subprocess engine. The project is aimed at developers building agent-enabled applications who want to swap between supported agents or add an adapter of their own.

Key Features

  • A common Harness interface for agent implementations and a normalized RunEvent stream.
  • Adapters for Claude Code, OpenAI Codex, and ACP agents, including OpenCode and Gemini CLI.
  • An OpenAI-compatible agent for providers such as Ollama, OpenRouter, vLLM, LM Studio, and llama-server.
  • ToolServer and HostTool support for offering in-process tools to agents, including through MCP.
  • run returns an event receiver; adapters can implement start with a callback instead.
  • readiness() reports available tools and provides installation hints without installing them.
  • cli-stream spawns CLI processes, streams their output, and supports cancellation.

Use Cases

  • A Rust application can provide a consistent event-handling loop while letting users choose between Claude Code, Codex, or another supported agent.
  • Developers can connect an agent to functions implemented inside their application using HostTool, rather than running a separate tool-server binary.
  • Teams working with OpenAI-compatible endpoints can build an agent workflow around a local model server or hosted provider.
  • Rust developers integrating a command-line program can use cli-stream to stream its output and cancel the subprocess without adopting the agent framework.

What you need

Detected in the repository

  • Rust 1.88 or newer (from Cargo.toml)
  • Automated checks on GitHub Actions

License in plain words

Apache-2.0permissive

  • Commercial use: yes
  • Modify and redistribute: yes
  • You must keep: the license, the NOTICE file and a note of your changes
  • Share your changes: no
  • Includes an explicit patent grant from the contributors:

A summary, not legal advice: the LICENSE file is what applies.

Getting Started

cargo add agent-harness

See the repository README for provider setup, feature flags, and runnable examples. The crate requires Rust 1.88 or later.

Considerations

The project is explicitly in active development, and its API may change. Its recent commits and releases indicate ongoing work, but the latest release is a prerelease and development is concentrated in one contributor. The supplied data also reports no issues closed in the recent period, so teams should assess their own support and maintenance requirements. Rust 1.88 or later is required; no Docker or Compose runtime is listed. The repository offers a choice of MIT or Apache-2.0 licensing.

Found this useful?

Share it with someone who would like agent-harness.

Comparisons