Skip to main content
9 – 17 UHR +49 8031 3508270 LUITPOLDSTR. 9, 83022 ROSENHEIM
DE / EN
Coding agent Moonshot AI Terminal, web UI, IDE (ACP)

Kimi Code

Kimi Code is Moonshot AI's open-source coding agent for terminal, web UI and IDE. Features, models, custom endpoints and enterprise use explained.

Licence MIT
First release May 2026 (predecessor Kimi CLI: October 2025)
Interfaces Terminal (CLI/TUI), Zed and JetBrains via ACP, Web UI (kimi web), Headless mode
Platforms macOS, Linux, Windows
Instruction file AGENTS.md

The seven building blocks in Kimi Code

How Kimi Code implements the building blocks of an AI harness

  1. 1

    Agent loop

    Kimi Code CLI plans steps, edits code, runs commands and adjusts its approach based on the feedback it receives. In plan mode, the agent first presents a plan for approval before changing any files.

  2. 2

    Tools and execution environment

    Built-in tools read and edit files, run shell commands, search the project and fetch web pages. Further tools are added via MCP servers configured in the mcp.json file.

  3. 3

    Context management

    Project instructions from AGENTS.md, file references and tool results make up the context; /compact condenses the history. In shell mode, the output of your own commands also lands in the context.

  4. 4

    State and memory

    Sessions are stored under ~/.kimi-code/sessions/ and can be resumed with kimi --continue or /resume. Persistent instructions live in AGENTS.md at the user and project level.

  5. 5

    Permissions

    Three approval modes govern autonomy: Always Ask by default, Ask When Needed via /yolo, and Never Ask via /auto. Lifecycle hooks can additionally block tool calls via exit code.

  6. 6

    Verification and feedback

    The agent runs tests and builds via the shell and evaluates the results. /undo removes prompts from the context but, according to the documentation, does not revert code changes.

  7. 7

    Orchestration

    The built-in coder, explore and plan subagents work in isolated contexts, including in parallel in the background. Custom subagents are defined as Markdown files with YAML front matter.

Models and model access

Which models the harness uses and how they are obtained

Models and model access
Models Kimi models from Moonshot AI via the managed Kimi Code service
Access routes Kimi Code (OAuth), Moonshot AI Open Platform, Anthropic, OpenAI and OpenAI-compatible services, Google GenAI, Google Vertex AI
Free choice of model Yes
Custom endpoint / LLM gateway Yes
Providers are defined in config.toml under [providers.<name>] with type and base_url; alternatively, the environment variables KIMI_MODEL_NAME, KIMI_MODEL_API_KEY and KIMI_MODEL_BASE_URL create a temporary provider.
Features
MCP servers Sub-agents Hooks Skills Plugins / extensions Headless / CI SDK IDE integration Resume sessions
Running it with herdr
Supported by herdr Yes
State detection Lifecycle hooks when installed, otherwise screen manifest
Integration State and session
herdr lists the agent as "Kimi Code CLI" and reads its state via installed lifecycle hooks, falling back to a screen manifest.
More about herdr →

Enterprise use

Data processing, controls and pricing model according to the vendor

Data flow and providers

With the managed Kimi Code service, prompts and source code go to Moonshot AI's platform, a company headquartered in China. The CLI documentation contains no statements on EU data residency or fixed retention periods; the vendor's own privacy terms apply.

Custom endpoints

Via config.toml, organisations can connect their own providers with a freely chosen base_url instead of the Kimi service, including Anthropic, OpenAI-compatible services and Vertex AI. This lets a company decide for itself which model provider processes its data.

Telemetry

According to the documentation, Kimi Code CLI sends anonymous telemetry. It can be disabled via the KIMI_DISABLE_TELEMETRY environment variable or the telemetry setting in the configuration.

Identity and admin controls

Documented sign-in options are Kimi Code OAuth or an API key from the Moonshot AI Open Platform, or credentials for a self-configured provider. The CLI documentation does not describe a central policy management console or SSO integration for organisations.

Pricing model

Access runs through a Kimi subscription with OAuth login, or usage-based via an API key from the Moonshot AI Open Platform or another provider – see the vendor for current terms.

