kode run is the fastest path from a plain-English task to working, verified code on disk. It sends your prompt to the configured LLM, parses the response into structured JSON hunks, runs every hunk through the 9-gate verification pipeline, and writes passing patches directly to your files — all in a single command. Think of it as kode generate --apply with a shorter name.
Synopsis
What it does
- Sends your prompt (plus any context file you provide) to the LLM.
- Parses the response into structured hunks — each hunk is a targeted
old → newreplacement scoped to a single file. - Runs each hunk through the verification pipeline (syntax, imports, call graph, blast radius, architecture, security).
- Applies hunks that pass all gates to disk. Hunks that fail are logged with the reason.
- Prints a JSON summary to stdout with the list of applied and failed hunks, round count, and duration.
kode run does not execute your test suite. Patches are verified structurally but tests are not run. For full test execution and automatic rollback on failure, use kode loop.Flags
string
Override the LLM model for this run. Accepts
provider/model format. When omitted, Kode uses the model field from .kode/kode.json, falling back to the KODE_LLM_MODEL environment variable, and finally gpt-4o.string
Path to a context packet JSON file produced by
kode plan --packet. Providing a context file gives the LLM a surgical, token-capped view of the relevant files and symbols instead of an unfiltered codebase dump.string
default:"cwd"
Project root directory. Kode resolves all file paths relative to this directory. Defaults to the current working directory.
Examples
For complex, multi-file tasks, run
kode plan --packet "your task" > context.json first. This gives Kode a surgical context graph scoped to the task rather than sending the entire codebase to the LLM, which reduces token cost and improves patch quality.Output
On success,kode run prints a JSON summary to stdout:
1 and the summary lists each failure with the gate name and reason.
Environment variables
Relationship to other commands
kode run is a direct alias for kode generate --apply. The two commands are identical in behaviour. Use whichever feels more natural in your workflow.