Introduction

Cleat is a compiled, statically typed language for building auditable AI agent backends. It compiles to native binaries via Go — no interpreter, no runtime dependency, single-binary deploys.

What makes Cleat different:

Status

Cleat is in alpha. The compiler, formatter, test runner, language server, and standard library are implemented. 826+ tests across 11 packages. The language is usable for building AI backends, but the API may change.

A taste of Cleat

A code review agent that fetches a PR diff, analyzes it, and returns a typed review:

cleat
import "std/io"
import "std/http"

type ReviewResult = struct {
    fn">@description("Whether the code is safe to merge")
    approved: bool,
    issues: []string,
    summary: string,
}

tool fetch_diff(pr: int) -> Result[string, string]
    needs { net }
    timeout: 10s
{
    let url = "https://api.github.com/repos/acme/app/pulls/${pr}"
    let resp: http.Response = http.get(url)?
    return Ok(resp.body)
}

agent Reviewer {
    model: "claude-sonnet-4-20250514"
    system: "You are a code reviewer. Fetch the PR diff, then provide a structured review."
    tool: [fetch_diff]
    max_turns: 10
    needs { llm, net }
}

fn main() -> int needs { llm, net, io } {
    let review: ReviewResult = Reviewer.run("Review PR #42")?
    io.println("Approved: ${review.approved}")
    io.println("Summary: ${review.summary}")
    return 0
}

The compiler guarantees:

Next steps

Edit this page on GitHub