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 9-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 9 Verification Gates
The gate pipeline runs sequentially. A failure at any gate is a hard stop — the remaining gates do not run.Gate 1 — AST Syntax
Gate 1 — AST Syntax
Dual-engine AST parsing architecture. Uses official Tree-sitter bindings (precision parser) when CGo is enabled, gracefully falling back to fast zero-dependency regex heuristics on strict local environments. Parses Go, TypeScript, JavaScript, Python, and Rust. A parse error hard-blocks the filesystem write — the patch never proceeds further.
Gate 2 — Imports
Gate 2 — Imports
Cross-references every generated import path against the local repository dependency graph. Rejects and self-corrects imports targeting non-existent or 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
Validates that all function and method call sites reference real, existing symbols with compatible signatures. Kode walks the context graph built during planning and cross-references every call site. Prevents the primary source of LLM function hallucination.
Gate 4 — Blast Radius
Gate 4 — Blast Radius
Computes code churn metrics by walking the dependency graph backward from every modified file. If the downstream impacted file 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 modular and microservice boundary rules you declare in
architecture_rules. Prevents illegal cross-package imports — e.g., database layers importing route handlers, or crossing microservice code lines. You can configure this gate to hard-block on violations or to warn and record them for later review.Gate 6 — Security (SAST)
Gate 6 — Security (SAST)
Powered by Sicario, Kode’s integrated AST-based SAST scanner engine. Audits structural syntax paths for high/critical vulnerabilities — including SQL injection, XSS vectors, and hardcoded credentials — before they are written to 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.Gate 7 — Sandbox Replay (NEW)
Gate 7 — Sandbox Replay (NEW)
CPU- and memory-bounded dynamic code execution simulator. Runs patches in an isolated local container/sandbox to trap and terminate infinite loops, memory leaks, and unauthorized system or network socket activity before the change reaches your real filesystem.
Gate 8 — QR Code Tunnel (NEW)
Gate 8 — QR Code Tunnel (NEW)
Instantly provisions a secure public dev tunnel for previewing local web servers. Renders the tunnel URL as a high-contrast, terminal-scannable QR code to facilitate instant layout and responsiveness testing on actual mobile devices.
Gate 9 — Browser Verification / E2E (NEW)
Gate 9 — Browser Verification / E2E (NEW)
Synthesizes and executes headless Playwright E2E verification scripts against the running local dev server. Automatically captures walkthrough recordings and checks for visual UI regression, page layout failures, and console errors — rolling back the filesystem changes on failure.
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/config.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.
Voice Mode — Run kode voice to start the Kode Command Voice bridge: microphone capture inside the shell, Whisper-based speech-to-text (cloud or local), and automatic routing of the transcribed task into the full Plan → Critique → Generate → Verify → Apply → Test loop. Hands-free pair programming with the same verification guarantees as every other entry point.
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 9-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.