Kimi Code is Moonshot AI's AI coding agent. It reads your project, edits code, runs commands and tests, and fixes what fails. This guide shows how to install it on macOS, Linux and Windows, which model to pick, which plan you need, and real examples to copy.
Kimi Code is an AI agent for software development. Describe a task in plain words and it plans the steps, reads and edits files, runs shell commands and tests, searches and fetches web pages, then adjusts based on what happens. It is open source on GitHub and also powers Kimi Work.
From the K3.1 Pro flagship to fast K2.7 Code HighSpeed.
Holds a whole codebase on Pro / Allegretto plans and above.
CLI, desktop app, VS Code, or inside other coding agents.
Included in Kimi plans from Moderato (Plus).
They all share one Kimi account and one plan allowance, so you can switch between them freely.
The terminal agent. Fastest to install, works on macOS, Linux and Windows, and runs in scripts with kimi -p.
Install below ↓A desktop app for macOS (Apple silicon and Intel) and Windows, with a model picker in the Composer. Sign in with your Kimi account.
Kimi downloads →Install Kimi Code from the VS Code Marketplace and sign in from the sidebar. Choose the model from the input bar.
Editor setup ↓Use your Kimi Code plan in Claude Code, OpenCode, Codex or Hermes Agent, and in Zed or JetBrains through ACP.
Setup guides ↓The official script needs no Node.js. It downloads the latest release, verifies the checksum and puts kimi on your PATH.
Windows needs Git for Windows first, because Kimi Code uses its Git Bash. For the best look, use a true-colour terminal such as Kitty or Ghostty.
Open a new terminal, go to your project folder and run kimi.
To uninstall, delete the kimi file (script install) or run npm uninstall -g @moonshot-ai/kimi-code. Kimi Code keeps its data in ~/.kimi-code/, which you can move with KIMI_CODE_HOME.
On first launch Kimi Code asks you to choose a source. Kimi Code (OAuth) uses your Kimi plan: open the link on any device, sign in and enter the code shown. Kimi Platform API key uses a pay-as-you-go key from platform.kimi.ai.
Kimi login guide →Start with: "Take a look at this project's directory structure and briefly describe what each directory is for." Kimi Code reads and searches files on its own before it answers.
Describe the change you want. It plans the steps, edits code, runs tests and reports what it did. It asks before it changes files or runs shell commands.
Type /model to switch, for example to k3.1-pro for hard problems. Start a new session after switching, because the old cache no longer applies.
kimi-for-coding (K2.8 Preview). Close to K3, lighter on quota, on every plan.k3.1-pro for tricky bugs, big refactors and huge codebases.k3.1-pro-highspeed or kimi-for-coding-highspeed, at a higher quota cost.k3-256k costs about half of k3 at 1M.K3, K3.1 Pro and K2.8 Preview support low / high / max thinking effort. K3.1 Pro always thinks, so turning thinking off returns an error.
Type /model to choose a model. Your plan decides which ones appear.
| Model ID | Model | Best for | Context | Speed and quota | Plan needed |
|---|---|---|---|---|---|
k3.1-pro | K3.1 Pro | Newest flagship. Best for hard bugs, big refactors and long codebases. | Up to 1M | Regular | Plus / Moderato and above |
k3.1-pro-highspeed | K3.1 Pro Highspeed | Same as K3.1 Pro, about 2–3× faster output. | Up to 1M | About 2× quota | Pro / Allegretto and above |
k3 | K3 | Previous flagship with 2.8T parameters. | Up to 1M | 1M uses about 2× the quota of k3-256k | Plus / Moderato and above |
k3-256k | K3 256K | K3 with a 256K context. Cheaper on quota. Images only, no video. | 256K | About half of k3 (1M) | Plus / Moderato and above |
kimi-for-coding | K2.8 Preview | Close to K3, thinks more efficiently. Great for everyday coding. | Up to 1M | Regular | All Kimi Code plans |
kimi-for-coding-highspeed | K2.7 Code HighSpeed | K2.7 Code at about 5–6× the output speed. Thinking always on. | 256K | About 3× quota | Pro / Allegretto and above |
Use the model ID exactly as shown. A mistyped ID silently falls back to K2.8 Preview without thinking. Source: Kimi Code model documentation. See also all Kimi models.
Kimi Code isn't sold on its own. It comes with paid Kimi plans, which recently gained new names (shown in brackets). Kimi Code usage draws on your plan's allowance and has a rolling 5-hour limit.
| Plan | Monthly | Kimi Code allowance | Models | Context | HighSpeed |
|---|---|---|---|---|---|
| Adagio (free) | $0 | Not included | — | — | — |
| Moderato (Plus) | $19 | 1× | k3.1-pro, k3, k3-256k, kimi-for-coding | 256K for K3 models | No |
| Allegretto (Pro) | $39 | 5× | All six models | Up to 1M | Yes |
| Allegro (Max) | $99 | 15× | All six models | Up to 1M | Yes |
| Vivace (Ultra) | $199 | 30× | All six models | Up to 1M | Yes |
Allowance is shown relative to Moderato. Prices are in US dollars, and yearly billing costs less. Full details: Kimi AI pricing.
| Command | What it does |
|---|---|
/login | Sign in with Kimi Code OAuth or a Kimi Platform API key |
/model | Switch model (start a new session afterwards) |
/new | Start a new session and clear the context |
/sessions | Browse and resume earlier sessions |
/compact | Compress the context to free up tokens |
/fork | Copy the session with its full history |
/mcp-config | Add and sign in to MCP servers by chatting |
/help | Show all commands and shortcuts |
/logout | Clear your saved credentials |
/exit | Quit Kimi Code |
| Key or command | What it does |
|---|---|
Shift-Tab | Turn Plan mode on or off |
Esc | Stop the current output or close a popup |
Ctrl-S | Send a message while Kimi Code is still answering |
Ctrl-O | Show or hide tool output |
Ctrl-C ×2 | Exit when idle |
kimi -p "…" | Run one task without the UI |
kimi -c | Resume the previous session |
kimi acp | Connect Zed, JetBrains or another ACP editor |
This is the example from Kimi's own getting-started guide. Here is the session, and the kind of code it writes.
Example output. The exact code depends on your project and model.
Exploring a project, adding a feature, fixing a failing test and turning a video into code.
Take a look at this project's directory structure and briefly describe what each directory is for. Then explain how a request flows from the entry point to the database.
Add a function in src/utils that converts any string to kebab-case, and add a unit test for it. Run the tests and tell me what you changed.
npm test is failing. Find the cause, fix the code rather than the test, run the full suite again and explain the bug in two sentences.
Plan first, don't edit yet: how would you split src/server.ts into smaller modules without changing behaviour? Wait for my approval before making changes.
Review my uncommitted changes like a senior engineer. List bugs, security issues and missing tests, ordered by severity, with file and line numbers.
Watch the attached screen recording and build this UI as a React component with Tailwind. Match the layout, spacing and hover states.
/compact or /new when a session gets long.Create a key in the Kimi Code Console, set these variables, then run claude. This is the 256K setup. On Pro / Allegretto and above, use k3.1-pro[1m] and set both context values to 1048576.
Run /status in Claude Code to check the base URL. Don't mix these variables with an env block in ~/.claude/settings.json.
Log in to the CLI once, then point your editor at kimi acp. For Zed, add this and open a new chat in the Agent panel:
These are the international endpoints. In third-party tools, set the context window to 1048576 to use the full 1M where your plan allows it.
Press Shift-Tab for Plan mode. Kimi Code reads and proposes a plan without editing anything until you agree.
Switching model or thinking effort clears the context cache. Start fresh with /new to avoid paying for the same tokens twice.
k3 at 1M uses about twice the quota of k3-256k. Compact first if you move a long session down to 256K.
It only speeds up the model's replies. If most of the time goes on tests and builds, you'll see little difference.
K3.1 Pro rejects requests with thinking off. For K3 and K2.8 Preview, turning it off sends you to a non-thinking K2.8 Preview.
Use /mcp-config to connect tools by chatting, and lifecycle hooks to block risky commands or send notifications.
More help: Kimi troubleshooting.