Balanov/uncut

The lossless, headless coding agent harness. One 7 MB static binary, four tools, plain stdin/stdout, no silent cuts.

UNCUT is a small command-line tool that lets an AI coding model work on your files and run commands, designed for use in shell pipelines, CI jobs, containers, and experiments. It's a single ~7 MB binary with no interactive interface (headless), no telemetry, and no plugin system.

Core idea — "lossless": UNCUT never truncates, summarizes, or rewrites your prompts, file contents, or command output. The full conversation is sent on every model call. If the AI provider cuts off a response due to its output limit, UNCUT exits with an error instead of pretending the partial answer is complete. It also rejects invalid UTF-8 input rather than silently replacing characters.

What it does: You give it a text prompt (e.g., "Inspect this repository and fix the failing tests"), and it runs an agent loop: the model can call four tools — read a file, write a file, replace exactly one occurrence of text, and run a shell command. The final answer goes to stdout; optionally, --json emits structured NDJSON events showing each step.

Key properties:

  • Provider neutral: Works with any OpenAI-compatible Chat Completions endpoint, including local servers like Ollama.
  • Resumable: Optional append-only JSONL session files let you pause and continue work later, preserving the full history.
  • Portable: Statically linked Go binary, no runtime dependencies. Works on Linux, macOS, and Windows, on both amd64 and arm64.
  • Forkable: Only 837 lines of implementation Go, MIT licensed.

Configuration: Set environment variables for the model ID, API key, and base URL. Flags control the working directory, session file, max steps (default 32), max tokens, request timeout, and whether to read a workspace AGENTS.md file.

Exit codes: 0 = success, 1 = provider/I/O/execution error, 2 = invalid usage, 3 = provider hit its output limit (partial answer rejected), 4 = max steps reached before a final answer.

Safety warning: UNCUT is not a sandbox. The model can run shell commands with your user's permissions, and file-tool workspace checks don't constrain what shell commands can access. The README advises running untrusted tasks in a disposable container or isolated environment. There are no approval popups, automatic commits, or retries.

Verification: The project includes a proof script (bench/proof.py) that tests the real binary against a deterministic local provider, checking large-file transport, session resume, truncation failures, step limits, and invalid UTF-8 handling. These are transport tests, not model-quality benchmarks.

Installation: Download a prebuilt binary from GitHub releases (verify with SHA-256 checksums; binaries aren't code-signed yet), or build from source with Go 1.26+.

Related

  • Project
  • Project
  • Project
  • Project