module LittleGhost::Harnesses

Harnesses run external coding-agent command-line tools, such as Claude Code, Codex, and OpenCode, as bounded subprocesses: inside an isolating Sandbox with the tool’s own safeguards off, or on the host with them on.

Each harness builds the tool’s non-interactive command line, reads its JSON event stream, and returns one Harnesses::Result. Progress arrives as :harness StreamEvent values while the tool works.

harness = LittleGhost::Harnesses.resolve(:claude_code).new(
  sandbox: run.sandbox,
  executable: "/opt/harnesses/bin/claude",
  home_root: :scratch,
  defaults: {base_url: "http://127.0.0.1:3130"}
)
request = LittleGhost::Harnesses::Request.new(
  prompt: "Add a test for the refund policy lookup.",
  budget_usd: 2,
  max_turns: 40,
  timeout: 900
)
result = harness.run(request) { |event| puts event.data[:event][:kind] }
result.status # => :completed

Built-in harnesses are registered as :claude_code, :codex, and :open_code. Use Harnesses::Tool to let an Agent delegate work to them. See the Harnesses guide.