Product

Clade
Structural Integrity for
AI-Generated Code

AI code generators write locally correct code that becomes globally incoherent at scale. Clade is the enforcement layer that prevents this — a protocol graph engine that guarantees every AI-generated change respects the declared communication structure of your application.
01

The Problem

Claude Code, Cursor, Codex, and every other AI code generator share the same failure mode: they write implementations without knowing what communication the implementation is supposed to serve. Each function is locally correct. The global communication structure collapses.

When an AI writes a function, it makes locally optimal decisions — imports the most convenient library, calls the most accessible API, stores state in the most reachable location. None of these decisions are wrong in isolation. Together, they create a system where every component reaches across boundaries to communicate with components it was never meant to talk to directly.

The result: after enough AI-generated iterations, the codebase becomes structurally uncontrollable. Not because the AI is incompetent, but because neither the AI nor the developer declared the communication structure before writing the implementation.

The Root Cause

AI code generators are given implementation tasks without communication protocols. They produce code that works locally but communicates globally in unintended ways. The fix is not smarter AI. The fix is declaring the communication structure first, then mechanically enforcing it on every change.


02

Software Is a Communication System

Software is not a collection of functions, classes, or files. Software is a machine humans build for communication. Every component exists to send or receive information. The communication is the system. The implementation is what makes the communication happen.

The application is defined by what communicates with what, and through what protocol. Strip away the implementations and the communication structure remains. Strip away the communication structure and the implementations have nothing to serve.

The monolith is what happens when implementation precedes communication protocol. Every component reaches for what it needs, because no protocol tells it what it is allowed to receive and nothing else.

03

What Clade Does

Clade defines your application as a hierarchical communication system — a tree of IO protocols. Then it mechanically enforces that every code change, whether written by AI or by hand, respects the declared structure. The protocol tree is the application. Source code implements it. When they conflict, the tree wins.

The Protocol Tree

A Clade application is declared as a tree of communication nodes. Each node has a parent, an input protocol, and an output protocol. Children of the same parent never communicate directly — all inter-child communication flows through the parent. This eliminates coupling between siblings and makes each node independently replaceable.

The Enforcement

Clade is not documentation. It is not a linter. It is a gatekeeper. The Clade engine validates every change against the declared protocol tree and blocks changes that violate it. Commits that cross protocol boundaries are rejected. Imports that reach outside the parent boundary are flagged. Downstream mismatches are surfaced and must be resolved before the commit proceeds.

What Clade Does vs. What Your AI Tool Does

Clade (protocol engine) Claude Code / Cursor / Codex
Manages the protocol tree Reads and writes code
Computes boundaries Understands every programming language
Detects coupling violations Generates implementations
Blocks invalid commits Suggests commit messages
Tracks protocol evolution Tracks line changes (via Git)

Clade never generates code. Your AI tool never enforces structure. They are complementary — and together they produce AI-generated codebases that stay structurally sound at any scale.


04

How It Works

Clade integrates with your existing workflow in three layers. Each layer reinforces the others. Together they create mechanical enforcement that neither developers nor AI tools can bypass.

Layer 1 — MCP Server (Claude Code)

For Claude Code users, Clade runs as an MCP server. Claude Code calls Clade tools naturally as part of its workflow — checking boundaries before writing code, validating changes after, committing atomically. The MCP server is the primary enforcement point.

// Claude Code settings — one-time setup
{
  "mcpServers": {
    "clade": {
      "command": "clade",
      "args": ["mcp-serve"]
    }
  }
}
  

Layer 2 — Git Hooks (Universal)

A pre-commit hook installed by clade init runs clade check on every commit. This works with any AI tool, any IDE, any workflow. If the commit violates a protocol boundary, it is blocked.

Layer 3 — Adapter Rules (Cursor, Codex, etc.)

For tools that don't support MCP, Clade generates rules files in the tool's native format. These guide the AI tool toward correct behavior. The git hooks provide the hard enforcement underneath.

Tool Integration Enforcement
Claude Code MCP server MCP tools + git hooks
Cursor .cursor/rules Rules + git hooks
Codex Pre/post hooks Git hooks
Any tool Git hooks Git hooks

05

Installation

Clade is a single native binary. Download it, put it on your PATH, and structural enforcement is active in under a minute. No Python required. No dependencies.

Download

Platform Binary Size
macOS (Apple Silicon) clade-0.1.0-macos-arm64 26 MB

Install

# download and install
sudo curl -fsSL https://imlore.com/clade/releases/clade-0.1.0-macos-arm64 -o /usr/local/bin/clade
sudo chmod +x /usr/local/bin/clade

# verify
clade --version
  

No API keys. No account. No runtime dependencies. Runs entirely local.

Quick Start

# 1. Initialize a Clade project in your repo
clade init

# 2. Declare your first protocol node
clade node add WeatherFetch \
  --parent root \
  --input "CityName (string)" \
  --output "WeatherData (temp, condition, humidity)"

# 3. View the protocol tree
clade status

# 4. Check structural integrity
clade check
  

clade init creates a .clade/ directory with your protocol graph and installs a git pre-commit hook. Every commit is now validated against the declared communication structure.

Claude Code — MCP Server

For Claude Code users, Clade runs as an MCP server. Add this to your Claude Code settings once, and Clade tools are available in every session:

// ~/.claude/settings.json
{
  "mcpServers": {
    "clade": {
      "command": "clade",
      "args": ["mcp-serve"]
    }
  }
}
  

Claude Code will automatically call clade_status, clade_check, and clade_commit as part of its workflow. No manual commands needed.

Other AI Tools

Tool Setup
Cursor clade adapter cursor — generates .cursor/rules
Codex Git hooks enforce on every commit automatically
Any tool Git hooks — clade init is all you need

06

The Convergence Guarantee

Every Clade-managed project maintains a structural invariant: the protocol tree is always consistent after every commit. No commit can introduce a structural contradiction. Every task moves the system from one consistent state to another.

This works because Clade enforces a strict ordering:

  1. Declare — protocol changes are declared before code is written
  2. Implement — code is written within the declared boundary
  3. Validate — Clade checks protocol compliance and coupling
  4. Resolve — downstream mismatches are surfaced and fixed
  5. Commit — source and protocol history committed atomically

Skip any step and the commit is blocked. Follow every step and the result is provably consistent. This is not a guideline — it is mechanical enforcement.

The protocol tree is a fixed point attractor. Every step that follows the rules moves toward it. No step that follows the rules can move away from it.

AI writes the code. Clade keeps it sound.

Without Clade, every AI-generated iteration adds structural entropy. Components reach across boundaries. Dependencies tangle. The communication structure that nobody declared becomes impossible to change without breaking something unexpected.

With Clade, the communication structure is declared first and enforced mechanically. AI tools write code within declared boundaries. Commits that violate protocols are blocked. Downstream impacts are surfaced and resolved. The codebase converges to a structurally sound state after every task.

Software is a hierarchical communication system.
Clade declares the protocols.
Your AI tool implements them.
Clade enforces they stay sound.
The protocol tree outlasts every implementation.