kimi_code
Analyze and edit code files in a repository using CLI-based AI. Supports session management, background tasks, and configurable output for agentic workflows.
Instructions
Agentic work in a repository: analyze and edit files. Defaults to in-process CLI transport.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edit | No | Allow file modifications. Default: false (analysis-only intent). On Kimi 0.20.1 this is prompt-enforced (advisory): when false/omitted the prompt is prefixed with a read-only guard, but the CLI itself provides no hard read-only flag for -p mode. | |
| prompt | Yes | The analysis or coding prompt for Kimi. | |
| work_dir | Yes | Absolute path to the codebase root directory. | |
| transport | No | How the server drives Kimi. Both edit files and resume sessions; they differ in robustness and live-progress detail. 'cli' (default): one-shot process, most robust on Windows, but live progress is coarse — only streaming-output volume, no per-action lines. 'acp': persistent JSON-RPC session that emits granular live progress (tool calls, plan steps) and supports interactive permission prompts, but is heavier and more fragile. Prefer 'cli' for plain codegen/analysis; choose 'acp' when you need to watch each action live or handle mid-run prompts. | |
| background | No | Track as a long-running background task. Every progress event (including each action) is appended to the task log, readable via kimi_tasks — the full accumulating transcript, unlike the single overwriting live-progress line of a foreground call. | |
| session_id | No | Explicit Kimi session id to resume. | |
| timeout_ms | No | ||
| new_session | No | Start fresh instead of continuing the last session. Default: false. | |
| detail_level | No | ||
| session_mode | No | ACP session mode when transport='acp'. Default: inferred from session_id/new_session. | |
| include_thinking | No | ||
| max_output_tokens | No |