The hackable coding agent.
Run many coding agents together. Modify anything - system prompt, tools, agent loop
14-day free trial, no card. Then $15 a month or $150 a year. Works with your API keys or LLM subscription.
Built for power users.
kcode keeps your rules, tools and ways of working in files you can read and change. Set it up once, then use the same setup across projects and sessions.
Many agents, one window.
kcode shows every session as a live tile and sends a notification when an agent fails or waits for input.
Find the code that matters.
Search by meaning, trace callers, and surface diagnostics after edits. The agent can inspect more than the files it has already opened.
A shell you can hook into.
Plugins can stop or change any command before it runs and change what the agent reads after. Long builds keep running in the background and wake the agent when they finish.
Batteries included.
A test runner, web search, a browser with a separate profile, and task lists for long jobs. All built to work together, with no MCP servers to set up.
Changing kcode is easy.
Answer in simple English. Keep it brief. No filler. When you are unsure, say what you checked and what you did not. Prefer a command or a file path over a paragraph.This file sets how every new session answers. Without it, kcode goes back to its default.
# Runs once Project hooks is on in Settings # (hooks_enabled = true in ~/.kcode/config.toml). [[hooks]] name = "retest" on = "fs:file-changed" filter = "src/**/*.rs" prompt = "A source file changed. Run its tests." concurrency = "replace" # replaces a turn that still waitskcode starts a turn that runs the tests whenever a matching file is saved, after any running turn finishes. Hooks run only in trusted projects, with Project hooks on in Settings.
# Runs once Project hooks is on in Settings # (hooks_enabled = true in ~/.kcode/config.toml). [[hooks]] name = "nightly-review" on = "timer:cron" schedule = "0 0 2 * * *" # seconds first: 02:00 each night prompt = "Review yesterday's commits. List the risky ones." session = "new" # a session of its ownThe same hook on a timer. At 02:00, if it is open, kcode starts a session for the review, and the result is ready in the morning. Like every hook, it needs Project hooks on in Settings.
-- Read tickets from our tracker. local base = "https://tickets.example.com/api/" local function read(args) local res = kcode.fetch(base .. args.id) if res.status ~= 200 then return { error = res.body } end return { ticket = res.body } end kcode.register_tool("ticket", "Read a ticket by id", read, { schema = { type = "object", required = { "id" }, properties = { id = { type = "string" } } } })A Lua plugin, this file and a short manifest, adds a tool beside the built-in ones. It reaches the web only where its manifest allows, and kcode reloads it on every save.
-- Run commands in the container. local schema = { type = "object", properties = { command = { type = "string" } } } local function run(args) local q = "'" .. args.command:gsub("'", "'\\''") .. "'" args.command = "docker exec dev sh -lc " .. q return kcode.run_tool("builtin:bash", args) end kcode.register_tool("bash", "Run a shell command", run, { schema = schema })This replaces only the built-in bash tool; other shell tools still run on your Mac. Change dev to your container’s name in main.lua. kcode asks for approval on install, and removing the plugin restores bash.
( extends: "kcode", colors: ( background: (dark: "#0b0806", light: "#fff8ef"), ), type_scale: (mono: (size: 13.0)), )A theme starts from a bundled one and changes only what it names, here the background and the type size. /theme ember switches to it.
Watch or change a step with a plugin.
Choose a point to see its file. kcode still runs the loop; plugins can act only at the named core.* points.
You type
Expand my shorthand.
Before a turn starts, a plugin can change or block the message.
-- Expand my shorthand. kcode.on_input(function(input) if input.text == "#fix" then return { text = "Run the tests. Fix every failure." } end end)~/.kcode/plugins/fix-shorthand/main.lua
Rewrite one section of the system prompt.
While the prompt is built, a plugin can swap, add or drop a named section.
-- Rewrite one section of the system prompt. kcode.intercept("core.prompt.build", function(prompt) prompt.sections.style = "Plain short sentences." return { rewrite = prompt } end)~/.kcode/plugins/plain-style/main.lua
Then, every round
Hide old tool output from the model.
Before every request, a plugin can edit, insert or drop messages.
-- Hide old tool output from the model. kcode.intercept("core.context.build", function(ctx) for i, m in ipairs(ctx.messages) do local old = i < #ctx.messages - 20 if old and m.role == "tool" then m.content = "[cut]" end end return { rewrite = ctx } end)~/.kcode/plugins/short-memory/main.lua
Lower oversized reply limits.
Before each call to the model, a plugin can change its settings or stop it.
-- Lower reply limits over 8,000 tokens when one is present. kcode.intercept("core.provider.request", function(req) if req.max_tokens and req.max_tokens > 8000 then req.max_tokens = 8000 return { rewrite = req } end end)~/.kcode/plugins/reply-cap/main.lua
Log each reply’s output-token count.
Watch only: a plugin sees each reply and cannot change it.
-- Log each reply's output-token count kcode.on("core.provider.response", function(ev) local d = ev.data kcode.log(d.model .. ": " .. d.output_tokens .. " tokens") end)~/.kcode/plugins/reply-log/main.lua
Cap grep at 20 matches a file.
Before a tool runs, a plugin can block it, change its input or swap the tool.
-- Cap grep at 20 matches a file. kcode.intercept("core.tool.pre", function(call) if call.tool ~= "grep" then return end local args = call.args args.max_count = math.min(args.max_count or 20, 20) return { rewrite = { args = args } } end)~/.kcode/plugins/short-grep/main.lua
Send every subagent to a cheaper model.
Before a subagent starts, a plugin can stop it or change its prompt or model.
-- Send every subagent to a cheaper model. -- Needs an Anthropic key, or every spawn fails. kcode.intercept("core.subagent.pre", function(spawn) spawn.model = "claude-haiku-4-5" return { rewrite = spawn } end)~/.kcode/plugins/thrifty/main.lua
Trim a huge log before the model reads it.
After a tool returns, a plugin can change what the model reads.
-- Trim a huge log before the model reads it. kcode.intercept("core.tool.post", function(result) if #result.content > 20000 then result.content = result.content:sub(-20000) return { rewrite = result } end end)~/.kcode/plugins/log-tail/main.lua
Stop after 40 rounds.
After every round, plugins vote to go on or to stop.
-- Stop after 40 rounds. kcode.intercept("core.continuation.decide", function(state) if state.round > 40 then return { veto = "40 rounds is enough for one turn." } end end)~/.kcode/plugins/round-cap/main.lua
Tell the summary what it must keep.
When context fills up, a plugin can delay compaction or write its own summary.
-- Tell the summary what it must keep. kcode.provide("core.compaction.summarize", function(job) return { instructions = "Keep file paths and test names" } end)~/.kcode/plugins/keep-paths/main.lua
Round again, until the model has nothing left to do.
Done
- watch see it happen
- gate stop it
- rewrite change it on the way through
- replace swap in your own
- vote say whether the loop goes on
One plan. One Mac.
- Where does my code run?
- On your Mac. Prompts and files go to the provider you chose; kcode.sh never sees them. The privacy page lists what leaves the machine, including the downloads kcode can make at launch and how to turn each off.
- Does it run Claude Code or Codex?
- No. kcode is its own agent and talks to the providers directly, with your API keys or supported LLM subscription plans, so there is nothing else to install.
- What happens when the trial ends?
- Nothing is charged and nothing is deleted. Your config, plugins, and transcripts are files on your Mac and stay there. Buy from your account page to keep using kcode.
- Why pay when other agent apps are free?
- You pay for a maintained macOS app: parallel sessions, worktrees, code intelligence, and a plugin system that extends the agent loop. kcode charges for the app, not for model usage.
- Who answers support?
- An engineer who works on kcode reads and answers every mail. Write to support@kcode.sh.
Try kcode free for 14 days.
kcode 0.6.5371 for Apple silicon, macOS 14.0 or later.
Download for macOS Join waitlist for Windows Join waitlist for Linux