Strengths
  • Open source under the MIT licence with a public repository and changelog
  • Freely configurable providers and base URLs for Kimi, Claude, OpenAI-compatible services and Vertex AI
  • Editor integration via the open Agent Client Protocol (Zed, JetBrains)
  • Extensible via MCP, skills, plugins, lifecycle hooks and custom subagents
  • Non-interactive operation with kimi -p and structured stream-json output
  • Ships as a single binary with no Node.js requirement
Limitations
  • Execution sandboxing is not described in the CLI documentation; the security model relies on approvals
  • According to the documentation, /undo only reverts prompts, not code changes
  • Hooks are documented as fail-open by design and are not meant to be the only safety barrier
  • On Windows, Git for Windows is required because Git Bash serves as the shell environment

Use cases

Typical tasks for this harness

Exploring and explaining unfamiliar codebases
Implementing features with plan mode and approval
Debugging, testing and refactoring against a checkable goal in goal mode
Agentic work inside Zed or JetBrains IDEs via ACP
Non-interactive runs in scripts and CI with kimi -p

Kimi Code is Moonshot AI’s open-source coding agent: the Kimi Code CLI reads and edits code, runs shell commands and plans its own steps – an AI harness for developers in the terminal, in a local web UI, and in editors that support the Agent Client Protocol. The project is licensed under MIT and works with Kimi models as well as with other providers. As of 20 September 2026.

What is Kimi Code?

Kimi Code comes from Moonshot AI, the company behind the Kimi models. The official MoonshotAI/kimi-code repository was created in May 2026, with first releases shipping that same month according to the changelog. It replaces the earlier, Python-based Kimi CLI (MoonshotAI/kimi-cli, since October 2025, Apache-2.0): per that project’s README, Kimi CLI is evolving into Kimi Code CLI, migrating configuration and sessions automatically on install. Kimi Code CLI itself is licensed under MIT.

The CLI ships as a single binary, installed via curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash (macOS, Linux) or a PowerShell script on Windows; no Node.js is required. On Windows, the CLI needs Git for Windows because Git Bash serves as its shell. It starts with kimi, and /login offers Kimi Code OAuth or an API key from the Moonshot AI Open Platform. kimi web launches a local web UI, and kimi acp connects the CLI to Zed, JetBrains IDEs and other ACP-capable editors.

Kimi Code as an AI harness

At its core is an agentic loop with tiered autonomy. In the default “Always Ask” mode, only read operations run automatically; every file change and command needs individual confirmation. /yolo switches to “Ask When Needed”, and /auto to the unattended “Never Ask” mode. Shift-Tab switches the CLI into plan mode, where the agent first presents a plan for approval. A shell mode with a ! prompt runs your own commands and feeds their output into the context.

Kimi Code reads project instructions from AGENTS.md — in the project, under .kimi-code/AGENTS.md, or globally under ~/.kimi-code/AGENTS.md. MCP servers are configured in ~/.kimi-code/mcp.json or, per project, in .kimi-code/mcp.json. For subtasks, the built-in coder, explore and plan subagents run in isolated contexts; custom agents are defined as Markdown files. Skills (SKILL.md), a plugin marketplace, and lifecycle hooks in the [[hooks]] section of config.toml extend the harness, documented as deliberately fail-open rather than a sole safety barrier. For automation, kimi -p runs non-interactively, optionally with --output-format stream-json; a separate Kimi Agent SDK exposes the same runtime for Go, Node.js and Python.

Models and model access

By default, Kimi Code uses Kimi models from Moonshot AI, accessed via the managed Kimi Code service or the Moonshot AI Open Platform. The documentation also lists the provider types anthropic, openai, openai_responses, google-genai and vertexai, each described in config.toml under [providers.<name>] with a type and base_url; openai is explicitly meant for OpenAI-compatible third-party providers and gateways. Without touching the configuration, KIMI_MODEL_NAME, KIMI_MODEL_API_KEY and KIMI_MODEL_BASE_URL create a temporary provider.

This makes it possible to run Kimi Code through innFactory’s AI Gateway: register the OpenAI-compatible proxy as an openai-type provider with its own base_url, and gain budgets, per-team and per-agent cost centres, Microsoft Entra ID authentication, and logging. According to the documentation, KIMI_CODE_CUSTOM_HEADERS can attach additional HTTP headers to every request, for example when a gateway routes by header.

