# ~/.kimi-code/config.toml — Kimi Code CLI user configuration (kit version). # # Validate with `kimi doctor config` before relying on it. Credentials are read # ONLY from this file (or a provider's [env] table) — a KIMI_API_KEY exported in # the shell is ignored. Your /login or API key block stays as the CLI wrote it; # the sections below are the additions that make the method on the lesson page # real. Merge, don't replace. default_model = "moonshot-ai/kimi-k2.7-code" # whatever alias /login or /provider created default_permission_mode = "manual" # manual · yolo · auto — pass -y per session instead default_plan_mode = false telemetry = false # ── Context: compact before the window is full, not when it is ─────────────── [loop_control] reserved_context_size = 40000 # auto-compact when this much window remains max_attempts_per_step = 10 [thinking] enabled = true # ── Subagent model pool (experimental) ─────────────────────────────────────── # Requires KIMI_CODE_EXPERIMENTAL_SECONDARY_MODEL=1 (or KIMI_CODE_EXPERIMENTAL_FLAG=1) # in the environment. Explore subagents and swarm workers land on the cheap # model by default; the main agent reads the hints to pick K3 when warranted. # Every alias here must exist under [models]; /login provisions the kimi-code/* # ones, or add your own. [secondary_model] default_model = "moonshot-ai/kimi-k2.6" [secondary_model.models] "moonshot-ai/kimi-k2.6" = "Fast and cheap — exploration, swarm workers, small edits, summaries." "moonshot-ai/kimi-k2.7-code" = "Balanced coding workhorse — most implementation subtasks." # ── Permission rules: the floor. Hold in manual, yolo, auto, -p and subagents. ─ [[permission.rules]] decision = "deny" pattern = "Bash(git push --force*)" reason = "never rewrite shared history" [[permission.rules]] decision = "deny" pattern = "Bash(git push -f*)" [[permission.rules]] decision = "deny" pattern = "Bash(git reset --hard*)" [[permission.rules]] decision = "deny" pattern = "Bash(rm -rf /*)" [[permission.rules]] decision = "deny" pattern = "Read(**/.env*)" reason = "secrets are not context" [[permission.rules]] decision = "deny" pattern = "Read(**/*.pem)" # Things you always want to run without a prompt — add your own test command. [[permission.rules]] decision = "allow" pattern = "Bash(npm test*)" [[permission.rules]] decision = "allow" pattern = "Bash(git status*)" [[permission.rules]] decision = "allow" pattern = "Bash(git diff*)" # ── Hooks: for things that SHOULD happen. They fail open — not a security barrier. # Stop: when the model wants to end the turn, run the suite. Exit 2 sends it back. [[hooks]] event = "Stop" command = "bash ~/.kimi-code/hooks/verify.sh" timeout = 300 # Notification: a desktop ping when a background task finishes (macOS: terminal-notifier). [[hooks]] event = "Notification" matcher = "task\\.completed" command = "command -v terminal-notifier >/dev/null && terminal-notifier -title Kimi -message 'Task done' || true" timeout = 5