kimi-code/docs/en/reference/slash-commands.md
7Sageer d40d0d305d
refactor(agent-core-v2): make undo domain-owned (#2055)
* refactor(agent-core-v2): rebuild undo as wire-level journal rewind

Replace the compensating context.undo op with a wire-layer rewind
primitive: a log.cut control record with a persisted target, applied
uniformly by the wire during fold. Turn boundaries become first-class
(TurnIndexModel indexing turn.prompt record positions), models declare
a temporal classification (rewindable), and a single
IAgentRewindService owns the undo pipeline (quiesce -> precheck ->
cut -> reconcile) with all entry points converged.

- wire: log.cut record, rewindable model flag, re-fold rebuild;
  OpApplyContext.recordIndex for position-aware reducers
- rewind service: aborts the active turn, cancels in-flight
  compaction, preserves the pending queue, rebases measured tokens,
  reconciles lastPrompt, tracks conversation_undo
- todo list, plan mode, task-notification delivery and the turn index
  now rewind together with the undone turns
- transcript reducer applies cut ranges so snapshot/messages surfaces
  stay consistent with the model context
- REST/RPC/debug undo entry points converge on the rewind service;
  TUI parses the v2 undo-unavailable error shape
- legacy context.undo records keep replaying for old journals

* refactor(agent-core-v2): keep undo domain-owned

* refactor: enhance /undo functionality for consistency and safety, including todo list rollback and improved event handling

* chore: clean up undo changeset artifacts

* refactor: rebuild rewind consistency

* fix: make conversation undo durable and consistent

* fix(agent-core-v2): stabilize undo restoration

* fix: keep TUI undo on legacy error contract

* refactor(agent-core-v2): drop unused full compaction cancel API

Undo now rejects with session.busy while compaction runs instead of
cancelling it, so the awaitable cancel() added for the earlier rewind
semantics has no callers left. Remove it from the interface and
implementation; the RPC cancel path keeps using the task abort
controller directly.

* fix(agent-core-v2): remove injected context on undo

* chore(agent-core-v2): regenerate wire manifest

* docs(agent-core-dev): rename rewind to undo in layer table

* fix(agent-core-v2): undo prompt-owned image reminders

* refactor: remove transcript undo reconciliation

* fix(kap-server): map undo busy errors

* refactor(agent-core-v2): rename undo participant registry and attribute checkpoint depth

- Rename IAgentConversationUndoReconciliationRegistry to
  IAgentConversationUndoParticipantRegistry (conversationUndoParticipants).
- Return the limiting model from checkpointDepth and include it in the
  SESSION_UNDO_UNAVAILABLE details; report checkpoint_lost instead of
  compaction_boundary when no compaction explains the missing depth.
- Add a registry invariant test: every model reacting to context.* ops
  must be registered via defineCheckpointedModel or explicitly exempt.

* Delete .changeset/fix-undo-injections.md

Signed-off-by: 7Sageer <sag77r@hotmail.com>

---------

Signed-off-by: 7Sageer <sag77r@hotmail.com>
2026-07-27 11:09:26 +08:00

11 KiB

Slash Commands

Slash commands are built-in control commands provided by Kimi Code CLI in the interactive TUI, covering account configuration, session management, mode switching, information queries, and more. Type / in the input box to trigger command completion — the candidate list filters in real time as you continue typing; command aliases are also matched.

After typing the full command name, press Enter to execute. If the /-prefixed input does not match any built-in or Skill command, it is sent to the Agent as a regular message.

::: tip Some commands are only available in the idle state. Executing these commands while a session is streaming output or compacting context will be blocked — press Esc or Ctrl-C to interrupt first. The "Always available" column in the tables below indicates commands that are also available during streaming. :::

Account & Configuration

Command Alias Description Always available
/login Select an account or platform and log in: Kimi Code uses OAuth device-code flow; Kimi Platform uses API key login No
/logout Clear credentials for the currently selected account No
/provider Open the interactive provider manager to view, add, and remove configured providers. See Platforms & Models — /provider and provider management Yes
/model Switch the LLM model used in the current session Yes
/settings /config Open the settings panel inside the TUI Yes
/experiments /experimental Open the experimental feature panel Yes
/permission Select a permission mode Yes
/editor Configure the external editor launched by Ctrl-G Yes
/theme Switch the terminal UI color theme Yes

Session Management

Command Alias Description Always available
/new /clear Start a fresh session, discarding the current context No
/sessions /resume Browse historical sessions and switch to / restore one No
/tasks /task Browse the background task list Yes
/fork Fork a new session from the current one, preserving the full conversation history No
/title [<text>] /rename Without arguments, display the current session title; with an argument, set a new title (max 200 characters) Yes
/compact [<instruction>] Compact the current conversation context to free up token usage; an optional custom instruction can hint to the model what to preserve No
/undo [<count>] Undo recent prompts from the active context. Without a count, opens a selector; with a count, undoes that many prompts. Prompts before the last compaction cannot be undone. Undoing also rolls back the todo list and plan mode state produced by those prompts (code changes are not reverted) No
/reload Reload the current session and apply the latest config.toml settings (providers, models, etc.) and tui.toml UI preferences, without restarting the CLI No
/reload-tui Reload only the tui.toml UI preferences (theme, editor, notifications, etc.) without rebuilding the session Yes
/init Analyze the current codebase and generate AGENTS.md No
/export-md [<path>] /export Export the current session as a Markdown file No
/export-debug-zip Export the current session as a debug ZIP archive (same behavior as kimi export) No
/copy Copy the last assistant message to the clipboard No
/add-dir [<path>] Add an extra workspace directory to the current session. Run without a path (or with list) to list configured directories. When adding, choose whether to remember the directory for the project in .kimi-code/local.toml No
/web Open the current session in the web UI: pick a running server to connect to, or start a new foreground server after the TUI exits. See kimi web Yes

Modes & Run Control

Command Alias Description Always available
/yolo [on|off] /yes Toggle YOLO mode. Without arguments, flips the current state; explicitly passing on/off forces the setting. When enabled, skips approval for regular tool calls; Plan mode exit approval is not affected Yes
/auto [on|off] Toggle auto permission mode. When enabled, tool approvals are handled automatically and the Agent will not ask the user questions Yes
/plan [on|off] Toggle Plan mode. Without arguments, flips the current state; explicitly passing on/off forces the setting. Simply toggling does not create an empty plan file Yes
/plan clear Clear the current plan No
/swarm on|off Turn swarm mode on or off without sending a prompt. Yes
/swarm <task> Turn swarm mode on, then send <task> as a normal prompt. If the turn completes normally, swarm mode turns off automatically. In manual permission mode, Kimi Code asks whether to switch to auto or yolo before starting. No
/goal [...] Start or manage an autonomous goal See below

::: warning /yolo skips approval for regular tool calls. Please make sure you understand the potential risks before enabling it. Plan mode exit approval is not bypassed by /yolo; Bash inside Plan mode is still subject to the regular /yolo allow rules. :::

Autonomous Goal

/goal starts or manages goal mode: a persistent objective that Kimi Code works toward across automatically continuing turns. For usage guidance and examples, see Goals.

/goal Update the checkout docs, run docs build, and stop if still blocked after 20 turns
Command Action Availability
/goal or /goal status Display the current goal along with its status, elapsed time, turn count, and token count Always available
/goal pause Pause an active goal and keep it Always available
/goal resume Resume a paused or blocked goal Idle only
/goal cancel Remove the current goal Always available
/goal replace <objective> Replace the saved goal with a new objective Idle only
/goal next <objective> Queue an upcoming goal for this session. If no goal is active, start it immediately. The agent does not see queued goals until the current goal completes Always available
/goal next manage Open the upcoming-goal manager. Use / to browse, Space to select a goal for moving, selected / to reorder it, E to edit, D to delete, and Esc to cancel. In the edit field, use Shift-Enter or Ctrl-J for a new line and Enter to save Always available

The words status, pause, resume, cancel, replace, and next act as subcommands only when they are the first word after /goal. If your objective needs to start with one of those words, put -- before it:

/goal -- cancel the old rollout note after the new docs are published

If an upcoming goal needs to start with manage, put -- after next:

/goal next -- manage the release checklist

In non-interactive prompt mode, only the create forms start goal mode:

kimi -p "/goal Fix the failing checkout test"

Prompt mode exits with code 0 when the goal completes, 3 when it blocks, and 6 when it pauses. Other /goal subcommands, including next, are TUI controls and are not handled by kimi -p.

Information & Status

Command Alias Description Always available
/help /h, /? Show keyboard shortcuts and all available commands Yes
/btw [question] Open a side conversation in a forked sub-Agent without affecting the current main Agent turn; without a question, opens the panel first to wait for input Yes
/usage Show token usage, context consumption, and quota information Yes
/status Show the current session runtime state: version, model, working directory, permission mode, etc. Yes
/mcp List MCP servers and their connection status in the current session Yes
/plugins Open the interactive plugin manager Yes
/version Display the Kimi Code CLI version number Yes
/feedback Submit feedback with optional diagnostic logs and codebase context Yes

Exit

Command Alias Description Always available
/exit /quit, /q Exit Kimi Code CLI No

Built-in skill commands

Kimi Code CLI ships with a set of built-in Skills that appear directly as /<name> slash commands. Unlike external Skills, they do not require the skill: prefix and are available out of the box.

Command Description
/mcp-config Configure MCP servers and handle MCP OAuth login. See MCP
/custom-theme [<text>] Create or edit a custom TUI color theme. See Themes
/update-config Inspect or edit config.toml (model, provider, permission, hooks) and tui.toml (theme, editor, notifications, auto-update)
/check-kimi-code-docs Answer Kimi Code product questions (CLI usage, configuration, membership, error codes) against the official docs
/import-from-cc-codex Import Claude Code and Codex instructions, skills, and MCP settings into Kimi Code
/sub-skill Discover and reorganize the local skill inventory into hierarchical sub-skill bundles. Includes /sub-skill.review (read-only proposal) and /sub-skill.consolidate (apply the reorganization)

All built-in Skill commands are only available in the idle state.

Skill Dynamic Commands

Activated external Skills are automatically registered as slash commands. Ordinary external Skills use the skill: namespace prefix:

/skill:<name> [extra text]

For example, /skill:code-style loads the Skill named code-style and sends it to the Agent; any text appended after the command is concatenated to the Skill prompt.

External sub-skills appear directly in the slash command panel with dotted names:

/<parent-skill>.<sub-skill> [extra text]

For example, a child Skill named review inside a parent Skill named code-style is shown as /code-style.review. The dotted command name is derived from the hierarchy; the child SKILL.md can keep its local name.

For convenience, external Skill commands also support a shorthand form that omits the skill: prefix — /<name> — as long as the name is not taken by a system slash command. That is, /code-style falls back to matching /skill:code-style.

Built-in Skills shipped with Kimi Code CLI appear directly as /<name> in the slash command panel. For example, /mcp-config helps configure MCP servers and handle MCP OAuth login, and /custom-theme [extra text] invokes the custom-theme workflow to create or edit a TUI theme.

::: info All Skill commands are only available in the idle state. flow-type Skills are also exposed via /skill:<name> — there is no separate /flow: namespace. :::

For installing and authoring Skills, see Agent Skills.

Next steps