Enterprise use: data protection and governance

The chosen model access is decisive. With the managed Kimi service, prompts and source code go to Moonshot AI’s platform, headquartered in China; the CLI documentation makes no statements on EU data residency, fixed retention periods, or central admin controls, so the vendor’s privacy terms apply. Organisations that want to avoid this can configure a different provider or their own gateway instead.

Anonymous telemetry can be disabled with KIMI_DISABLE_TELEMETRY=1; standard proxy environment variables cover all outbound traffic. The documentation does not describe an execution sandbox, so the security model relies on approvals. In every case, source code and prompts go to the chosen model provider, and this data flow should be mapped in advance in an organisation’s records of processing activities.

Orchestrating Kimi Code with herdr

The terminal orchestrator herdr lists Kimi Code CLI among its supported agents, reading state from lifecycle hooks when installed and otherwise from a screen manifest; the integration covers state and session, so several Kimi Code sessions can be monitored alongside other coding agents from one terminal.

Where it fits: developer harness and enterprise harness

Kimi Code is a harness for developers: one repository, one terminal or editor, one person approving changes. For everyone else in the organisation, CompanyGPT is the matching harness — tools via MCP servers, integrations and n8n, context via companyRAG, roles from Entra ID or Keycloak, and audit logs, run in a customer’s own Azure environment or, sovereignly, on STACKIT. The AI Gateway forms the shared cost and governance layer for both. See our overview of all AI harnesses for other coding agents and orchestrators. We help organisations adopt Kimi Code and comparable harnesses with the right model access, clear approval rules, and centralised cost control.

From developer harness to enterprise harness

Coding harnesses are tools for developers. Business users, cost control and governance need two more layers.

CompanyGPT – the harness for business users

CompanyGPT gives any language model tools via MCP servers, integrations and n8n, company knowledge via companyRAG, roles from Entra ID or Keycloak, and audit logs – operated in your Azure environment or sovereignly on STACKIT.

Discover CompanyGPT
AI Gateway – cost and governance for every agent

The AI Gateway bundles the model access of your tools and coding agents behind an OpenAI-compatible API: authentication via Entra ID, budgets and cost centres per team, user and agent, guardrails and complete logging.

View the AI Gateway

Frequently Asked Questions

What is Kimi Code?

Kimi Code is Moonshot AI's coding agent. Its Kimi Code CLI runs in the terminal, reads and edits code, runs shell commands, searches files and fetches web pages. There is also a local web UI via kimi web and editor integration through the Agent Client Protocol.

Is Kimi Code open source?

Yes. The MoonshotAI/kimi-code repository is licensed under MIT according to GitHub. Its predecessor, Kimi CLI, in the MoonshotAI/kimi-cli repository, is licensed under Apache-2.0 and is being wound down in favour of Kimi Code according to its README.

Which models does Kimi Code support?

By default it uses Kimi models from Moonshot AI via the managed Kimi Code service or an API key from the Moonshot AI Open Platform. According to the provider documentation, Anthropic, OpenAI and OpenAI-compatible services, Google GenAI and Vertex AI can also be connected in config.toml.

Can Kimi Code run with a custom endpoint or LLM gateway?

Yes. Every provider in config.toml has a base_url field, and the openai type is explicitly intended for OpenAI-compatible third-party providers and gateways. For quick tests, the KIMI_MODEL_NAME, KIMI_MODEL_API_KEY and KIMI_MODEL_BASE_URL environment variables are enough.

Can Kimi Code be used in a GDPR-compliant way?

It depends on the chosen model access. With the managed Kimi service, prompts and source code go to Moonshot AI in China; the CLI documentation does not describe EU data residency. Organisations can instead configure their own provider or gateway and should map this data flow in advance in their records of processing activities.

Does Kimi Code work with herdr?

Yes. herdr lists the Kimi Code CLI among its supported agents. State is read via lifecycle hooks when installed, otherwise via a screen manifest; the integration covers state and session.

Introduce coding agents safely in your company

We support selection, model access in the EU, permission design and cost control.