Tools

Run Kimi Code Locally: MoonshotAI's Open-Source Coding Agent Compared to Claude Code

MoonshotAI released Kimi Code, an open-source AI coding agent with subagent support, MCP integration, and video input — all under MIT. Here is how to run it locally and what it means for the self-hosted coding agent landscape.

Robson PereiraMay 30, 202610 min read
Kimi Code AI coding agent running in a terminal window

Run Kimi Code Locally: MoonshotAI's Open-Source Coding Agent Compared to Claude Code

MoonshotAI, the company behind the popular Kimi chat assistant, has released **Kimi Code** as an open-source, MIT-licensed AI coding agent that runs entirely in your terminal. It landed on GitHub on May 27, 2026, and has already passed 1,380 stars — signalling the self-hosted AI community's hunger for capable, locally-run coding agents that do not lock you into a single vendor.

What Kimi Code is

Kimi Code is a terminal-based AI coding agent in the same category as Claude Code (Anthropic), OpenAI Codex (Desktop/CLI), and OpenClaw. It can read and edit code, run shell commands, search files, fetch web pages, and choose its next step based on tool output — all from a single-binary install.

What makes it distinctive:

  • **Single-binary distribution.** No Node.js, no Python runtime, no module conflicts. One install command and you are running.
  • **Millisecond startup.** The TUI is ready almost instantly, so starting a session never feels heavy.
  • **Built-in subagents.** Dispatch focused `coder`, `explore`, and `plan` subagents in isolated contexts while keeping the main conversation clean.
  • **Video input.** Drop a screen recording or demo clip into the chat and let the agent watch what is hard to describe in words.
  • **AI-native MCP configuration.** Add, edit, and authenticate Model Context Protocol servers conversationally with `/mcp-config`, no JSON editing required.
  • **Lifecycle hooks.** Run local commands at key points to gate risky tool calls, audit decisions, or trigger desktop notifications.

Why this matters for the self-hosted AI community

The coding agent space has been dominated by proprietary tools tied to specific model providers. Kimi Code breaks that pattern in two important ways:

1. **It is fully open source (MIT).** You can inspect, modify, and self-host the entire agent. No black boxes, no telemetry you cannot disable, no vendor lock-in beyond the code you choose to run.

2. **It works with multiple providers out of the box.** While it ships with Moonshot AI's own Kimi models, you can configure it to use OpenAI, Anthropic, or any OpenAI-compatible endpoint — including local models served through Ollama, vLLM, or LiteLLM.

For self-hosted AI practitioners, this means you can pair a local model runtime with a professional-grade coding agent UI, keeping every prompt, file edit, and shell command on your own hardware.

How to install and run it locally

Installation is one command on Linux and macOS:

```bash

curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash

```

On Windows (PowerShell):

```powershell

irm https://code.kimi.com/kimi-code/install.ps1 | iex

```

After installation, authenticate with `/login` inside the Kimi Code CLI — either via Kimi Code OAuth or a Moonshot AI Open Platform API key. Then start working:

```bash

cd your-project

kimi

```

Configuring a local model backend

To point Kimi Code at a local model instead of the default Kimi endpoint, set the `base_url` in your config to your local server. For example, if you run Ollama:

```json

{

"model": "llama3.1",

"provider": "openai",

"base_url": "http://127.0.0.1:11434/v1",

"api_key": "ollama"

}

```

This pairing — a local model runtime (see How to Run Llama 3 Locally with Ollama) with an open-source coding agent — is one of the most practical self-hosted AI setups available today.

How it compares to Claude Code and Codex

| Feature | Kimi Code | Claude Code | OpenAI Codex |

|---------|-----------|-------------|--------------|

| License | MIT (open source) | Proprietary | Proprietary |

| Model choice | Multiple providers | Claude only | GPT/Copilot only |

| Subagents | Built-in (coder, explore, plan) | Via delegation | Via plugin |

| Video input | Yes | No | No |

| MCP config | Conversational (/mcp-config) | Manual JSON | Manual JSON |

| Local model support | Via config | No native support | Via shim (codex-shim) |

| Single binary | Yes | No (Node.js) | No |

The most significant advantage for self-hosted users is the **MIT license and provider flexibility**. You are not locked into a model ecosystem, and you can audit exactly what the agent does.

Practical use cases for self-hosted setups

  • **Private code review.** Point Kimi Code at your repository, connect it to a local model via Ollama or vLLM, and get code reviews without sending your source code to a third party.
  • **Automated refactoring across multiple files.** Use the `explore` subagent to map the codebase while the `plan` subagent designs the changes, then the `coder` subagent executes them — all in one session.
  • **Video-based debugging.** Record a screen capture of a bug reproduction, drop it into the chat, and let the agent analyse the visual behaviour alongside the code. This is a genuinely novel capability no other coding agent offers.

What to watch out for

Kimi Code is **very new** (released May 27, 2026). The ecosystem of community skills, plugins, and documented workflows is still growing. The core agent loop is solid, but you should expect edge cases and rapid iteration in the early weeks.

For non-sensitive work, you may also want to use the default Kimi model, which is optimised for coding tasks. For privacy-sensitive projects, configure a local backend as described above.

Getting started with coding agents in your self-hosted stack

If you are new to AI coding agents, start with a simple task: ask Kimi Code to explain a project's directory structure or refactor one function. That gives you a feel for the agent loop without risking complex changes.

For the infrastructure side, read Docker Setup for Local AI Tools if you want to containerise the model backend, and Harden Docker Compose Stacks for Local AI Services before exposing the agent to a team.

Conclusion

Kimi Code is a significant addition to the open-source AI coding agent landscape. Its MIT license, multi-provider support, and novel features like video input make it an attractive option for self-hosted AI practitioners who want a capable coding agent without vendor lock-in. Pair it with a local model backend and you have one of the most private, capable coding setups available today.

FAQ

Can Kimi Code run fully offline?

Yes, if you configure it with a local model backend such as Ollama or vLLM. The agent itself runs locally; only model inference needs a local endpoint.

Does it work with existing project configurations?

Yes. Kimi Code reads your project files and works with any language or framework. No special project setup is needed.

Is the MIT license restrictive?

No. MIT is one of the most permissive open-source licenses. You can use, modify, and distribute the code freely.

Related articles