Slash Commands
Kazma’s gateway handles slash commands in Telegram, Discord and Slack before a
message reaches the agent. Most answer at once, without a model call;
/research, /swarm and /ide skill start work that uses one. The order
they are tried in is under Command Lifecycle.
Web research: deep research also has gateway/UI entry points (
/research deep …, Web/researchpanel). Prefer normal chat or those entry points rather than inventing ad-hoc slash variants. See Web research and Recent features.
Documents
Section titled “Documents”Surfaces the shared Document Intelligence platform (DocumentIngestionService)
via /documents (alias /docs) across Telegram, Discord, Slack, and other
gateway chats. Reads use opaque IDs; no raw server paths from the user.
Every chat acts as the install’s operator (one operator per install), as the
agent’s document tools and the Web Documents page do: the commands list
and read every document of the install, whichever surface ingested it (since
2026-10-13). With platform users (multi-user mode) they refuse. An id another
tenant holds answers exactly like an unknown one (status says “Not
found”). None of the subcommands needs a gateway admin.
| Subcommand | Usage | Description |
|---|---|---|
| (help) | /documents | Help + up to 8 documents |
list | /documents list | List id, title, state |
status | /documents status <id> | A job’s state, stage and attempts; for a document id, its newest job |
read | /documents read <id> | The first 3,000 characters of a ready document, fenced as untrusted data (no paging from chat) |
convert | /documents convert <id> <format> | Convert to another format (e.g. pdf/html/docx/markdown) → a new artifact; the reply gives its id, format and size |
pdf-info | /documents pdf-info <id> | Page count and encryption of a PDF (alias pdfinfo) |
redact | /documents redact <id> <term[,term…]> | Physical redact → new artifact; the original is unchanged. No confirmation in chat |
search | /documents search <library> <query> | Top 5 hits from an indexed library, fenced |
health | /documents health | Worker running/stopped, parsers ready, OCR readiness |
Alias: /docs … accepts the same subcommands. There is no upload subcommand:
a file sent in a chat is read transiently, not stored in the platform, and a document these
commands can see enters through the agent’s document_import. With durable
writes switched off, convert and redact answer that writes are disabled.
Guide: Document Intelligence · API: API routes — Documents.
📋 Plan mode
Section titled “📋 Plan mode”Inspect and propose, then execute on approve. Mutating tools are structurally blocked while plan mode is on (not a prompt nudge). HITL still applies after approve.
| Subcommand | Usage | Description |
|---|---|---|
| (status) | /plan | Show whether plan mode is on |
on | /plan on | Enter plan mode (write/exec/patch/shell blocked) |
| (task) | /plan <task> | Enter and plan that task in the same turn |
go | /plan go | Approve the plan and execute (alias: Proceed) |
off | /plan off | Leave without executing |
Kill-switch: KAZMA_PLAN_MODE=0. Web: Plan pill on the composer bar.
🔄 Session Commands
Section titled “🔄 Session Commands”/sessions, /session and /new
Section titled “/sessions, /session and /new”A season is one conversation, and the same season list is on every platform: the Web UI’s chat list and each chat app share it, so a conversation begun on Telegram can be continued on the Web or in Slack.
| Command | Description |
|---|---|
/sessions (/seasons) | List every season — Web, Telegram, Discord, Slack (the 40 most recent; archived ones left out) |
/session <#, id or name> (/season, /switch) | Take a season over: this chat continues it (your own seasons only) |
/session all | The list with archived seasons |
/session here | Which season this chat is on, with its Web link |
/session new [name] | Start a fresh season, named or not; /new does the same |
A new season keeps the old one: it stays in the list and in the Web UI sidebar, and what it held in working memory moves to long-term memory.
Usage:
/sessions/session 2/session new release notesRequired permissions: None.
/reset
Section titled “/reset”Clears this chat’s conversation and starts fresh: the saved conversation (its checkpoints) is deleted and the Web UI’s copy of the season is emptied.
Usage:
/resetResponse:
🔄 Conversation cleared and reset to default. Starting fresh!Side effects:
- What Kazma learned is not forgotten: memory keeps it (
/memory offkeeps a chat out of memory and forgets what it left). - The chat’s saved Time Travel steps are kept (
/replay cleardeletes them).
Required permissions: None.
/compact
Section titled “/compact”Summarizes the chat’s older messages now, as Kazma does by itself when the
conversation nears the model’s window. Useful before a long task, or when
/context shows the conversation filling up.
Usage:
/compactResponse:
🗜️ Context compaction completed successfully! Your conversation history has been summarized and compressed.Required permissions: None.
Removes the last reply from the chat’s saved conversation, with the tool calls and results that produced it, so the next message continues as if it had not been given.
Usage:
/undoResponse (success):
✅ Removed last assistant response, and what Kazma remembered from it. You can continue the conversation.Response (nothing to undo):
↩️ No assistant response to undo.Side effects:
- The reply already sent stays in the chat app; only the conversation Kazma keeps changes.
- What Kazma remembered from that turn — the memory of it and the facts it learned — is forgotten too.
Required permissions: None.
Replaces the last reply in the chat’s saved conversation with your corrected text, so the next turns build on it.
Usage:
/edit The corrected response text goes here.Response (success):
✅ Replaced last response, and forgot what Kazma remembered from the old one. You can continue the conversation.Response (missing text):
✏️ *Usage:* `/edit <corrected text>`
Replaces the last assistant message in conversation history.Response (nothing to edit):
✏️ No conversation history to edit.Side effects:
- The reply already sent in the chat app is not edited.
Required permissions: None.
/replay
Section titled “/replay”Time travel: list this chat’s saved steps, restore the chat to one, compare two, or delete them. A step is saved after each supervisor iteration (see Time travel). A step is named by its id: the first eight characters /replay list shows are enough. An iteration number is not an address, because it restarts every turn.
Sub-commands:
| Command | Description |
|---|---|
/replay list | This chat’s saved steps, turn by turn, with their ids |
/replay <step> | Restore: the later turns are taken back from the chat, from what Kazma remembered of them, and from its saved steps. Refused while a turn runs or an approval is waiting |
/replay compare <a> <b> | Diff two steps (messages, cost, model, routing) |
/replay clear | Delete this chat’s saved steps |
Branch a saved step into a new chat; the original stays intact.
| Command | Description |
|---|---|
/fork <step> | Branch that step into a new chat, owned by you, with the questions and answers up to it (it appears in the Web UI sidebar) |
Usage:
/replay list/replay 3f2a91bc/replay compare 3f2a91bc 8c41d0e7/replay clear/fork 3f2a91bcResponse (/replay list):
🕰️ *Saved steps* (restore with `/replay <id>`, branch with `/fork <id>`):
*turn 1*• `3f2a91bc` step 1 — 2026-10-14 09:30 — deepseek-chat• `8c41d0e7` step 2 — 2026-10-14 09:31 — deepseek-chatResponse (no steps):
📭 No steps of this chat have been saved.Response (/replay clear):
🗑️ Deleted 5 saved steps of this chat.Response (a restore while an approval waits):
⏸️ An approval is waiting in this chat (shell_exec). Approve or deny it first, then restore.Dependency: The SnapshotRecorder is wired into all graph-build sites by default (enabled via time_travel.enabled: true in kazma.yaml). If disabled:
⏳ Time travel not yet available.Required permissions: None.
🧭 Running Task Commands
Section titled “🧭 Running Task Commands”Out-of-band signals to a running turn. These intercept before the in-flight turn’s lock, so they take effect immediately rather than queuing behind it. Available on every platform (Web, Telegram, Discord, Slack).
/steer (soft)
Section titled “/steer (soft)”Adds extra context to the running task. The text is folded into the agent’s next step — it does not interrupt the current one.
Usage:
/steer also cover the error-handling pathResponse:
🧭 Steer noted — I'll fold it into the next step./steer! (hard)
Section titled “/steer! (hard)”Pauses the running task, injects the requirement, then resumes. The graph suspends via an interrupt, your text is injected, and the turn continues under the new requirement.
Usage:
/steer! stop — use the Postgres backend, not SQLiteBehavior:
- If the task is already finalizing (can’t pause),
/steer!automatically demotes to a soft steer and tells you so — your input is still applied. - If the resume fails, you get a clear
⚠️ Could not resume the task after steering.
/abort
Section titled “/abort”Cancels and abandons the running task. The turn is marked abandoned,
auto_continue is cleared, and an abort marker is injected so the agent will
not continue the task unless you ask it to redo it. /stop does the same.
The aborted request is answered ”⛔ Cancelled with /abort before an answer —
not continued.” in the conversation, so your next message is not taken as a
request to finish it. The turn is closed with whatever it had written so far,
or with that note if it had written nothing; an earlier turn’s answer is never
saved as its reply.
Usage:
/abortResponse:
⛔ Task aborted — I won't continue it unless you ask me to redo it.
/steer,/steer!, and/abortare resolved by the graph handler (agent_handler/graph.py), not the gateway slash resolver — they need live access to the running turn’s checkpoint state.
Running work: every chat turn, swarm task, scheduled job, document job, research session, crawl, X post, memory task and maintenance sweep Kazma is running or ran in the last day. What needs attention comes first: work that stalled (no progress past its budget), got stuck (nothing is running it anymore) or failed. See Running work.
| Command | What it does |
|---|---|
/runs | What needs attention, then what is running |
/runs all | The same, with what finished in the last day |
/runs show <id> | One run (or the run of an incident inc_…): its state, last progress, failure reason and the actions it offers |
/runs act <incident> <action> | Act on an incident: cancel, retry, retry_checked, close, dismiss or diagnose. Admin-only, like the other commands that change Kazma for everyone |
When work stalls, gets stuck or fails, Kazma sends a card to the chat it
started from, with one button per action; a button press is /runs act. The
first decision wins on every surface: a second press, here or on the
Dashboard, is told what was decided and by whom. A run whose effects outside
Kazma are unknown offers only retry_checked (“I checked its effects”).
diagnose decides nothing: the card keeps its buttons, and the diagnosis
arrives below it. A failure you already retried or dismissed no longer needs
attention; /runs all shows it as dealt with.
/runs in the web chat answers in the page’s language and links the
Dashboard’s Running work card, where the buttons are.
/long — budget/mission mode & the Partial protocol
Section titled “/long — budget/mission mode & the Partial protocol”/long on (soft Research budget — may end Partial), /long mission
(run-until-done with a hard wall, default 500 rounds), /long status,
/long off. A full reference lives in the diagnosis map (§11 Long-task);
the behavior that matters in chat:
- When a turn hits the budget/recursion limit, Kazma replies with the salvaged progress (Partial). Reply Proceed (or the remaining steps) and the stored continue-context is injected so nothing is re-done.
- Since 2026-08-19 the continue-context is only injected for continuation-shaped replies (short “proceed/continue/yes/…”): a fresh command after a Partial runs as a new task — never reframed as a note for the old mission.
- A Partial pauses the long task (baseline budgets, no mission
framing) until you
/longagain or the TTL lapses;/long offclears it immediately. /missionis/long mission. A task written after/long mission(or/mission) runs under the new budget straight away.
Skips the approval card for danger tools in this chat only, for an hour
(KAZMA_YOLO_TTL_SECONDS) or until /yolo off; turning it on and off is
logged. X posts and git writes still ask, and the exec denylist still
refuses catastrophic commands. It does not raise the tool-round budget —
/long does. Refused where KAZMA_ALLOW_YOLO=0, and in production unless
KAZMA_ALLOW_YOLO=1, with the reason.
Usage:
/yolo/yolo status/yolo off/long yolo and /unrestricted
Section titled “/long yolo and /unrestricted”/long yolo is the research budget and YOLO. /unrestricted is the
mission budget and YOLO — full power for this chat — until
/unrestricted off.
Usage:
/long yolo/unrestricted/unrestricted offAnswers a paused danger-tool approval from the chat, as its buttons do.
| Command | Description |
|---|---|
/hitl approve [thread_id] | Approve (also yes, y, allow) |
/hitl deny [thread_id] | Deny |
/hitl approve_task [thread_id] | Approve every danger tool of this task, until your next message (at most 10 minutes; the limit is fixed). Not for an X card (x_post, x_schedule_post, x_delete_post, x_cancel_scheduled_post): those take a one-time approval only, and approve_task approves nothing. |
/hitl opt <thread_id> <option> | Choose an option on a clarify / confirm card |
The thread defaults to this chat’s. Only the person who started the paused
task can answer it, and a card whose turn has moved on says it expired
instead of approving anything. A card nobody answers within
safety.hitl.approval_timeout_seconds (default 300 s) expires: the chat gets
”⏱ The approval for tool expired after N minutes with no answer, so it
was not run.”, then the rest of the turn. Tapping that card later says it
expired; send the request again if you still want it.
🔧 Tool Commands [core]
Section titled “🔧 Tool Commands [core]”The gateway answers these itself, from Kazma’s settings and the agent’s own reports, without a model call.
/personality
Section titled “/personality”View or switch the agent’s personality profile. 8 built-in profiles are available.
Usage:
/personality # Show current personality/personality list # List all available profiles/personality [name] # Switch to a specific profileAvailable profiles: default (🤖), friendly_expert (😊), concise (⚡), gulf_engineer (🛠️), creative_partner (🎨), sysadmin (🐧), teacher (📚), code_reviewer (🔍)
Response (show current):
🎭 Current personality: default 🤖Professional AI assistant, efficient and helpful.Response (list all):
🎭 *Available personalities:*
• `code_reviewer` 🔍 — Direct, constructive. Points to exact lines. Suggests alternatives.• `concise` ⚡ — Short answers, no fluff. Bullet points preferred.• `creative_partner` 🎨 — Playful brainstorming partner. Multiple angles. Uses emoji.• `default` 🤖 — Professional AI assistant, efficient and helpful.• `friendly_expert` 😊 — Warm, encouraging expert who explains concepts clearly.• `gulf_engineer` 🛠️ — Kuwaiti engineering colleague. Gulf Arabic phrases. Practical, no-nonsense.• `sysadmin` 🐧 — Terse, technical. Shell commands first. Assumes competence.• `teacher` 📚 — Patient explainer. Breaks down concepts step by step. Checks understanding.
_Switch with `/personality <name>`_Response (switch):
✅ Switched to **concise**: Short answers, no fluff. Bullet points preferred.Response (unknown profile):
❌ Unknown personality: `unknown`
Available: code_reviewer, concise, creative_partner, default, friendly_expert, gulf_engineer, sysadmin, teacher
Use `/personality list` to see descriptions.Priority chain: Runtime override > the agent.personality setting > KAZMA_PERSONALITY env var > default.
Required permissions: None to show or list. Switching changes every reply, web chats included: admin-only (see Permissions).
/context
Section titled “/context”Shows how much of the model’s context window this chat’s saved conversation
fills, the threshold at which older turns are trimmed and summarized, and the
active workspace, model and provider. /context detailed adds a breakdown by
message role. It is the same report as the agent’s context_info tool.
Usage:
/context/context detailedResponse:
📊 Context WindowTokens: 9,214 / 1,000,000 (1%)Summarization threshold: 950,000 tokens (1% utilized)Workspace: /home/you/kazma/kazma-data/workspaceModel: deepseek-chat Provider: deepseekResponse (/context detailed) adds a line after the token count:
Role breakdown: assistant=5,902, system=1,840, tool=911, user=561Window: the context window (models.context_window.<model> for the
active model, else context.max_context_tokens, else 1,000,000).
Threshold: the trim budget — 95% of the window, unless
agent.trim.token_budget sets it.
Required permissions: None.
/config
Section titled “/config”An interactive configuration wizard. Show the current config, switch the model or personality, turn memory on or off, switch MCP servers, and export — all without editing YAML. Each change writes the one setting it changes.
Usage:
/config # show current configuration/config show # same as above/config model <name> # switch the active model and its provider/config personality <name> # switch personality (alias of /personality)/config memory on|off # turn memory on or off/config tools list # show the MCP servers/config tools toggle <name> # turn an MCP server on or off (now and at every start)/config export # export config as JSONRequired permissions: None to show or export. model, memory, tools
and a personality switch change Kazma for every user and platform:
admin-only (see Permissions).
/skill
Section titled “/skill”Manage Agent Skills (discoverable, HMAC-signed capability bundles). Skills are published to the agentskills.io hub and installed from GitHub.
Usage:
/skill list # list installed Agent Skills/skill install <owner/repo> # install from GitHub (agentskills.io)/skill activate <name> # arm a skill for this chat/skill deactivate # clear the active skill/skill uninstall <name> # remove an Agent SkillDeep dive: Skill development · Kazma Hub.
Required permissions: install and uninstall add or remove a skill
for everyone: admin-only (see Permissions). The rest: none.
ℹ️ Info Commands
Section titled “ℹ️ Info Commands”Lists all available commands grouped by category.
Usage:
/helpResponse:
*Available commands:*
🔄 *Session*• `/sessions` (`/seasons`) — List every season (Web + Telegram + Discord + Slack)• `/session 2` (`/season`, `/switch`) — Continue that season here (take over)• `/session new [name]` — Start a fresh season (`/new` still works)• `/research deep <topic>` — deep research via the same agent• `/swarm <task>` — dispatch workers via the same agent• `/reset` — Clear the conversation history and start fresh• `/compact` — Manually trigger context window compaction• `/undo` — Remove the last reply from the conversation• `/edit <text>` — Replace the last reply with your corrected text• `/replay list` — This chat's saved steps, turn by turn, with their ids• `/replay <step>` — Restore this chat to that step (later turns are taken back)• `/replay compare <a> <b>` — Compare two steps• `/replay clear` — Delete this chat's saved steps• `/fork <step>` — Branch that step into a new chat
🧭 *Running task*• `/steer <text>` — Add context to the running task (applies next step)• `/steer! <text>` — Pause the task, inject a requirement, then resume• `/abort` or `/stop` — Stop and abandon the running task (won't continue unless re-asked)• `/hitl approve` · `/hitl deny` — Answer a pending approval (`/hitl approve_task` — every approval of this task)• `/runs` — Running work: what is stalled, failed or waiting for you (`/runs all`, `/runs show <id>`, `/runs act <incident> <action>`)
⚡ *Capacity & YOLO*• `/long on` · `/long mission` (`/mission`) — raise tool-round budget (HITL stays on)• `/yolo` — skip danger-tool approvals (does **not** raise the budget)• `/long yolo` — research budget **and** YOLO• `/unrestricted` — mission + YOLO (full power this chat)• `/long off` · `/yolo off` · `/unrestricted off`
📋 *Plan mode*• `/plan on` · `/plan <task>` — inspect and propose (write/exec blocked)• `/plan go` · **Proceed** — approve and execute (HITL still on)• `/plan off` · `/plan status`
🔧 *Tools*• `/personality` — Show current personality• `/personality list` — List all available personalities• `/personality <name>` — Switch personality• `/context` — Show context window usage• `/x` — X Studio: drafts, accounts, scheduled posts (`/x help`)• `/ide` — Workspace files, git and coding skills (`/ide help`)• `/kb` — Knowledge libraries: list, crawl, search (`/kb help`)• `/skill list` — List installed Agent Skills• `/skill install <owner/repo>` — Install from GitHub (agentskills.io)• `/skill activate <name>` — Arm a skill for this chat• `/skill deactivate` — Clear the active skill• `/skill uninstall <name>` — Remove an Agent Skill
📄 *Documents*• `/documents list` (`/docs`) — List processed documents• `/documents status <id>` — Durable job state• `/documents read <id>` — Read a ready document• `/documents search <library> <query>` — Search indexed docs
⚙️ *Config*• `/config show` — Display current configuration• `/config model <name>` — Switch model• `/config personality <name>` — Switch personality• `/config memory on|off` — Toggle memory• `/config tools list` — Show the MCP servers• `/config tools toggle <name>` — Turn an MCP server on or off (now and at every start)• `/config export` — Export config as JSON
ℹ️ *Info*• `/help` — Show this list• `/status` — Gateway health overview• `/model` (`/models`) — Show and switch the model• `/memory` — Report memory usage; `/memory off` / `/memory on` — keep this chat out of memory, or let it back in• `/cost` — Tokens and cost of this chat
For anything else, just ask the agent directly!Required permissions: None.
/status
Section titled “/status”Returns the gateway’s current health: each chat app with what its
connection says (connected, connecting, down, or running when it
keeps no record), then the messages waiting in the gateway’s queue and the
other messages being handled now. What it cannot read it shows as ?.
Usage:
/statusResponse:
*Gateway Status*● Gateway: **running**• Telegram: `connected`• Slack: `connecting` — Slack refused the Socket Mode connection (invalid_auth)• Queue depth: `0`• Messages in progress: `1`The first character is ● (U+25CF) for running, ○ (U+25CB) for stopped,
and ? when the gateway could not be read.
Context keys: started, adapters, queue_depth, in_progress — read from the GatewayManager (its stats, connection report and message handlers).
Required permissions: None.
/model
Section titled “/model”Shows the providers and their models, and switches the active model. On
Telegram it opens a picker: tap a provider, then a model. Elsewhere it lists
each provider with up to five of its models, the active one marked; switch
with /config model <name>. /models is the same.
Usage:
/modelResponse (outside Telegram):
Available providers:
DeepSeek — 2 models deepseek-chat *(active)* deepseek-reasoner
Use `/config model <model_name>` to switch.Required permissions: None.
/memory
Section titled “/memory”Reports how many facts Kazma holds for you and whether it remembers this
chat. /memory off keeps this chat out of memory from now on and forgets
what it left there; /memory on lets new messages back in (what was
forgotten stays forgotten).
Usage:
/memory/memory off/memory onResponse:
💾 Memory: `42` stored facts. This chat is remembered (`/memory off` to stop).Context key: memory_count — the current facts of your memory tenant.
Required permissions: None.
Shows the tokens and cost of this chat’s model calls, from the per-call
ledger (llm_calls.db).
Usage:
/costResponse:
💰 Session cost: `$0.0234` (2,481 tokens, 12 model calls)Context keys: total_tokens, total_cost, total_calls — summed from the ledger for this chat’s thread.
Required permissions: None.
/ide — IDE Coding Commands
Section titled “/ide — IDE Coding Commands”Where handled: kazma_gateway/agent_handler/commands.py:_try_ide_command
(intercepted in the gateway, skips the graph — same path as /swarm).
All /ide commands drive the transport-neutral IdeService in
kazma_core/ide/. Mutating/executing operations (edit, delete, run,
git) flow through the shared LocalToolRegistry + HITL danger-tool gate.
Subcommands
Section titled “Subcommands”| Command | Description |
|---|---|
/ide | Show help with all subcommands |
/ide ls [path] | List a directory in the workspace |
/ide open <file> | Read a file (shown in a code block) |
/ide edit <file> <text> | Write content to a file (HITL-gated) |
/ide delete <file> | Delete a file or directory (HITL-gated) |
/ide run <command> | Run a shell command in the workspace (HITL-gated) |
/ide runfile <file> | Run a script with its inferred interpreter |
/ide grep <pattern> [glob] | Regex search the workspace |
/ide git <subcommand> | Run a git subcommand (HITL-gated) |
/ide repo | Manage workspaces (list, switch, clone, activate by slug) |
/ide skill [name] [file] | Run a coding skill (refactor-file, write-tests, fix-lint, code-review) |
/ide swarm <task> | Dispatch a coding task to the swarm |
Examples
Section titled “Examples”/ide → shows help/ide open kazma_core/ide/service.py → reads the file/ide edit config.yaml "key: value" → writes (HITL approval required)/ide run pytest -q → runs tests (HITL approval required)/ide repo clone Mubder/kazma → clones + activates as workspace/ide skill write-tests kazma_core/ide/service.py → generates tests via swarmDanger-tier operations (edit, delete, run, git) require HITL
approval — the same gate as the agent and swarm. See AGENTS.md §7.
/ide repo switch, /ide repo clone and /ide repo <owner/repo> change
the active workspace for everyone: admin-only (see Permissions).
Available on: Telegram, Discord, Slack, Web (chat), TUI.
/swarm — Swarm Dispatch (chat)
Section titled “/swarm — Swarm Dispatch (chat)”Where handled: kazma_gateway/agent_handler/commands.py:_try_swarm_command
(intercepted in the gateway; the chat form of the kazma swarm CLI). Danger
dispatches still go through the swarm bus HITL gate.
| Command | Description |
|---|---|
/swarm | Show help + worker list |
/swarm status | Show swarm status |
/swarm list | List registered workers |
/swarm config | Show output-routing config |
/swarm config group <chat_id> | Route swarm output to a Telegram group |
/swarm config clear | Disable output routing |
/swarm broadcast <task> | Dispatch to all workers |
/swarm pipeline <w1,w2,…> <task> | Sequential pipeline |
/swarm consult <w1,w2,…> <task> | Parallel consult |
/swarm fanout <w1,w2,…> <task> | Parallel fan-out |
/swarm dispatch <worker> <task> | Dispatch to one named worker |
/swarm <natural-language task> | Auto-route to the best workers via CapabilityRouter |
Examples
Section titled “Examples”/swarm status/swarm pipeline researcher,builder,validator "Build a CLI tool"/swarm summarize today's AI news # auto-routed/swarm config group and /swarm config clear are admin-only (see
Permissions).
Deep dive: Swarm orchestration · CLI reference.
/kb — Knowledge Library (chat)
Section titled “/kb — Knowledge Library (chat)”Where handled: kazma_gateway/agent_handler/commands.py:_try_kb_command.
Ingest documentation sites into searchable libraries from any chat app. The
gateway answers every /kb command itself, with no model call. Commands that
change a library are for the gateway’s admins only
(slash_commands.changes_global_config): the libraries are the install’s,
and every chat can inject from them. On an install with platform users every
/kb command is refused, because libraries are not separated per user yet.
| Command | Admin only | Description |
|---|---|---|
/kb | no | Show help and the library list |
/kb list | no | List libraries (id, chunks, seed) |
/kb add <id> <url> | yes | Ingest one page now; the library is created once the page was fetched. The reply says whether the page was stored, unchanged or refused. /kb ingest is the same command |
/kb crawl <id> <url> [N] | yes | Crawl the doc tree in the background; the reply when it ends is the crawl journal’s outcome (finished, finished with failures, or did not finish) |
/kb refresh <id> | yes | Crawl the library again from its seed URL, in the background |
/kb search <id> <query> | no | Direct search (no model call) |
/kb status <id> | no | The library’s latest crawl, from the crawl journal |
/kb delete <id> | yes | Delete a library with its chunks, vectors and fetched pages; refused while a crawl of it runs |
Example
Section titled “Example”/kb crawl fastapi https://fastapi.tiangolo.com # ingest the whole site/kb search fastapi "dependency injection"/kb status fastapiDeep dive: Knowledge Library.
/research — Deep Research (chat)
Section titled “/research — Deep Research (chat)”Where handled: kazma_gateway/agent_handler/commands.py. Gateway entry
point to the deep-research pipeline (multi-query search → parallel acquire →
digest → LLM synthesis → report).
| Command | Description |
|---|---|
/research deep <topic> | Run a full deep-research pass (progress pings while running) |
You can also start research from the Web /research panel or by phrasing a
request as deep research in normal chat. Disable routing with
KAZMA_RESEARCH_ROUTE=0.
Deep dive: Web research · Recent features.
Command Lifecycle
Section titled “Command Lifecycle”A chat-app message that starts with / reaches the gateway’s handler
(kazma_gateway/agent_handler/graph.py), which tries, in this order:
- The commands that act on the chat’s saved conversation or on a running
turn:
/model,/hitl, the session commands,/reset,/compact,/long//mission//yolo//unrestricted,/plan,/undo,/edit,/replay <step>,/fork,/steer,/abort(/stop). - The resolver.
_build_slash_ctx()(agent_handler/commands.py) reads what the command reports from where it lives, andresolve_slash_command()(kazma_gateway/slash_commands.py) answers/help,/status,/memory,/cost,/context,/personality,/configand/replay list|compare|clearwithout a model call. /swarm,/ide,/kb,/documents,/research,/xand/skill.
Anything else goes to the agent as a normal message.
Adding a New Slash Command
Section titled “Adding a New Slash Command”- Answered without the model: a
_cmd_<name>()inkazma_gateway/slash_commands.pyand a branch inresolve_slash_command(). A fact it reports is filled in_build_slash_ctx()from where it lives, never with a constant:tests/test_gateway_slash_facts.pyfails on a key a command reads that nothing fills, or fills with a literal. - Needs the chat’s conversation or running turn: an intercept in
agent_handler/graph.py, before the resolver. - Changes Kazma for everyone (code, the model, configuration): add it
to
changes_global_config()inslash_commands.py, the admin gate’s one rule (tests/test_slash_admin_gate.py). - Either way: a line in
_cmd_help(), an entry inBOT_MENU_COMMANDS(the ”/” menu Telegram shows) and a section on this page.tests/test_slash_help_and_menu.pyfails when the three disagree, and when the/helpblock above is not what the code sends.
Permissions
Section titled “Permissions”A chat app takes messages from the users its allowlist admits; an empty allowlist admits everyone in the chat. Within that:
- A change that applies to every user and platform is admin-only: the
model (
/config model, or a pick in the/modelmenu),/config memory,/config tools, a personality switch,/skill installanduninstall, switching or cloning the active workspace (/ide repo), and the swarm’s output routing (/swarm config). An admin is a user named inKAZMA_GATEWAY_ADMINS(user ids, orplatform:idfor one platform), which decides alone when it is set; otherwise a user on the platform’s allowlist. With an empty allowlist and noKAZMA_GATEWAY_ADMINS, no one is. /hitlanswers only a task you started, and/sessiontakes over only your own seasons./yoloand/unrestrictedare refused where policy forbids them (KAZMA_ALLOW_YOLO=0, production).- A danger tool a command runs (
/ide run,/ide edit, …) still stops at the approval card.

