← Reference

Slash commands

Built-in commands available from the interactive TUI prompt.

Full notes from the app

Type / to see the autocomplete menu.

66 entries · kcode 0.4.0

66 shown
CommandArgumentsWhat it does
Session
/helpShow the slash-command list with one-line descriptions.
/versionPrint the exact running build as a notice in the chat: the version (major.minor with a monotonic build number as the patch — the git commit count, so it increments every commit), the git commit it was built from (with a -dirty suffix when the working tree had uncommitted changes at build time), the UTC build time, the target triple + cargo profile, and the rustc version. The same identity surfaces in the status-bar footer's compact tag (v0.1.<build> · <commit>), via kcode --version, and at the top of kcode doctor — so a stale installed binary is distinguishable from a fresh one at a glance (the build number moves every commit; a bare 0.1.0 semver would read identically across builds). GPU build only.
/quitExit kcode entirely (closes the window and all sessions).
See /exit /stop
/exitClose this session's tile and return to Mission Control. The agent keeps running and is reattachable from the switcher (Cmd-K); use /quit to leave kcode.
See /quit /stop
/clearEmpty the chat transcript without exiting the session.
See /compact
/feedback<message>Send a feedback message to the kcode team. The daemon POSTs the message plus the running build's identity (version, build id, OS version) to the configured feedback endpoint (feedback.endpoint in config.toml), with the salted machine fingerprint as the bearer token when it computes (anonymous otherwise). 202 → "Thanks, sent." An unset endpoint answers "feedback is not configured"; a failure answers with the reason. Nothing is stored locally. GPU build only.
See /version
/export[jsonl|markdown]Alias for /share.
See /share
/resume[session-id | --last]Replay a prior session. No-args opens a picker of recent sessions across every project (newest first); --last resumes the most recent; an explicit id resumes that one. Picking a session from a different project changes the working directory to that session's project root. The CLI flag kcode -r / kcode --resume (no id) opens the same picker but scoped to sessions for the current directory only. Add --print to either CLI resume form (kcode --resume / kcode --continue-last / -c) to dump the resumed transcript to stdout and exit instead of opening the window.
/debugOpen the daemon-wide live debug window as an overlay (#69, redesigned #78): process vitals (version, pid, uptime, socket, data dir, live/known sessions, connections, subscriptions), then one card per live session — leading with the why-is-it-waiting section (2026-08-06): the in-flight turn's live elapsed time, every parked permission ask (tool · agent · how long) and parked ask-user question, the session's subagents (kind · status · rounds · error), and the last-activity age in the header, so a wedged session is diagnosable from the first lines — then identity + overrides (model/effort/goal/permission mode), busy + restart counts, context occupancy with a fill meter + cumulative tokens, the live counters (turns + provider rounds, the last turn's wall time, tool ok/failed rate, compaction runs), the recent continuation-cascade trail (the last few continue/stop decisions with rule names and reasons), armed prompt loops with fire counts, the agent loop's own state (in-flight turn/round, doom-loop run length + threshold, request-envelope overhead, armed subsystems), shell-host child status, LSP servers (configured + spawned), and the loaded plugins; then the project hook stacks and the watcher rows (skill watcher armed state; a worktree operation in flight: <path> row per checkout operation still running, 2026-09-05). The client adds its own frame-interval readout in the header, and a memory section (2026-09-02) charts the daemon's and the client's own process memory over the last hour side by side — the physical footprint (Activity Monitor's figure; RSS where a platform has no footprint), sampled every 5 s from launch whether or not the window is open, with each process's rss, peak, drift over the window, thread and fd counts, and for the client the live decoded-texture ledger (count, bytes). Off by default: the overlay exists only while open, and the daemon builds and pushes a fresh snapshot on subscribe and then once per second (session_daemon.debug_push_ms) only while someone watches — closing the window (Escape) cancels the tick to zero work. A client-side command intercepted in the GPU panel (any focused session's input opens the one daemon-wide window) — never sent to the agent. Clients without the overlay get the same snapshot as a text reply. ↑/↓ scroll a line, PageUp/PageDown a viewport, Home/End jump to the ends.
See /stats /control /doctor
Other commands
/reloadclient|daemonRestart half the app on a rebuilt binary without losing sessions. /reload daemon asks the daemon to hand its live sessions to a freshly spawned successor (a takeover file next to the socket; the successor retries the singleton flock and rehydrates each session from its durable transcript) and exit — the client rides its reconnect supervisor, tiles mute briefly, and an open turn ends interrupted (the panel settles it and says so). /reload client spawns a successor of the app process and quits; the daemon's idle grace covers the gap and the fresh client's first Hello rebuilds every tile from daemon-side workspace state. Bare /reload prints usage.
See /quit /exit
/autocompact[<n>|off]Set an absolute context-token budget for this session: when the live context reaches <n> tokens (50000, or a 50k/1.5m suffix), kcode forces a compaction in the session's configured mode — independent of the percentage auto-compact thresholds. Defaults to 300,000 tokens (compaction.auto_compact_tokens, 2026-08-09 — on by default so a 1M-window model's unreachable percentage thresholds aren't the only trigger); a session override set here wins until a respawn re-arms the config default. No-args shows the current budget; off (or 0/clear) removes it so only the percentage thresholds apply. Persisted per session like /model and /effort, so it survives --resume and a daemon restart. GPU build only. Aliases: /auto-compact, /auto_compact.
See /compact
/promote[name] [location]Promote a scratch session to a real project (2026-08-26). A scratch session is one started with no folder (⌘N → Enter on the picker's scratch row, or SpawnSession { scratch: true }): the daemon roots it at a fresh temp dir ($TMPDIR/kcode-scratch-<id>/), swept by the OS on reboot, and its tile shows the label scratch. /promote turns it into a project: bare /promote opens a one-line editor taking name [location] (a bare name lands under ~/code; a name path pair uses the path, ~ expanded), /promote <name> [location] skips the editor. The daemon creates <location>/<name>/, moves the scratch root's contents into it, re-points the session (durable row + the running agent's tool cwd from the next turn, via the loop's live cwd_override), relabels it to name, and copies the session record into <name>/.kcode/sessions/ so a promoted project is self-contained. Refused with a notice while a turn is running — promote between turns. Not a scratch session → a notice, no-op.
See /fork /rename
/parentJump to this session's parent — the root agent that forked it (/fork / fork_session) or spawned it as a worktree worker (spawn_worktree_session). The parent link is the session's persisted origin, read off the registry, so it survives a daemon restart. A live parent is brought onto the grid and focused; a stopped one is resumed (the same bring-on-grid path as a notification row click). A root session has no parent and the command says so. The child also wears an origin badge in the switcher — ⑂ fork or ⚙ worker beside its branch — so a session that belongs to a root agent is identifiable at a glance. GPU build only.
See /fork /worktree
/undo[list]Step the session's project files back one change (R#74): the daemon snapshots the project at every turn start, and every fs write/edit/apply_patch captures its pre-write bytes as a per-edit checkpoint, so repeated undos walk edit-by-edit and then turn-by-turn. The banner lists the restored/removed files with a compact unified-diff preview. list shows the session's checkpoints. Before stepping back the daemon captures the current state as the redo point, so an undo is never one-way.
/redoRestore the project state the daemon captured just before the last /undo (R#74) — the undo is never one-way.
/upgradeCheck for a new kcode release and self-update (the kcode upgrade CLI flow in-app): a cargo-bin install swaps the binary, an .app bundle reports the download hint. The result posts to the chat.
See #updater
/jumpScroll the transcript to an earlier message in this conversation. Opens a type-to-filter overlay (↑/↓ to move, Enter to jump, Esc to cancel) listing this session's user and assistant messages — each row shows the author and a one-line preview, the timestamp on the right — and choosing one scrolls that message to the top of the view and selects it. A no-op when the conversation has no messages yet. A client-side navigation command intercepted in the GPU panel — never sent to the agent. Also on the command palette as 'Jump to message…'. GPU build only.
See /control
/rename<title> | resetSet a display title for this session (shown in the switcher, the grid HUD, and leading the chat status bar). reset clears it. A session's title is the project directory unless explicitly set here — there is no auto-generated title. Related: /fork.
See /fork
/share[jsonl|markdown]Export this session's transcript to disk. No-args writes both JSONL + Markdown to <project>/.kcode/sessions/. Alias: /export. Separately from this on-demand command, every session is also auto-exported continuously to ~/.kcode/exports/<session-id>.jsonl, refreshed at each turn boundary (session_daemon.auto_export).
/statsOpen the focused session's stats dashboard as an overlay (#70): a header (session title · model · age · turns · rounds), a KPI strip (tokens in/out, cache read/write, thinking), two sparklines (tokens per turn and context occupancy % per turn), a tool section (runs · ok · failed plus a bar chart of the top tools), a per-model token list, context counters (compactions, continuation continue/stop counts, memory recalls), and the distinct files the agent wrote or edited. Price is deliberately not quoted anywhere (2026-08-14, user decision): the rate card is a hardcoded per-(provider, model) snapshot, so a dollar figure is often wrong and varies by provider — tokens are exact, so the dashboard reports tokens only. The daemon folds the durable token spine from the charge ledger (all-time) and merges the live counters it accumulates from the session's turn/control streams (turns, rounds, tools, trends — reset when the session stops), streaming a fresh snapshot on subscribe and at each of that session's turn boundaries while the overlay is open. A client-side command intercepted in the GPU panel — never sent to the agent. Also summoned by Cmd-Shift-S and the command palette's 'Stats'. ↑/↓ scroll a line, PageUp/PageDown a viewport, Home/End jump to the ends. Dismiss with Escape. With no session focused, Cmd-Shift-S opens the /stats all roll-up instead. In the headless (-p) build there is no overlay: /stats prints this session's dashboard summary as a text reply.
See /stats all /cost /control
/stats allOpen the cross-session stats roll-up as an overlay over the grid: one row per session — a liveness dot (working/idle/needs-input/error/stopped, in the same status colours as the tile glow), the session title, its model, cumulative tokens, and live context% — sorted by cost behind the scenes (biggest spenders first), under a header summarising the totals (session count · total tokens). Price is not quoted (2026-08-14, user decision — the rate card is a hardcoded snapshot, so a dollar figure is often wrong): the rows and the header report tokens only, though the cost data still drives the sort order. The daemon aggregates every session's charges from the shared user-scope cost ledger (so the roll-up spans all projects and works even when no session is live) and streams a fresh snapshot on subscribe and at each turn boundary while the overlay is open; the client joins it to the session registry to render. This is the pre-#70 /stats surface — the bare command is now the focused session's dashboard. Dismiss with Escape.
See /stats /cost
/browserToggle the session's browser tile in Mission Control (#66) — the headed half of kcode's browser. The tile streams the session's headless Chrome-family browser live (screencast frames as textures, with the page URL/title in a chrome row) and is click-through: clicking the page forwards a real mouse click at that point, so you can follow links and press buttons yourself while the agent drives the same browser with its browser_* tools. One browser per session, spawned on first use with a fresh ephemeral profile (cookies/storage never persist past the session) and killed with the session — closing the tile never kills the browser, it just closes your viewport (the agent keeps working headless). First-class tile: solver layout, miniatures, and attention glow all apply. Requires a Chrome-family browser installed (Chrome, Chromium, Edge, Brave, Arc) — otherwise the tile says so. Issue it from the session whose browser you want to watch; re-issue to close. macOS only for now.
See /debug /files
/costCompact one-line usage summary for the current session — cumulative tokens in / out across however many charges the session has run. Price is deliberately not quoted (2026-08-14, user decision): the rate card is a hardcoded per-(provider, model) snapshot, so a dollar figure is often wrong and varies by provider. Tokens are exact, so this reports tokens only.
See /stats
/effort[minimal|low|medium|high|off]Set the per-session reasoning effort. No-args opens a picker with all 5 levels (minimal | low | medium | high | off). off clears the override and falls back to the config default. The active level shows as a ⚡<level> segment in the status bar and, like /model, is restored on --resume.
See /model
/output-style[name]Pick the agent's output style — the tone/format instructions appended to the system prompt. No-args opens a picker over the built-in styles plus any plugin-bundled ones (<plugin>/output-styles/*.md); an arg sets directly. Persists to default_output_style and relays a live SetDefaultOutputStyle to the daemon, so sessions spawned from then on use it without a restart (the prompt is built once per session; live sessions keep theirs). Alias: /output_style. Alias: /output_style.
See #output-styles
/cot[on|off|toggle]Show or hide the model's chain-of-thought — the reasoning text. When ON, reasoning streams in live as the model thinks and settles into an expanded fold (rendered as faded Markdown, so code and lists inside it stay readable); collapse any fold and every later fold in the session stays collapsed (a sticky preference). When OFF, only the reasoning text is hidden — the live ✦ Thinking… indicator still shows (and the reply still streams), so a long reasoning phase never reads as a frozen turn (#170). A client-side display toggle that persists per session — restored on --resume, overriding the session_panels.chat.show_thinking config default; a session that never toggles it uses that default. Aliases: /think, /thinking.
/think[on|off|toggle]Alias for /cot. Toggles reasoning visibility.
See /cot
/thinking[on|off|toggle]Alias for /cot. Toggles reasoning visibility.
See /cot
/show-tools[on|off|toggle]Show or hide tool-call bubbles (name + args + result) in the chat pane. View-only — agent still invokes tools either way. A client-side display toggle, seeded from the session_panels.chat.show_tools config default (not persisted per session — unlike /cot). Default is on. Alias: /show_tools.
See /cot /tools
/show-control[on|off|toggle]Show or hide control-plane status lines — the injected <cp:*> channel messages (e.g. the per-turn permission context) — as dim status rows in the chat panel. Hidden by default. A client-side display toggle: applied locally to the panel, never sent to the agent. GPU build only. Alias: /show_control.
See /cot /show-tools #channels
/timestamps[on|off|toggle]Show or hide dim right-aligned timestamps on chat messages. Shown by default, matching opencode. Times are written as 12-hour with an AM/PM marker. Every rendered time in the app goes through one shared vocabulary (message headers, the notification center, and the /stats and /debug “as of” footers), so no two surfaces can disagree — they used to, in three different formats, one of which showed a UTC instant as if it were your local time. A client-side display toggle: applied locally to the panel, never sent to the agent. GPU build only. Aliases: /show-timestamps, /show_timestamps.
See /cot /show-tools /show-control
/add-dir<path>Grant the agent access to a directory outside the project root. Alias: /add_dir. Persisted in permission rules.
See #permissions
/add_dir<path>Alias for /add-dir. Grants a path outside the project root.
See /add-dir
/toolsList every tool registered with the agent: name, description, and current permission status.
See #tools
/init[<focus>]Scan the repository and write a compact project-context file so future kcode sessions ramp up fast — the equivalent of claude-code/opencode's /init. The agent reads the highest-value sources (README, manifests, build/test/lint/CI config, existing instruction files), extracts the hard-earned facts an agent would otherwise guess wrong (exact dev commands, how to run a single test, monorepo boundaries, real entrypoints, toolchain quirks), and writes them to AGENTS.md at the repo root, then makes CLAUDE.md a symlink to it (ln -sf AGENTS.md CLAUDE.md) so both filenames read one source of truth and can never drift. An existing AGENTS.md is improved in place; a real (non-symlink) CLAUDE.md is folded into AGENTS.md and then replaced with the symlink. /init <focus> passes a focus or constraint into the prompt (substituted at $ARGUMENTS, like a user markdown command). A bundled command (Area 10), listed by /commands and user-overridable. A setup action, so it is agent_invocable: false — the agent cannot fire it via run_command.
See /skills /agents
/commit[<args>]Commit the current work — the agent reviews the diff, stages deliberately (never git add -A, never secrets), and writes a message in the repo's style. A bundled command (Area 10 — the prompt routines reclassified from skills to commands): the command body becomes the agent prompt and runs as a normal turn. Listed by /commands, overridable by your own commit.md under a commands dir (user commands win the name), and invocable by the agent via run_command (it sets agent_invocable: true).
See /review /init
/review[<args>]Review the current changes — a structured code review of the working diff or a given range, reporting findings by severity. A bundled command (Area 10): the command body becomes the agent prompt and runs as a normal turn. Listed by /commands, user-overridable, and agent_invocable: false by default (an expensive self-check you can opt into via your own overriding review.md).
See /security-review /commit
/security-review[<args>]Security-review the pending changes — looks for injection, secret leakage, unsafe file/process/network handling, and permission-boundary violations in the diff. A bundled command (Area 10): the command body becomes the agent prompt and runs as a normal turn. Listed by /commands, user-overridable, and agent_invocable: false by default.
See /review /agents
/mcpList the connected MCP servers — the MCP-runtime subset of loaded plugins, with name and source. Servers are declared in <project>/.mcp.json (Claude-Code-compatible: command/args/env for stdio, type+url (+ optional headers for API keys/auth) for http/sse) or ~/.kcode/mcp.json, and connect when a session spawns; a plugin.toml with kind = "Mcp" also works. A daemon round-trip reading the session's live plugin stack. GPU build only.
See /plugins #plugins
/filesOpen the focused session's live project tree as an overlay: a gitignore-respecting listing of the project root, directories first (each sorted case-insensitively), every file carrying its git working-tree badge (✏️ modified, ✨ added, 🗑️ deleted, ❓ untracked, ➡️ renamed) over a faintly status-tinted row, plus a file-type icon. The daemon walks the tree and streams a fresh snapshot on subscribe, at each turn boundary, and on any debounced filesystem change, so it stays live while open. Click a directory to expand or collapse it; click a file to open it in your editor (see session_panels.files.editor). ↑/↓ move the selection through the tree and Enter activates the selected row — opening a file, toggling a directory — the keyboard twin of a click. A client-side command intercepted in the GPU panel — never sent to the agent. Dismiss with Escape. GPU build only.
See /diff /control
/tasksOpen the focused session's task/todo checklist as an overlay over the grid: one row per task — a bracketed status marker ([x] done in green, [•] in-progress in amber, [ ] to-do in muted grey) and the task's subject, in the order the agent listed them, under a header summarising the counts (task count · N done · N active · N to do); the in-progress task also shows its present-tense caption (the tool's activeForm) beside it. This is the live, persistent view of the task/todo tool's list (the same session-scoped tasks store /jobs' sibling reads): the daemon streams a fresh snapshot on subscribe and at each turn boundary while the overlay is open, so it tracks the agent's task writes live. A client-side command intercepted in the GPU panel — never sent to the agent. Also toggled by Cmd-T. ↑/↓ scroll a line, PageUp/PageDown a viewport, and Home/End jump to the ends when the checklist outgrows the card. Dismiss with Escape (or Cmd-T again). GPU build only.
See /jobs task
/jobs[kill <id-prefix>]List this session's running background work — shell commands (auto-backgrounded bash runs and shell_spawns) and live subagents — gathered live from the shell-host exec registry and the subagent registry at query time (nothing is stored, so the list can never go stale). Each row shows its kind tag, a short id, the command or subagent name, and how long it has been running. /jobs kill <id-prefix> stops one: a unique prefix of the row's id (an exact id always wins; an ambiguous or unknown prefix kills nothing and says so). A bash row kills the exec; a subagent row trips the child's cancel token. A daemon round-trip. GPU build only.
See /tasks
/controlOpen the focused session's control-plane (<cp:*>) timeline as an overlay: the session/turn/round breadcrumb, a counter summary, one colour-coded row per emission (system→agent and agent→system, drops in error colour), and the last continuation decision as a footer. The daemon replays the accumulated control history on attach, so it matches the transcript; live events stream in. ↑/↓ scroll a line, PageUp/PageDown a viewport, and Home/End jump to the ends of a long history. A client-side command intercepted in the GPU panel — never sent to the agent. Dismiss with Escape. GPU build only.
See #channels /show-control
/notificationsOpen the notification center: an edge-anchored drawer sliding in from the right over the grid, listing the durable, cross-project notification log newest-first — one row per notification with its local time, a kind glyph and tag (needs-input ▲ amber, error ✕ red, done ✓ green, agent ◆ info blue — a message the agent posted via the notify tool, #65), and the text; rows already read dim to muted. The log is one global stream across every session (unlike the per-session /control timeline) and survives restarts (the daemon replays it on attach). A glowing seam always paints the window's right edge: with unread notifications it shows the colour of the highest-severity unread (error over needs-input over done) at full intensity, and with nothing unread it drops to a faint accent line rather than disappearing — the seam is the tray's only pointer affordance, so it never goes away. The seam is a live affordance, not just an indicator — clicking it opens the notification center (the mouse counterpart to Cmd-Shift-N). Notifications are marked read by visiting their originating session (focusing its tile), not by opening the drawer. Clicking a notification row jumps to the session that raised it — bringing it back onto the grid (or resuming it if it had stopped) and maximizing its tile — then closes the drawer. ↑/↓ move the selection through the rows and Enter jumps to the selected notification's session, the keyboard twin of that click. When the kcode window is not focused, a needs-input, error, or agent notification also escalates to a macOS desktop banner tagged to its session (completions never escalate — they stay in-app); returning to that session (focusing its tile) clears its banner. OS banners require kcode running as the installed kcode.app (see scripts/bundle-mac.sh) and are governed by macOS notification settings; a bare/unbundled binary posts none. Also summoned by Cmd-Shift-N, the command palette's 'Notifications…', and the context menu's Notifications. Each row also carries a trailing ✕ that dismisses just that notification, and a non-empty log shows a 'Clear all' footer — clearing removes the rows from the durable log for every client (the daemon broadcasts the removed ids); the keyboard twins are x / Delete (dismiss the selected row) and Shift-X (clear all). A client-side overlay — never sent to the agent. Dismiss with Escape or by clicking the dimmed backdrop. GPU build only.
See /control #channels
/procsOpen a live, system-wide view of the machine's dev-relevant processes (T4) — builds, servers, databases, watchers — as an overlay over the grid. One row per process: a kind chip (build in amber, server in accent, database/watcher muted), the process label + pid, the LISTEN ports a server holds (e.g. :5432), and the attribution column (short working directory, else the parent pid) so two same-named builds never read as one — a build you run in a terminal shows next to one the agent runs. The daemon scans the process table with proc-classify and classifies each process by name + behaviour (a node holding a LISTEN socket is a server, not a build); only the dev-relevant dozen surface, the rest are filtered at the lib. Off by default: the overlay exists only while open, and the daemon polls on a cadence (procs.poll_ms, default 2000) only while someone watches — closing (Escape) cancels the poll to zero work. The watch table is user-extensible via [[procs.watch]] config blocks (match / kind / label) layered over the built-in defaults. A client-side command intercepted in the GPU panel — never sent to the agent. ↑/↓ scroll a line, PageUp/PageDown a viewport, Home/End jump to the ends.
See /jobs /stats /debug
Ways of working
/stopStop this session's agent and remove its tile — the destructive counterpart to /exit (which only detaches). Raises a centred confirmation modal first (Cancel highlighted by default; a session that is still working gets a stronger warning); accepting halts the turn and removes the tile (the session is resumable with --resume / the switcher). Also on the command palette as 'Stop session'.
See /exit /quit
/goal[<objective> | clear]Set a verifiable, per-session goal — the north-star that defines when the session is done. /goal <objective> sets it: the goal persists on the session row (survives restart), shows as a mission line in the tile chrome, is baked into the agent's system prompt on each spawn/resume, and drives a kickoff turn where the agent confirms the goal, breaks it into verifiable sub-tasks, and starts executing them. From there the goal is self-driving (#59): an implicit on-idle driver (the tile shows the looping marker) re-nudges the agent toward the goal whenever the session idles, until the agent declares an exit via <cp:goal-status state="done"> (posted as a goal complete notification) or state="blocked" (a goal blocked needs-input notification), the no-progress guard trips (session_daemon.goal_driver_stall_turns consecutive toolless turns, default 3), or the goal is cleared. An agent-set goal (run_command goal) arms the same driver without a kickoff; the driver dies with the session and never re-arms on restart/resume — re-issue /goal to resume driving. Bare /goal shows the current goal; /goal clear/reset removes it and disarms the driver. GPU build only.
See /effort /model /loop
/loop[<every>] [<n>x] [instruction] | stopSchedule recurring continuation turns for this session — kcode's autonomous-endurance driver. A leading cadence (/loop 10m wakes every 10 minutes), a repeat count (/loop 5x), an on-idle cadence (/loop 0s, or any bare instruction, fires on every idle), or any combination drives the agent; trailing words become the instruction run on each fire (none = a plain continuation nudge that composes with /goal instead of repeating it). A count and a duration may lead in either order (/loop 5x 10m run the tests); the first non-cadence word begins the instruction, and a duration accepts h/m/s (1h30m) or bare seconds. A timer tick that lands mid-turn is deferred to the next idle, never interrupting work; <n>x caps the total fires, otherwise the loop runs until /loop stop. While armed, the session's tile shows a looping marker. The cadence syntax is shared with the agent's own set_timer tool — /loop is the user's front door to the scheduler, set_timer the agent's — so both read identically. GPU build only.
See /goal /stop
Memory and context
/compact[from <n>] [snip|summary|auto] [instructions…]Compact this session's history now, freeing context-window space. Older turns are summarised by a dedicated summarizer pass using the compaction template — a structured, anchored summary (Objective / Important Details / Work State{Completed,Active,Blocked} / Next Move / Relevant Files) that merges with any previous summary instead of re-summarising it — and replaced by one user-role message carrying a resume-directly cue — flagged as kcode-authored (synthetic, 2026-09-05), so the chat shows it, like the post-compaction file and skill restores, as a folded system notice whose headline opens a preformatted body on click, never as your own words, and the Markdown export heads it ### system; the most recent turns are kept verbatim. Tool calls and results feed the summary (truncated at 2000 chars each with an omission marker); images become [Attached image] lines. The prompt template is user-editable: <project>/.kcode/compaction-template.md overrides ~/.kcode/compaction-template.md (materialised from the compiled default on first use), with {{conversation}} and {{previous_summary}} slots. A trailing free-text argument steers the summary (e.g. /compact focus on the schema migration) — it is appended to the summarizer prompt as an emphasis block; the strategy token stays optional (/compact summary focus on… also works). from <n> makes it a partial compaction: everything before the n-th user turn is compacted (summary replaces it), that turn and later kept verbatim regardless of the preserve window. Bare /compact (no strategy token) is explicit intent and always compacts (2026-08-09 — it used to stand down below the snip threshold with a 'not needed' reply); only /compact auto keeps the threshold-gated behaviour. The lifecycle is marked in the transcript (2026-08-11): a 'Compacting context…' bubble posts at the start (and the tile shows Working for the duration), a 'Context compacted (strategy): before → after tokens' bubble posts at completion, and an autocompaction posts the same completion bubble — all persistent transcript bubbles routed via a dedicated CommandReplyKind::Compaction, not toasts (they used to be single-line notices the panel's heuristic flashed past as toasts, leaving the silent history rewrite unmarked). The status line's token/context count corrects to the post-compaction figure immediately on completion (the daemon pushes a corrected usage report), rather than holding the pre-compaction number until the next turn. After a compaction the summary also prefixes the system prompt on every following provider call, in addition to the inline transcript marker.
See /clear
/contextPer-session context-window breakdown (P5): the model window, the fixed request overhead (system prompt + tool schemas, as the agent loop's RequestEnvelope measured them last turn — split into its two parts), the message buffer bucketed by role (user / assistant / tool results / system, plus an image count when any are in play), total used with a percentage, remaining tokens, and the compaction thresholds (snip / auto-compact, plus the /autocompact absolute budget when armed). Every number comes from the same measurement path the compaction thresholds and <cp:context-usage> emission use, so the report can't disagree with the loop's own arithmetic. Daemon-computed for the live session and rendered as an info reply in the chat. Per-session by design — the cross-session roll-up is /stats.
See /compact /autocompact /stats
/memory[save | search <query> | delete <name> | consolidate [on|off|status]] [scope=user|project|all]Inspect and curate the memory store (the human counterpart to the agent's memory_* tools). Bare /memory (or /memory list) lists every stored memory — kind (user/feedback/project/reference), name, description, plus a (project)/conf/via annotation when a row diverges from the defaults — and ends with a footer teaching the sub-actions. /memory save opens a GPU form (kind + scope selects, name/description text, a body text-area; ↑/↓ move between fields, ←/→ cycle a select, Enter or the Save button submits) that upserts the memory by name. /memory search <query> recalls matching memories ranked by relevance × confidence × recency, each hit showing its score and a stale flag when old. /memory delete <name> forgets one. /memory consolidate runs the background consolidator now — it distils durable facts from your recent sessions into new memories (provenance-guarded, stamped as consolidator-sourced), surfacing on the /control timeline as a memory-consolidator subagent; /memory consolidate on|off turns the automatic runner on/off (persists memory_consolidator.enabled + relays it live), and /memory consolidate status shows whether it is on. search/delete accept a trailing scope=user|project|all token (search spans both by default; delete defaults to the user store). A daemon round-trip. GPU build only.
See /tasks memory_save memory_search
Agents
/forkBranch a copy of this session at the current point. The new session starts with the same transcript and diverges from here, inheriting the source's /model, /effort, and /autocompact overrides (a fork continues the conversation). Spawned live in a new tile. The agent has a twin: its fork_session tool forks with an optional title + first instruction, rate-capped by session_daemon.agent_fork_max_per_window.
See /rename /share
/subagent[clear]Configure the per-session pool of models subagents draw from. No-args opens a picker over the models of every provider you have a key for: Space toggles a model into the pool, ←/→ cycles a pool member's reasoning effort (inherit · minimal · low · medium · high — per model, since effort conventions differ across vendors), Enter applies. When a spawn names no model and its agent kind declares none, one pool entry is picked at random per spawn — so a multi-model pool mixes vendors across subagents. The judge does not draw from the pool (it keeps inheriting the session model). The pool persists on the session row (survives --resume and daemon restarts) and applies live — the next spawn picks from it. /subagent clear (or confirming an empty pool) resets to the default: subagents inherit the session's own model + effort. /subagents is an alias. Also on the ⌘P palette as "Subagent pool…" (Session group, 2026-08-12) so the pool is reachable without remembering the slash command. GPU build only.
See /agent /model /effort
/agentsOpen this session's live subagent list as a floating panel (R#51): every child spawned via spawn_subagent/spawn_subagent_async, in spawn order — status glyph (… spawned · ▶ running · ✓ done · ✗ failed · ⊘ cancelled), kind (+ mailbox name when spawned with name), rounds, elapsed/duration, the error summary on a failed row, and the kept worktree path + branch for a worktree-isolated child that left changes (R#49). Client-side only (like /tasks): the daemon mirrors the session's subagent registry from lifecycle-transition relays and streams a snapshot on every transition while the panel is open (SubscribeSubagents/Subagents); Esc or the scrim closes it and unsubscribes. The chat pane's pinned live rows (above the working strip) are clickable too (2026-08-06): a row expands an inline detail widget — status, elapsed, last tool with its target (2026-08-05: 'fs_write — src/foo.ts', so you can see what the agent is doing, not just that it is), tool + output counts, and the park reason when that child is the one waiting on a permission answer — so a stalled agent is diagnosable in place. When two or more children have finished, their pinned rows collapse into a single "✓ N subagents — done" line (2026-08-06, twelve drafters no longer paint twelve rows); clicking it opens this panel — running and failed rows never collapse. A finished child that produced a closing reply (the advisor's advice, or any subagent's final message) shows a one-line summary of it on its settled row instead of a bare "done" (2026-08-31) — so the conclusion reads inline in the transcript, not only in the tool result below.
See /tasks /control
/agent[<kind> <prompt...>]Spawn an agent kind with an initial prompt; spawned agents stream into the chat pane. No-args opens the agent-kind picker — built-ins, your markdown kinds from ~/.kcode/agents/ and <project>/.kcode/agents/, plus any plugin-bundled kinds (<plugin>/agents/*.md), each with its description — and picking one prefills /agent <kind> in the input for the prompt. Bare /agents is the plural alias for listing kinds.
See #agents /agents
/agentsOpen the agent-kind picker — the plural discovery alias of bare /agent. GPU build only.
See #agents /agent
Worktrees and files
/worktreenew <name> · list · remove · adopt [branch|path] · merge [slug] [commit] · update [slug]First-class worktree sessions (R#75). new <name> spawns a session bound to a fresh checkout of the current project at .kcode/worktrees/<name> on branch kcode/<name> — the session's tools root there, the switcher groups it under the base project with a branch badge, and /files shows the branch in its header. At creation the checkout is seeded from the base's .worktreeinclude (W1): a gitignore-syntax file naming which gitignored files to copy in (.env, local certs — the files git can't populate; a matched ignored directory copies as a whole tree, .git/.kcode never copy). The worktree also gets a stable isolation slot (lowest free ≥ 1 per project, the base is 0) driving the [worktree.env] template overlay injected into its shell — see worktree.env. list opens the live worktree panel — a floating overlay of every worktree session in the project, driven off the live session registry (no daemon round-trip): each row carries a status dot (working / idle / needs-input / error / stopped in the tiles' own colours), the branch badge, the live context-occupancy %, and the last-activity age, sorted with needs-input and working rows first. A row click (or ↑/↓ + Enter) jumps to that session — bring it onto the grid and focus it, or resume a stopped one — mirroring the notification-drawer row action. Dismiss with Esc; the panel reseeds every tick so progress moves live. remove deletes this session's checkout + branch, fail-closed on a dirty tree. A worktree session that stops clean is swept automatically (worktree.auto_remove_clean). adopt (W3) opens an existing checkout as a session: bare /worktree adopt picks from the base repo's linked worktrees that have no session yet (hand-made git worktree add trees and kept subagent worktrees), adopt <branch|path> targets one — the daemon validates it is a linked worktree of this repo, derives a slug from the directory name, grants trust, and spawns the session rooted at the checkout (never moved; a detached HEAD is refused). The /agents panel's kept-worktree rows carry an open as session chip driving the same path. merge (W4) lands a sibling worktree's branch in the current session's tree: preflights both trees clean, checkpoints the receiving tree first (/undo restores it), then squash-merges by default — add commit for a true two-parent merge commit. Bare /worktree merge picks from this project's worktree sessions. A clean landing emits <cp:worktree-merged> (diffstat + the worker's final report) into the receiving transcript and removes the worktree, its branch, and its session. Conflicts raise a modal: hand to the agent (the receiving session's agent gets the conflict list and commits the resolution) or abort (tree restored, worktree kept). update rebases a worktree's branch onto the base's latest commit — bare form inside a worktree session updates that worktree; conflicts take the same modal but a hand-off drives the worktree session's agent (git rebase --continue). Checkout creation, removal, merge and update run off the daemon's owner task (2026-09-05), so every other session keeps streaming while they run; one operation per checkout at a time — a second request on a busy checkout, and a resume of its session, are refused by name until it finishes.
/diffShow the working-tree diff of the session's project root — the whole uncommitted delta (git diff HEAD plus untracked files), rendered as a fenced diff block in the chat. A daemon round-trip backed by git-engine's working_tree_patch; reports a clean tree when there are no changes. GPU build only.
See /tasks /files
Settings and permissions
/permissions[default|accept-edits|bypass|plan|reset]Open the permissions editor: the session's posture (default | accept-edits | bypass | plan) as a cycling row plus its allow/deny rule lists — a adds a rule (pattern like bash(npm *), path(src/**), url(github.com/*), or tool(web_fetch); combine with && ), d/y deletes the selected rule, Enter cycles the mode row. An arg short-circuits to setting the posture directly. reset restores default.
See #permissions
/model[model-id | reset]Switch the per-session model. No-args opens a fuzzy-filter picker over the models of every supported provider, grouped by provider: the providers you have a key for first (the six native vendors — Anthropic, OpenAI, Fireworks, DeepSeek, Kimi, MiniMax — lead, then the keyed OpenAI-compatible vendors), then every provider you have no key for under its own Provider · no key section, each folded, each opening to that provider's whole catalogue — a key is not a precondition for seeing what a provider offers (2026-09-05). #141 When you have keys across several providers the sections are collapsible: every provider section starts folded except the one your session's current model belongs to (so you open to a short list at your own provider rather than a long flat scroll), each folded header shows a ▸ Provider (N) hidden-count you click to expand (▾) — or reach from the keyboard: ↑/↓ walks section headers as well as rows and Enter on a header expands/folds it (the picker opens on the first model row, so a folded header above is one or two ↑ away), and typing a query reveals matches across every section regardless of fold state. A single keyed provider is never folded. Each row shows its context window. The picker header shows the two actions: sets the highlighted model as this session's override for the next turn; ⌘⏎ does that and makes it the persistent default every new session boots on (the default_model config key — a live SetDefaultModel to the daemon plus a config.toml write, mirroring Settings › General › Default model), so #142 you can promote a model to the default without leaving the picker. The runtime keeps a client per keyed provider, so you switch across vendors without a relaunch. Choosing a model under a · no key header asks for that provider's key right there — the same masked key prompt Settings › Providers uses, or for OpenAI the ChatGPT sign-in choice with "Enter an API key" as one of its options — and applies the model the moment the key lands (the daemon activates a new key without a restart); Esc on the prompt changes nothing. A ChatGPT sign-in that cannot serve the picked model (the subscription backend's gated list) explains itself instead of applying. Pass a model id to set directly — an id that only an unkeyed provider lists asks for the key the same way; reset/clear clears the override. /models is an alias. Keys can also be added ahead of time in Settings (⌘,) › Providers. (GPU build; the model list is read client-side from the models.dev catalogue, which the daemon keeps live: it re-fetches models.dev on a TTL and pushes the fresh catalogue to every client — on attach and whenever it changes — so models released after your build appear in the picker without an update or restart; offline you keep the built-in snapshot.) Alias: /models.
See /effort /settings
/theme[name]Switch the theme. No-args opens the theme picker — a type-to-filter overlay (↑/↓ to move, Enter to choose, Esc to cancel, ★ on active) over the discovered Wingman themes (bundled wingman-dark / wingman-light / wingman-high-contrast plus any ~/.kcode/themes/*.ron|*.json, then any plugin-bundled <plugin>/themes/*.ron|*.json); an arg sets directly. Choosing one installs it live across every tile and persists it as theme in config.toml. Also reachable from the command palette's 'Switch theme…' and the context menu's Theme action.
See #themes
/settingsOpen the fullscreen settings page — generic, non-session app config in a sidebar + panes layout, raised over the grid. General: Default model + window Layout (Grid/Tabbed) + Max grid cap + Text size + UI font + Mono font + the ambient-backdrop knobs (on/off, style, reacts-to-activity, per-tile light) + the notification triggers (Notify: needs input / errors / turn complete — the §9 notification-center gates, each toggled live via a daemon relay); Advanced: Command dirs + Skill dirs + the /files Editor command (comma-separated path lists / a command line, edited in the text-editor overlay) + Memory auto-recall (the per-turn memory.auto_recall gate, off by default — the toggle persists to config.toml AND relays live through the daemon's generic ApplySettings settings relay, so running sessions honour it at their next turn; 2026-08-13); Providers: a searchable list of every keyable LLM provider with its connection status — type to filter, click or Enter a row to connect it. An OAuth-capable provider (OpenAI today) opens a sign-in method choice — Browser sign-in (the ChatGPT authorize page opens; a localhost callback completes it), Device code (a code to type at the shown page), or Enter an API key — a ChatGPT Pro/Plus login unlocks the subscription-gated models (GPT-5.6 Sol) no API key can serve, tokens stored in ~/.kcode/auth.toml mode 0600 and refreshed automatically; every other provider opens the masked API-key prompt directly (paste with ⌘V, saved to auth.toml); Plugins: the installed-plugin inventory (built-in, user, project, and linked scopes — version, runtime kind, source path, permissions, off/missing marks, plus policy notices) with per-plugin management — Enter a row for its detail: an Enabled toggle (a disabled_plugins list entry, written to config.toml and relayed live so newly-started sessions honour it without a daemon restart), a settings form generated from the plugin's declared [settings] schema (booleans toggle and enums cycle in place; strings and numbers open a typed editor; values persist under [plugins.<name>] and relay live the same way), the source path and declared permissions, a per-plugin activity tail (the kcode.log record — plus load/unload markers and contained handler errors — polled from the focused session about once a second while the detail is open), and Remove (a managed plugin's folder is deleted from disk after a confirm modal; a linked plugin just clears its config entry — the folder is never touched). The list ends with "+ Add plugin from folder…": the in-app directory browser links any folder holding a plugin.toml (recorded as [plugin_links] <name>, loaded from where it lives and hot-reloaded in place; a link whose path stops existing rows as missing with a loud notice, never a silent skip). A plugin whose declared capabilities hit the install-review soft wall (a broad fs.write, a private-network/loopback host, or the input-transform / tool-gate intercept powers) does not install on the first click — a confirm modal lists the exact dangerous capabilities and only an explicit "Install anyway" records the link (Area 6 install review; ordinary plugins install without the prompt); Theme designer: recolour every colour token of the active theme and save the result as your own theme — a 'Save as' name row, Save / Reset-to-base action rows, then grouped swatch + hex rows (Core, Diff, Effects, Syntax — click or Enter a row to open its editor, which drops a palette popover (2026-08-06): three swatch rows — vivid hues, muted pastels, a neutral ramp — a swatch click live-applies it immediately while the picker stays open so you can try several, and the hex field beside it takes exact entry; Enter commits, Esc closes, an empty commit on a syntax hue resets it to the renderer's palette); every committed hex re-themes the whole window immediately (the app itself is the preview) without touching the active theme's name, Save writes a complete self-contained theme file to ~/.kcode/themes/<name>.ron (the theme watcher picks it up at once) and switches to it; bundled names (wingman-dark/light) can't be overwritten — and a refused or failed save says so on the Save row itself instead of silently doing nothing (2026-08-07). Full coverage (2026-08-21): after Providers, the sidebar carries one section per documented [section] config namespace (Agent framework, Agent loop, Compaction, Logger, Memory, Worktree, …) — a data-driven registry derived from the same type list kcode config defaults documents, so every documented lib key has a row. A boolean renders an On/Off toggle; any other scalar (integer, float, string) shows its current value and opens the typed text editor. A marks a value that differs from its compiled default. These lib knobs are read once at daemon boot, so an edit writes ~/.kcode/config.toml and takes effect on the next daemon restart (the editor says so); there is no live relay for them. Also on ⌘, and the context menu's Settings action. Each control live-applies and persists (layout/grid to the daemon workspace; text size + dirs to config.toml; keys to auth.toml). Provider keys live here — not on a session command — because one key serves every session (all-session config). Session-varying knobs (theme, model, effort, chat display gates) are session slash commands, not here. The whole page is keyboard-drivable, sidebar-primary: it opens on the sidebar, where ↑/↓ move the section selection and → (or Enter) dives into that section's rows; in the rows, ↑/↓ move the highlight, → / Enter act on the selected control (adjust a stepper/cycle/toggle in place, or open its picker/dir editor), and ← either nudges a numeric stepper down or — on any other row — steps back out to the sidebar. (Tab is deliberately not a section switch: the GPU window's framework binds Tab to focus-cycling and consumes it before kcode sees it, so the sidebar owns section switching.) Esc closes the page. GPU build only.
See /config #config
/configAlias for /settings — opens the same fullscreen settings page (⌘, / context menu Settings). GPU build only. Alias: /settings.
See /settings #config
Plugins and skills
/pluginsList the session's loaded plugins (Lua, MCP, WASM, native) from ~/.kcode/plugins/<name>/plugin.toml (user scope), <project>/.kcode/plugins/<name>/plugin.toml (project scope), and .mcp.json MCP servers. Shows name, version, runtime kind, scope, and source path. Reads live state: editing a plugin under a plugin dir hot-reloads it into the running session and shows here. kcode plugins list prints the same local state from the CLI (no session needed); kcode plugins scaffold/validate are the authoring path (emit a working skeleton, pre-flight it with the same checks a session load runs); kcode plugins search queries the remote marketplace. A plugin can also replace a built-in tool (Area 8): list the built-in's name under shadows = [...] in its plugin.toml and give a tool the same name — the plugin tool goes live, the original stays reachable as builtin:<name>, and removing the plugin restores it. An undeclared name collision never shadows (the built-in keeps its name and the rest of the plugin still loads). Shadowing a safety-critical built-in (bash, the mutating shell_* tools, fs_write/fs_edit/apply_patch) additionally needs the replace-builtin capability plus project trust and the install soft-wall approve.
See #plugins
/skillsList the loaded skills — after Area 10 there are no built-in skills (the four prompt routines are commands now), so this is the user/project markdown skills from ~/.kcode/skills and <project>/.kcode/skills plus any plugin bundle's skills/. Run any of them as /<name> — the skill body becomes the agent prompt, with $ARGUMENTS and $1,$2,… substituted from the words you type after the name. A client-side command answered in the GPU panel from the presenter's skill registry; never sent to the agent. Loaded skills also appear in the / slash menu and the Cmd-P command palette (tagged skill); a skill file or directory symlinked into a skills dir is followed (#175). GPU build only.
See /init /plugins /agents /commands
/commandsList the markdown commands — the built-in prompt routines (/commit, /init, /review, /security-review, Area 10) plus the user-authored commands loaded from command_dirs (~/.kcode/commands and <project>/.kcode/commands by default) and any plugin bundle's commands/. Run any as /<name> — the command's markdown body becomes the agent prompt, with $ARGUMENTS (all the words you typed after the name) and $1,$2,… substituted in. A user command wins a name collision with a built-in (first-registration-wins; the built-ins load last), so your own commit.md overrides /commit. A client-side command answered in the GPU panel from the presenter's command registry; never sent to the agent. Adding or editing a command file takes effect live (a file-watcher repopulates the registry — no restart). Loaded commands also appear in the / slash menu and the Cmd-P command palette (tagged cmd); a command file symlinked into a commands dir is followed (#175). GPU build only.
See /skills