Kode is a verification-first AI coding agent that replaces the “generate-and-pray” paradigm that defines every other AI coding tool on the market. While Cursor, Copilot, and Cline write LLM-generated code directly to your filesystem and leave you to be the verification layer, Kode puts a deterministic, compiled Go pipeline between the model’s output and your disk. Every patch the LLM produces must pass six sequential verification gates — executing in under 50ms — before a single byte is written. If any gate fails, the patch is rejected and the model self-corrects on compiler-grade feedback.Documentation Index
Fetch the complete documentation index at: https://docs.trykode.xyz/llms.txt
Use this file to discover all available pages before exploring further.
The Core Thesis
No generation without validation. Kode separates concerns that every other AI coding tool conflates. The LLM is a powerful generative engine — excellent at producing plausible-looking code. It is not a compiler, a type-checker, or a security scanner. Kode’s Go engine is the security layer, and it does not negotiate with the model: a failed syntax parse, a hallucinated import, or a blast radius breach is a hard block, not a warning you might notice later in a diff.The Workflow
Kode enforces a structured software-engineering lifecycle on every task: Plan → Critique → Generate → Verify → Apply → Test- Plan — Kode builds a surgical context graph of the relevant files, symbols, and import relationships in your project, so the LLM receives only the information it needs.
- Critique — A pre-generation review layer evaluates the plan and rejects structurally flawed approaches before the LLM wastes tokens generating them.
- Generate — The LLM produces structured code hunks (JSON patches) in response to the task prompt.
- Verify — Every hunk is applied in memory and driven through the 6-gate pipeline. The real filesystem is never touched until all gates pass.
- Apply — Verified hunks are written to disk atomically, with a rollback snapshot already in place.
- Test — Kode runs your project’s test suite. If tests fail, the changes are automatically reverted from the pre-apply snapshot.
The 6 Verification Gates
The gate pipeline runs sequentially. A failure at any gate is a hard stop — the remaining gates do not run.Gate 1 — Syntax
Gate 1 — Syntax
Dual-engine architecture. Kode uses the
go-tree-sitter library for full AST validation when a grammar is available, falling back to fast regex heuristics otherwise. Parses Go, TypeScript, JavaScript, Python, and Rust. A parse error is an unconditional hard block — the patch never proceeds further.Gate 2 — Imports
Gate 2 — Imports
Validates every import path in the generated code against your project’s dependency graph. This gate catches hallucinated packages — the most common class of LLM generation error — before the patch ever reaches a compiler or your
node_modules.Gate 3 — Calls
Gate 3 — Calls
Checks that every function and method call in the generated code references a symbol that actually exists. Kode walks the context graph built during planning and cross-references every call site. Hallucinated package calls are a hard block; unresolvable local calls produce a warning with feedback sent back to the model.
Gate 4 — Blast Radius
Gate 4 — Blast Radius
Walks the dependency graph backward from every modified file and counts the number of downstream files that would be transitively affected. If the count exceeds your configured
max_blast_radius threshold (default: 3 files), the patch is blocked. This prevents large, unscoped refactors from slipping through under the guise of a small task.Gate 5 — Architecture
Gate 5 — Architecture
Enforces declared module boundaries you define in your project config. Prevents the LLM from crossing microservice lines, importing banned internal packages, or violating layer constraints. You can configure this gate to hard-block on violations or to warn and record them for later review.
Gate 6 — Security
Gate 6 — Security
Powered by Sicario, Kode’s integrated AST-based SAST engine. Scans generated code for high/critical vulnerabilities — including SQL injection, XSS vectors, and hardcoded secrets — before they reach disk. High and critical findings are a hard block. Medium and low findings produce a warning. Install Sicario via
kode install sicario or automatically during kode init.Key Features
Beyond the verification pipeline, Kode introduces capabilities no incumbent AI coding tool offers. Ghost Branches — Instead of running one LLM strategy, Kode spawns multiple parallel git worktrees viakode loop --branches N. Each branch uses a different strategy (Alpha: minimal; Beta: modular; Gamma: performance-optimized). All branches run the full verification and test pipeline concurrently. Kode scores each surviving branch by blast radius, token cost, and execution speed, then merges the highest-scoring winner and discards the rest.
Blindfold Mode — Enterprise-grade privacy. When enabled, Kode SHA-256 obfuscates your identifiers — package names, function names, type names — before submitting any code to an external LLM. Your proprietary logic is never exposed in plaintext. The obfuscation mapping is maintained locally and reversed on the output before the patch is applied.
TDD Mode — When enabled in your .kode/kode.json, the verification pipeline enforces a test-first policy: production code writes are blocked unless a corresponding test file already exists or is included in the same patch set.
A minimal .kode/kode.json to get started:
kode daemon to start a silent background process that polls your git history for code health trends. After detecting 3+ new commits, it analyzes blast radius growth, circular dependencies, and repeated patterns. When thresholds are crossed, it speculatively fixes issues on a ghost branch and prompts you to merge.
MCP Integration — Kode exposes its full Plan → Verify → Apply pipeline as a Model Context Protocol server (kode mcp), so you can drive Kode’s verification engine from any MCP-compatible host, including Cursor and Claude Desktop. Add Kode to your claude_desktop_config.json:
Language Support
Kode’s verification pipeline has language-aware support for:- Go — Tree-sitter AST parsing, import resolution, call graph validation
- TypeScript and JavaScript — Tree-sitter AST parsing, import resolution
- Python — Tree-sitter AST parsing, import validation
- Rust — Tree-sitter AST parsing via query files
AI Provider Support
Kode is a Bring Your Own Key (BYOK) platform. Configure any of 25+ supported providers through theKODE_LLM_API_KEY environment variable or your .kode/kode.json config. First-party integrations include OpenAI, Anthropic, Google Gemini, and Groq, along with Amazon Bedrock, Azure OpenAI, Mistral, Cohere, DeepInfra, TogetherAI, OpenRouter, and a fully compatible custom OpenAI-compatible endpoint option.
Where to Go Next
Quickstart
Install Kode, run
kode init, and generate your first verified patch in under five minutes.Verification Pipeline
Deep dive into how the 6-gate pipeline works, how gates interact, and how to configure each one.
Ghost Branches
Learn how parallel speculative execution works and how Kode scores and merges winning branches.
CLI Overview
Full reference for all Kode commands:
run, loop, plan, verify, stats, daemon, and more.