Settings
Settings
~/.kimi-code/config.toml
Vendor docs
config
| name | type | required | meaning | concept | |
|---|---|---|---|---|---|
| background | string |
Background task runtime parameters → `background`
|
docs ↗ | ||
| background.bash_auto_background_on_timeout | string |
When a foreground `Bash` command hits its timeout, move it to a background task instead of killing it — the agent is notified when it completes, and the backgrounded command is bounded by the `bash_task_timeout_s` default background timeout. Set to `false` to kill timed-out foreground commands instead
|
docs ↗ | ||
| background.bash_task_timeout_s | string |
Default timeout (seconds) for background `Bash` tasks when the call omits `timeout`; also used to re-arm foreground commands moved to the background on timeout. `0` means no timeout — the task runs until it exits or the model stops it. Explicit per-call `timeout` values are unaffected. In print mode (`kimi -p`) the default is `0` unless explicitly set
|
docs ↗ | ||
| background.keep_alive_on_exit | string |
Whether to keep still-running background tasks when the session closes. By default, Kimi Code requests that all background tasks stop before the process exits; set this to `true` only when you want tasks to outlive the session. In print mode (`kimi -p`), this is only a legacy fallback used when `print_background_mode` is unset: `true` is equivalent to `print_background_mode = "drain"`
|
docs ↗ | ||
| background.kill_grace_period_ms | string |
Grace period in milliseconds after session close, a manual stop, or a task timeout requests graceful termination. If a task is still running after this period, Kimi Code attempts to force-stop it
|
docs ↗ | ||
| background.max_running_tasks | string |
Maximum number of background tasks running concurrently
|
docs ↗ | ||
| background.print_background_mode | string |
Print mode (`kimi -p`) only. Governs how pending background tasks are handled once the main agent's turn ends: `"exit"` exits immediately; `"drain"` waits for every background task to reach a terminal state before exiting (results are not fed back to the main agent); `"steer"` stays alive so a completing background task — like a background subagent — injects a synthetic user message that steers the main agent into a new turn, looping until a turn ends with no pending background tasks or a limit is hit. Takes precedence over the `keep_alive_on_exit` print fallback
|
docs ↗ | ||
| background.print_max_turns | string |
In print mode (`kimi -p`) with `print_background_mode = "steer"`, the maximum number of new turns that may be triggered by background-task completions, to keep the steering loop bounded (the default is effectively unbounded)
|
docs ↗ | ||
| background.print_wait_ceiling_s | string |
In print mode (`kimi -p`), the wall-clock ceiling (seconds) for the wait/steer loop when `print_background_mode` is `"drain"` or `"steer"` (the default is ~24.8 days — effectively unbounded). Has no effect outside print mode or when it is `"exit"`
|
docs ↗ | ||
| builtin_product_skills | string |
Whether the built-in skills that document Kimi Code itself are offered to the model: `update-config`, `custom-theme`, `mcp-config`, `check-kimi-code-docs`, and `import-from-cc-codex`. Turning them off trims their names and descriptions from the system prompt, at the cost of the guided flows for those tasks. Read by the default `agent-core-v2` engine; ignored when `KIMI_CODE_LEGACY_FLAG=1` selects the legacy engine
|
docs ↗ | ||
| default_model | string |
Default model alias; must be defined in `models`
|
docs ↗ | ||
| default_permission_mode | string |
Default permission mode for new sessions; one of `manual` (prompt each time), `yolo` (auto-approve tool actions, but the agent may still ask questions), or `auto` (fully autonomous — the agent decides everything without asking)
|
docs ↗ | ||
| default_plan_mode | string |
Whether new sessions start in Plan mode (produce a plan before executing) by default
|
docs ↗ | ||
| extra_agent_dirs | string |
Extra custom agent search directories, layered on top of the default directories
|
docs ↗ | ||
| extra_skill_dirs | string |
Extra skill search directories, layered on top of the default directories
|
docs ↗ | ||
| hooks | string |
Lifecycle hooks; see Hooks
|
docs ↗ | ||
| identity | string |
Custom agent identity → `identity`
|
docs ↗ | ||
| identity.name | string |
Display name the agent calls itself in the system prompt (fills the `${product_name}` slot, including in your own `SYSTEM.md` and agent files)
|
docs ↗ | ||
| identity.slug | string |
Machine identifier used in protocol fields: the `User-Agent` product token sent to third-party providers, and the client name announced to MCP servers. Derived from `name` when omitted: lowercased, with every run of non-alphanumeric characters folded to `-`
|
docs ↗ | ||
| image | string |
Image compression parameters → `image`
|
docs ↗ | ||
| image.max_edge_px | string |
Longest-edge ceiling in pixels. Larger images are scaled down proportionally to fit; raising it preserves more detail at the cost of larger request bodies
|
docs ↗ | ||
| image.read_byte_budget | string |
Per-image byte budget for images the model reads for itself (`ReadMediaFile` default reads). It bounds the accumulated request-body size when the model keeps screenshotting and reading images; fine detail stays reachable through the `region` parameter, which reads a crop back at full fidelity (`region` and `full_resolution` are not subject to this budget)
|
docs ↗ | ||
| loop_control | string |
Agent loop control parameters → `loop_control`
|
docs ↗ | ||
| loop_control.max_attempts_per_step | string |
Maximum total attempts for a failing step, including the initial attempt
|
docs ↗ | ||
| loop_control.max_steps_per_turn | string |
Maximum steps per turn; unset or `0` means unlimited
|
docs ↗ | ||
| loop_control.reserved_context_size | string |
Number of tokens reserved for model output; automatic compaction is triggered when the remaining context window falls below this value
|
docs ↗ | ||
| mcp.startup_timeout_ms | string |
Global default connection (startup + tool discovery) timeout in milliseconds for all MCP servers. Accepts `1`–`2147483647`. A per-server `startupTimeoutMs` in `mcp.json` always wins over this section and the environment variable; when neither is set, the default applies
|
docs ↗ | ||
| mcp.tool_timeout_ms | string |
Global default single tool-call timeout in milliseconds for all MCP servers. Accepts `1`–`2147483647`. A per-server `toolTimeoutMs` in `mcp.json` always wins over this section and the environment variable; when neither is set, the client built-in default applies
|
docs ↗ | ||
| merge_all_available_skills | string |
Whether to merge Agent Skills from all available directories
|
docs ↗ | ||
| models | string |
Model alias table → `models`
|
docs ↗ | ||
| models.adaptive_thinking | string |
`anthropic` provider only. Force adaptive thinking on or off, overriding the version inference based on the model name. Omit to infer automatically (Claude ≥ 4.6 uses adaptive)
|
docs ↗ | ||
| models.base_url | string |
Per-model endpoint override (written by catalog imports for gateway models served away from the provider default). Resolution prefers it over the provider's `base_url`; only takes effect together with `protocol`
|
docs ↗ | ||
| models.capabilities | string |
Capability tags to add explicitly: `thinking`, `always_thinking`, `image_in`, `video_in`, `audio_in`, `tool_use`. Unioned with the capabilities auto-detected by the provider — entries can only be added, never removed
|
docs ↗ | ||
| models.default_effort | string |
Default thinking effort for the model. Managed and open-platform refreshes may rewrite this field; to pin it manually, set `[models."<alias>".overrides] default_effort` instead
|
docs ↗ | ||
| models.display_name | string |
Name shown in the UI; falls back to `model` when unset
|
docs ↗ | ||
| models.max_context_size | string |
Maximum context length in tokens; must be at least 1
|
docs ↗ | ||
| models.max_input_size | string |
Declared per-request input limit when it sits below the total window (e.g. gpt-5: 400k window, 272k input). Compaction, context-overflow checks, and usage ratios prefer it; completion budgeting keeps the total window. Resolution clamps it to `max_context_size`
|
docs ↗ | ||
| models.max_output_size | string |
Per-request output token cap (maps to `max_tokens`). Currently only the `anthropic` provider honors it. When set for a Claude model, this explicit value overrides the built-in server-side maximum
|
docs ↗ | ||
| models.model | string |
Model identifier sent to the server when calling the API
|
docs ↗ | ||
| models.off_effort | string |
Effort value sent on the wire to disable thinking (e.g. `none` for xai grok). Only meaningful for models that declare such an encoding (catalog imports set it): turning thinking Off then sends this value instead of omitting the effort field — the only way to actually stop reasoning on models that reason by default
|
docs ↗ | ||
| models.provider | string |
Name of the provider to use; must be defined in `providers`
|
docs ↗ | ||
| models.reasoning_key | string |
`openai` provider only. Override the field name used for reasoning content when the gateway returns it under a non-standard name; by default `reasoning_content`, `reasoning_details`, and `reasoning` are auto-detected
|
docs ↗ | ||
| models.support_efforts | string |
Thinking effort levels the model accepts. For `kimi`, selecting another value at runtime fails; when model resolution carries an unsupported configured or previous value, the session falls back to the target model's `default_effort` and reports that effective value to the UI. A Thinking-capable Kimi model without this field uses boolean `on` / `off`. Other providers pass concrete values unchanged when their protocol has a native effort field; protocols that expose only levels or token budgets perform the required format conversion. Managed and open-platform refreshes may rewrite this field; to pin it manually, set `[models."<alias>".overrides] support_efforts` instead
|
docs ↗ | ||
| permission | string |
Initial permission rules → `permission`
|
docs ↗ | ||
| permission.decision | string |
Action on match: `allow` (permit immediately), `deny` (reject immediately), `ask` (prompt each time)
|
docs ↗ | ||
| permission.pattern | string |
Match pattern in the form `ToolName` or `ToolName(arg-pattern)`, e.g. `Read` or `Bash(rm -rf*)`
|
docs ↗ | ||
| permission.reason | string |
Rule description for debugging and auditing
|
docs ↗ | ||
| permission.scope | string |
Rule scope: `turn-override`, `session-runtime`, `project`, `user`; defaults to `user`
|
docs ↗ | ||
| providers | string |
API provider table → `providers`
|
docs ↗ | ||
| providers.api_key | string |
API key, written in plain text in the config file
|
docs ↗ | ||
| providers.base_url | string |
API base URL
|
docs ↗ | ||
| providers.custom_headers | string |
Custom HTTP headers attached to each request
|
docs ↗ | ||
| providers.env | string |
Fallback source for provider credentials; see below
|
docs ↗ | ||
| providers.oauth | string |
OAuth credential reference (`storage` and `key` fields); injected automatically by the login flow — normally no need to write this by hand
|
docs ↗ | ||
| providers.type | string |
Provider type: `kimi`, `anthropic`, `openai`, `openai_responses`, `google-genai`, `vertexai`
|
docs ↗ | ||
| secondary_model.default_effort | string |
Thinking effort applied when subagents bind to the secondary model. Unset, the effort resolves naturally (global `[thinking]` config → the bound model's default effort) instead of inheriting the main agent's effort. Follows the main model's thinking-effort semantics: models with strict effort validation (e.g. Kimi models) fall back to their default effort for unsupported values; other providers receive the value as-is
|
docs ↗ | ||
| secondary_model.model | string |
The alias of a configured [`[models]`](#models) entry, e.g. `kimi-code/kimi-k2.5` (any provider, not limited to Kimi models)
|
docs ↗ | ||
| services | string |
Built-in external service configuration → `services`
|
docs ↗ | ||
| services.api_key | string |
API key
|
docs ↗ | ||
| services.base_url | string |
Service API URL
|
docs ↗ | ||
| services.custom_headers | string |
Custom HTTP headers attached to each request
|
docs ↗ | ||
| services.oauth | string |
OAuth credential reference, same structure as `providers.*.oauth`
|
docs ↗ | ||
| subagent.timeout_ms | string |
Maximum wall-clock time (milliseconds) a single subagent (`Agent` / `AgentSwarm`) is allowed to run before it is settled as `timed_out`. `0` means no timeout — the subagent runs until it finishes or the model stops it. This is the background-task manager's per-task timeout for each subagent task, so it applies to both foreground and background subagents. In print mode (`kimi -p`) the default is `0` unless explicitly set. Note: any value above `2147483647` (about 24.8 days) is clamped to roughly 24.8 days by the runtime
|
docs ↗ | ||
| telemetry | string |
Whether anonymous telemetry is enabled; disabled only when explicitly set to `false`
|
docs ↗ | ||
| thinking | string |
Default parameters for Thinking mode → `thinking`
|
docs ↗ | ||
| thinking.effort | string |
Thinking effort level (for example `low`, `medium`, `high`, `xhigh`, `max`). Non-Kimi providers do not remap concrete effort values when the upstream protocol accepts them; if the provider rejects the value, choose one that the model supports. Protocols that expose only levels or token budgets still require format conversion. Kimi models with `support_efforts` fall back to their model default when this configured value is not listed; Kimi models without that list treat every enabled value as boolean `on`
|
docs ↗ | ||
| thinking.enabled | string |
Whether Thinking is enabled by default for new sessions; set to `false` to force Thinking off
|
docs ↗ | ||
| thinking.keep | string |
Preserved Thinking passthrough. On `kimi` it is sent as `thinking.keep`; on `anthropic` (Claude and Kimi's Anthropic-compatible mode) it is sent as a `context_management` `clear_thinking_20251015` edit (enabling keep routes Anthropic requests to the beta Messages API; an off-value disables keep and returns to the standard endpoint). `"all"` preserves prior turns' reasoning (`reasoning_content` / Anthropic thinking blocks); set to an off-value (`false`/`0`/`no`/`off`/`none`/`null`) to disable. Overridden by `KIMI_MODEL_THINKING_KEEP`; only injected while Thinking is on
|
docs ↗ | ||
| token_counting.strategy | string |
`measured+estimated` reports the live size — the provider-reported usage of each exchange plus an estimate of the not-yet-measured tail — floored by the last measured total; `measured` reports provider usage alone, so the display only moves when an exchange completes; `estimated` reports a pure estimate with provider usage ignored — the fallback for providers that do not report usage or report it unreliably
|
docs ↗ | ||
| tools | string |
Global tool switch → `tools`
|
docs ↗ | ||
| tools.disabled | string |
Global denylist, applied after `enabled`
|
docs ↗ | ||
| tools.enabled | string |
Global allowlist: when non-empty, only the listed tools are available; omitting the field or setting an empty array imposes no constraint
|
docs ↗ | ||
| tui.toml.cache_expiry_hint | string |
Show a dialog when resuming a long-idle session or submitting after a long idle stretch, warning that the context cache has likely expired and offering to compact or start a new session (v2 engine only)
|
docs ↗ | ||
| tui.toml.disable_paste_burst | string |
Disable the non-bracketed paste-burst fallback that keeps rapid multi-line pastes from submitting line by line
|
docs ↗ | ||
| tui.toml.editor.command | string |
External editor command for composing long input; empty falls back to `$VISUAL` / `$EDITOR`
|
docs ↗ | ||
| tui.toml.notifications.enabled | string |
Whether desktop notifications are sent
|
docs ↗ | ||
| tui.toml.notifications.notification_condition | string |
When to notify: `unfocused` (only when the terminal is not focused) or `always`
|
docs ↗ | ||
| tui.toml.status_line.command | string |
Custom status line command. Its first stdout line replaces the first footer line, with a JSON snapshot (model, cwd, git branch, permission mode, plan mode, context usage, session id, version) passed on stdin. Runs are capped at 300ms and throttled to once per second; failures fall back to the built-in layout
|
docs ↗ | ||
| tui.toml.status_line.items | string |
Built-in slots to show on the first footer line and their order: `mode`, `goal`, `model`, `tasks`, `cwd`, `git`, `tips`. Unset keeps the default layout; unknown ids are skipped with a warning
|
docs ↗ | ||
| tui.toml.theme | string |
Color theme: `auto` (follow the terminal), `dark`, `light`, or the name of a custom theme
|
docs ↗ | ||
| tui.toml.upgrade.auto_install | string |
Whether new versions are installed automatically
|
docs ↗ | ||
| workspace.additional_dir | string |
Additional workspace directories, stored as absolute paths. Written automatically when you confirm "remember this directory" in `/add-dir`; read back on startup so the directories are available in every session of this project
|
docs ↗ |