How Kimi Code works: the whole machine on one page

By Christophe Paka · Facts checked on 7 November 2026

You ask Kimi Code to fix a bug. It reads files, runs a command, edits something and asks you a question. Then a message says you hit a limit. Which part did what, and why did it stop?

To understand how Kimi Code works, you need the parts and how they connect, not the feature list. The map below shows one session, a model menu, a set of guards and the meters that pay for it all. Read it from the center out.

Map of Kimi Code: a central session with a context window, a model menu on the left, guards and then your repo and tools on the right, subagents above, and quota meters with an Extra Usage wallet below.
Figure 2.1: The map of the machine. Every request goes through one session, one model and the checks that ask you first, and every request spends from the same pool.
Use this diagram on your site

Free to share in your blog post, docs, course or slides, as long as the credit link stays. Paste the code below where the figure should go.

How to read this figure

  1. Start at the session. The center is one conversation with one context window: everything the model can see at once, measured in tokens (small pieces of text). It fills as you work and holds every prompt, file read and command result. It is the same session in the CLI, the desktop app and VS Code.

  2. Look left to the engine bay. This is the model menu. k3 is K3 with up to 1M of context. k3-256k is the same K3 for half the quota. kimi-for-coding is K2.8 Preview, with 1M. HighSpeed is 6x faster for 3x the quota. The figure draws four of the six IDs; k3.1-pro and its fast twin complete the menu. The /model command switches.

  3. Pass the guards on the right. Every action passes the guards first: the approval panel, your permission rules and hooks. By default the agent asks before it edits a file or runs a command.

  4. Reach your repo and tools. Behind the guards are the things the loop acts on: read code, edit files, run commands and outside tools. A repo is a project folder tracked by git, a tool that saves versions of your code.

  5. Follow the dashed line back. Results return to the context along the dashed line at the bottom of the session. That line is the agentic loop: read, decide, act, look at the result, repeat.

  6. Check the gauges and the satellites. The gauges at the bottom are your quota meters. One pool serves every device, key and surface. If two gauges disagree, plan by the higher one, and trust the meter a 403 message names. Above the session, subagents are extra agents that each work in a fresh context and send back only their answer, not every file they read. Agent Swarm runs up to 128 in parallel. The quota meters figure breaks the gauges down.

Key takeaways

  • Before a big task, check which model your ID means and how much context it gives you.
  • Start on kimi-for-coding. Move to k3.1-pro or k3, both on the full menu, only when the default keeps failing.
  • Read the meters with /usage and in the Console. When they disagree, plan by the higher reading.

Worked example: one request through the map

Follow a single request, "add a currency option" to a small bill splitting tool called tipcalc.

  1. You type the ask in the session. It joins the context window.
  2. The model on the engine bay reads the context and decides to open a file.
  3. The read goes through the guards. A read is allowed.
  4. The model proposes an edit. The guards ask you first, and you review the diff.
  5. The result returns to the session through the loop, and the model reads it before the next step.
  6. Each step draws from the meters at the bottom.

Result: You can name which zone to look at when something goes wrong: the model for quality, the guards for an unexpected question, the meters for a stop.

Questions readers ask

What is the agentic loop in Kimi Code?

It is the cycle the program around the model runs: read, decide, act, look at the result, repeat. Results from every action return to the session, so the next step builds on them. You approve the risky actions along the way.

Which Kimi model should I use by default?

Start on kimi-for-coding, the everyday default. Move to k3.1-pro or k3, two other IDs on the model menu, only when the default keeps failing on a task. Switch with the /model command. Leave thinking on unless you mean to change models.

Does Kimi Code ask me before it changes files?

By default, yes. Every action passes the guards, and the agent asks before it edits a file or runs a command. You can loosen or tighten those questions with permission modes, and add lasting rules or hooks.

Sources: Model Configuration (Kimi Code docs); Membership Benefits (Kimi Code docs); FAQ (Kimi Code docs).

This figure is from Kimi Code Made Crystal Clear, chapter 2.

The chapter builds the idea step by step, with recipes you can follow, a Try it to check yourself, and every source.

Get the book

All diagrams