Slash Commands
Slash commands are typed inside the interactive TUI. They are different from terminal commands (kimi ...) — see Terminal Commands (kimi). Some commands only work while the agent is idle; commands marked “always available” can also be used while the agent is streaming. /help (aliases /h, /?) lists keyboard shortcuts and all commands in-app.
Full command table
Account & configuration
| Command | What it does | When to use it |
|---|---|---|
/login | Log in: Kimi Code via OAuth device-code flow, or Kimi Platform via API key | First run, switching accounts, expired credentials |
/logout | Clear credentials of the current account | Switching accounts or decommissioning a machine |
/provider | Interactive provider manager (view/add/remove providers) | Adding a third-party or self-hosted model provider |
/model | Switch the LLM model for the current session | Trying a different model mid-session |
/secondary-model (alias /subagent-model) | Set default model for subagents (writes [secondary_model] default_model) | Cheaper/faster model for subagent work |
/settings (alias /config) | Settings panel in the TUI | Adjusting preferences without editing TOML |
/experiments (alias /experimental) | Experimental features panel | Opting into preview features |
/permission | Select the permission mode | Switching between Always Ask / Ask When Needed / Never Ask |
/editor | Configure the external editor launched by Ctrl-G | Composing long prompts in your editor |
/theme | Switch the terminal UI color theme | Readability/preference |
Session management
| Command | What it does | When to use it |
|---|---|---|
/new (alias /clear) | Start a fresh session, discarding current context | Moving to an unrelated task |
/sessions (alias /resume) | Browse and restore historical sessions | Picking up earlier work |
/tasks (alias /task) | Browse the background task list | Checking on long-running background work |
/fork | Fork the current session preserving full history (you stay in the current session) | Trying a divergent approach without losing state |
/title [<text>] (alias /rename) | Show or set the session title (max 200 chars) | Organizing the session list |
/compact [<instruction>] | Compact context; optional instruction hints what to preserve | Context window filling up on a long session |
/undo [<count>] | Undo recent prompts (selector without arg); rolls back todo list and plan-mode state, not code changes | Reverting a bad direction |
/reload | Reload session applying latest config.toml and tui.toml without restart | After editing config files |
/reload-tui | Reload only tui.toml UI preferences | After editing TUI settings |
/init | Analyze the codebase and generate AGENTS.md | First session in a new project |
/export-md [<path>] (alias /export) | Export the session as Markdown | Sharing or archiving a conversation |
/export-debug-zip | Export the session as a debug ZIP (same as kimi export) | Bug reports and support |
/copy | Copy the last assistant message to the clipboard | Pasting a result elsewhere |
/add-dir [<path>] | Add an extra workspace directory; no arg or list lists dirs; can remember per-project in .kimi-code/local.toml | Working across multiple repos/packages |
/web | Open the current session in the web UI (connect to a running server or start one) | Sharing a session or using the browser UI |
Modes & run control
| Command | What it does | When to use it |
|---|---|---|
/yolo (alias /yes) | Permission list with “Ask When Needed” preselected; Enter confirms | Routine edits auto-run; risky actions still ask |
/auto | Permission list with “Never Ask” preselected | Fully unattended runs |
/plan [on|off] | Toggle Plan mode; explicit on/off forces; toggling alone doesn’t create a plan file | Planning before executing |
/plan clear | Clear the current plan | Starting the plan over |
/swarm on|off | Toggle swarm mode | Enabling multi-subagent fan-out |
/swarm <task> | Enable swarm mode and send the task as a prompt; auto-turns-off after normal completion | One-shot parallel fan-out |
/goal [...] | Start/manage goal mode (see deep-dive below) | Persistent multi-turn objectives |
Information & status
| Command | What it does | When to use it |
|---|---|---|
/help (aliases /h, /?) | Keyboard shortcuts + all commands | Any time you’re lost |
/btw [question] | Side conversation in a forked sub-agent without affecting the main turn | Quick question mid-task |
/usage | Token usage, context consumption, quota | Watching budget/context |
/status | Session runtime state: version, model, cwd, permission mode | Debugging configuration |
/mcp | List MCP servers and connection status | Verifying MCP setup |
/plugins | Interactive plugin manager (also slash subcommands) | Installing/managing plugins |
/version | CLI version | Reporting bugs, checking updates |
/feedback (alias /bug) | Submit feedback with optional logs/codebase context | Reporting issues |
/exit (aliases /quit, /q) | Exit the CLI (not available while busy) | Done for the day |
Skill commands
Built-in skills ship as /<name> (no skill: prefix; idle-only): /mcp-config, /custom-theme, /update-config, /check-kimi-code-docs, /import-from-cc-codex, /sub-skill (plus /sub-skill.review, /sub-skill.consolidate). External skills are invoked as /skill:<name> [extra text]; see Skills.
Deep-dives
/login
What it does
Opens the platform selector and logs you in: Kimi Code (OAuth) via the RFC 8628 device-code flow, or Kimi Platform API key.
When to use it
On first run, when credentials expire, or when switching between the OAuth subscription account and an API-key account.
Example
/login
# → pick "Kimi Code (OAuth)" → complete the device-code flow in the browser
Notes
/logoutclears the current account’s credentials.- There is also a non-interactive shell equivalent:
kimi login(exit0on success,1on cancel/failure). - OAuth credentials and MCP authorizations are not migrated by
kimi migrate; re-run/loginafter migrating from the legacy CLI.
Official source
- https://www.kimi.com/code/docs/en/kimi-code-cli/reference/slash-commands.html
- https://www.kimi.com/code/docs/en/kimi-code-cli/guides/getting-started.html
/model
What it does
Switches the LLM model used for the current session from an interactive list.
When to use it
To move between the flagship and high-speed tiers mid-session, or to test a newly configured provider model without restarting.
Example
/model
# → interactive selector lists configured model aliases
Notes
- Only changes the current session; the persistent default is
default_modelinconfig.toml(or-m/--modelat launch). - Available API model IDs include
k3,k3-256k,kimi-for-coding(K2.7 Code) andkimi-for-coding-highspeed.
Official source
- https://www.kimi.com/code/docs/en/kimi-code-cli/reference/slash-commands.html
- https://www.kimi.com/code/docs/en/
/new
What it does
Starts a fresh session, discarding the current conversation context. Alias: /clear.
When to use it
When switching to an unrelated task, or when accumulated context is hurting answer quality and you don’t want /compact.
Example
/new
Notes
- Only available while the agent is idle.
- Sessions started later with
/newuse the default agent even if the original session was launched with--agent/--agent-file. - To keep the old session around, use
/forkfirst, or/sessionsto return to it later.
Official source
/sessions
What it does
Opens a browser of historical sessions so you can restore one, with full history. Alias: /resume.
When to use it
To pick up earlier work in the same project directory without re-explaining context.
Example
/sessions
# → interactive list; select a session to restore it
Notes
- Shell equivalents:
kimi -c(most recent in cwd),kimi -S [id]/kimi --session [id](selector or direct ID), andkimi session list. - Resuming restores the bound agent and the saved permission/plan mode (flags can override the saved mode).
- Sessions live under
~/.kimi-code/sessions/<workDirKey>/<sessionId>/; do not hand-edit.
Official source
- https://www.kimi.com/code/docs/en/kimi-code-cli/reference/slash-commands.html
- https://www.kimi.com/code/docs/en/kimi-code-cli/guides/sessions.html
/compact
What it does
Compacts the conversation context to free up context-window space. An optional instruction tells the compaction what to preserve.
When to use it
On long sessions when the context window is nearly full (also happens automatically when the threshold [loop_control] reserved_context_size is reached).
Example
/compact keep the failing test output and the refactoring plan
Notes
- Prompts sent before the last compaction cannot be undone with
/undo. Ctrl-Otoggles the compaction summary view.- Only available while the agent is idle.
Official source
- https://www.kimi.com/code/docs/en/kimi-code-cli/reference/slash-commands.html
- https://www.kimi.com/code/docs/en/kimi-code-cli/guides/sessions.html
/plan
What it does
Toggles Plan mode; /plan on / /plan off force a state; /plan clear clears the current plan. In Plan mode the agent researches and writes a plan file instead of editing code.
When to use it
Before a non-trivial change, so you can review and approve the approach before any file is touched.
Example
/plan on
Refactor the auth module to support OAuth2
# → agent drafts a plan; you approve, revise, or reject it
/plan clear
Notes
- Toggling alone doesn’t create a plan file; the plan is produced during the turn.
- In Plan mode,
Write/Editare restricted to the plan file andTaskStopis blocked; exiting plan mode requires user confirmation even in Ask When Needed mode. Shift-Tabis the keyboard toggle. Start a session directly in Plan mode withkimi --planordefault_plan_mode = true.
Official source
- https://www.kimi.com/code/docs/en/kimi-code-cli/reference/slash-commands.html
- https://www.kimi.com/code/docs/en/kimi-code-cli/guides/interaction.html
/yolo
What it does
Opens the permission list with Ask When Needed (formerly “YOLO”) preselected; Enter confirms. Routine edits and commands run automatically; risky actions, questions, and plan-mode exits still ask.
When to use it
For long, low-risk tasks in a trusted directory where per-action approval would be tedious. See the safety warning in Permissions and Approvals.
Example
/yolo
# → permission list appears with "Ask When Needed" preselected → Enter
Notes
- Still asks for sensitive files (.env, SSH keys), dangerous commands (
shutdown,rm -rf), and Plan-mode exits. - Shell equivalent:
kimi -y/kimi --yolo(hidden aliases--yes,--auto-approve). - Docs warn to use it only in trusted working directories.
Official source
- https://www.kimi.com/code/docs/en/kimi-code-cli/reference/slash-commands.html
- https://www.kimi.com/code/docs/en/kimi-code-cli/guides/interaction.html
/goal
What it does
Starts and manages goal mode: a persistent objective (max 4000 characters) that the agent keeps pursuing across auto-continuing turns until complete, paused, or blocked.
Subcommands: /goal or /goal status (show goal/status/elapsed/turns/tokens), /goal pause, /goal resume (idle only), /goal cancel, /goal replace <objective> (idle only), /goal next <objective> (queue an upcoming goal), /goal next manage (interactive queue manager).
When to use it
For long autonomous runs with a clear finish line — e.g. “migrate all tests to vitest and stop when the suite passes”.
Example
/goal Migrate src/ to TypeScript. Stop when `npm run typecheck` passes with no errors.
/goal status
/goal next Update the README build instructions
Notes
- Write the stop condition into the objective itself; there is no stop-limit flag.
- Subcommand words (
status,pause,resume,cancel,replace,next) only parse as subcommands in first position; use/goal -- <text>to bypass. - In
kimi -ponly creation forms work; prompt mode exits0(complete),3(blocked), or6(paused). - The queue is persisted in the session’s
upcoming-goals.json.
Official source
- https://www.kimi.com/code/docs/en/kimi-code-cli/reference/slash-commands.html
- https://www.kimi.com/code/docs/en/kimi-code-cli/guides/goals.html
/init
What it does
Analyzes the current codebase and generates an AGENTS.md project-instructions file.
When to use it
First session in a project, so every future session gets build/test commands and conventions injected into the system prompt. See Project Instructions (AGENTS.md).
Example
/init
# → reviews the generated AGENTS.md, then commits it to the repo
Notes
- Idle-only command.
- Review the generated file before committing — it becomes reference data in every system prompt.
Official source
- https://www.kimi.com/code/docs/en/kimi-code-cli/reference/slash-commands.html
- https://www.kimi.com/code/docs/en/kimi-code-cli/customization/agents.html
/mcp
What it does
Lists configured MCP servers and their connection status.
When to use it
To verify a newly added server connected, or to diagnose a missing tool. Companion skill command /mcp-config adds/edits/deletes servers; details in MCP: Connecting Servers to Kimi Code.
Example
/mcp
# → server list with per-server connection status
Notes
- Servers added mid-session only join new sessions; deleting a server mid-session leaves it listed as
removedand its calls fail. - MCP tools appear as
mcp__<server>__<tool>alongside built-in tools.
Official source
- https://www.kimi.com/code/docs/en/kimi-code-cli/reference/slash-commands.html
- https://www.kimi.com/code/docs/en/kimi-code-cli/customization/mcp.html
/permission
What it does
Opens the permission-mode selector: Always Ask (default), Ask When Needed, or Never Ask.
When to use it
To change how much the agent can do without asking — see the full mode comparison and warnings in Permissions and Approvals.
Example
/permission
# → select "Always Ask" / "Ask When Needed" / "Never Ask"
Notes
/yoloand/autoare shortcuts that preselect the latter two modes.- The persistent default is
default_permission_modeinconfig.toml(manual/yolo/auto). - Config values kept the old names when the modes were renamed in 0.41.0.
Official source
- https://www.kimi.com/code/docs/en/kimi-code-cli/reference/slash-commands.html
- https://www.kimi.com/code/docs/en/kimi-code-cli/guides/interaction.html
Last verified: 2026-09-07
Official sources:
- https://www.kimi.com/code/docs/en/kimi-code-cli/reference/slash-commands.html
- https://www.kimi.com/code/docs/en/kimi-code-cli/guides/getting-started.html
- https://www.kimi.com/code/docs/en/kimi-code-cli/guides/sessions.html
- https://www.kimi.com/code/docs/en/kimi-code-cli/guides/goals.html
- https://www.kimi.com/code/docs/en/kimi-code-cli/guides/interaction.html
- https://www.kimi.com/code/docs/en/kimi-code-cli/customization/agents.html
- https://www.kimi.com/code/docs/en/kimi-code-cli/customization/mcp.html
AI coding tools evolve quickly. If you find outdated information, please open an issue or pull request.