Overview
Most programming languages are designed for humans—they assume you can read error messages, interpret warnings, and manually trace through stack output to fix bugs. AI agents don't do any of that well. They thrive on structured data: predictable tokens, stable codes, and machine-parseable repair hints. This gap is exactly what Vercel Labs aims to close with Zero, an experimental systems programming language that is faster, smaller, and easier for agents to use and repair.

Zero compiles to native executables, gives you explicit memory control, and targets low-level environments—much like C or Rust. But what sets it apart is that its compiler output and toolchain were designed from day one to be consumed by AI agents, not just human engineers.
In this tutorial, you'll learn how to set up Zero, write your first program, leverage its agent-first diagnostics, and avoid common pitfalls. By the end, you'll understand how Zero's structured toolchain can supercharge agentic workflows.
Prerequisites
Before diving in, make sure you have:
- Basic programming knowledge—familiarity with systems concepts like pointers, memory allocation, and compilation is helpful.
- Command-line experience—you'll be using a CLI for most operations.
- Understanding of JSON—the toolchain outputs structured data in this format.
- An environment to run Zero—currently Zero is experimental and requires a compatible system (Linux, macOS, or Windows WSL). Check Vercel Labs' official site for installation instructions.
Step-by-Step Instructions
1. Installing Zero
Although the original announcement doesn't detail installation, for this guide assume you have a package manager or direct download. Once installed, verify with:
zero --version
If you see version info, you're ready.
2. Writing Your First Zero Program
Create a file hello.zero with a simple function:
fn main() {
print("Hello, zero!");
}
Notice the syntax resembles Rust or C. Zero uses fn for functions and print for output.
3. Using Structured Diagnostics with zero check --json
Now introduce an error intentionally—try referencing an undeclared variable:
fn main() {
let x = y; // y is not declared
print(x);
}
Run the checker with JSON output:
zero check --json hello.zero
The output looks like:
{
"ok": false,
"diagnostics": [{
"code": "NAM003",
"message": "unknown identifier",
"line": 3,
"repair": { "id": "declare-missing-symbol" }
}]
}
Each diagnostic includes:
- code — a stable identifier (e.g.,
NAM003) that an agent can rely on. - message — human-readable text.
- line — the source line number.
- repair — an object with a typed repair ID.
Agents can parse this JSON directly without guessing from prose.
4. Understanding the Repair Loop
Two subcommands are key for automated fixes:
zero explain <diagnostic-code>— returns a detailed explanation. For example:zero explain NAM003gives a structured description of what the error means and how to fix it.zero fix --plan --json <file-or-package>— emits a machine-readable fix plan. It doesn't apply changes; it tells an agent what to change. Example output:
{
"fixes": [{
"file": "hello.zero",
"line": 3,
"action": "insert",
"code": "let y = 0;"
}]
}
This allows agents to apply precise corrections without interpreting natural language.

5. Using zero skills for Agent Guidance
The zero skills subcommand provides version-matched agent guidance. Run:
zero skills get zero --full
This outputs focused workflows covering Zero syntax, diagnostics, builds, and packages. Agents can ingest this as training or as a reference for context.
6. Exploring the Unified Toolchain
The entire CLI is unified under one binary. Other useful subcommands include:
zero run— execute a Zero program.zero build— compile to native binary.zero graph— show dependency graph.zero size— analyze binary size.zero routes— (likely for web-related features)..zero doctor— diagnose environment issues.
For agents, this simplifies reasoning—there's no need to decide which tool to invoke; one command does it all.
Common Mistakes
Forgetting the --json Flag
Without --json, zero check outputs human-readable text. If your agent depends on structured data, always include the flag. A common error is assuming the default output is JSON.
Misinterpreting Repair IDs
The repair.id field is a stable token, not a natural language explanation. Don't try to parse the message for fix logic—use zero explain to get details, or rely solely on the fix plan.
Skipping --plan Before Applying Fixes
Running zero fix without --plan might apply changes directly. For agent safety, always use zero fix --plan --json first to review the proposed changes before executing.
Ignoring Version Matching
The zero skills content is tied to the installed CLI version. If you update Zero, also update the skills cache with zero skills refresh to avoid stale advice.
Summary
Zero reimagines systems programming for the age of AI agents by delivering structured diagnostics, repair plans, and a unified toolchain. Instead of wrestling with unstructured error messages, agents can parse JSON, read stable error codes, and apply precise fixes with minimal ambiguity. This tutorial covered installation, writing your first program, using structured diagnostics, leveraging the repair loop with zero explain and zero fix, and exploring the full CLI. Avoid common pitfalls like forgetting the JSON flag or misusing repair IDs, and you'll be well on your way to agent-native systems development.