Every command, with what it does, why you would use it, and how — not just a one-line label. Search matches the explanations too, so “headless” or “rate limit” finds the right command even when its name says neither. Click any name to copy it.
Run the conversation itself — see what you are running, what it costs, and go back when it goes wrong.
Show every command, or the details of one.
WhyYou forgot a flag, or want to know exactly what a command does before running it.
How/help bg
Show provider, model, mode and context size.
WhyThe one-glance answer to 'what am I actually running right now?' — check it before an expensive task.
How/status
Break down where the context tokens went — system prompt, per-role totals, biggest messages.
WhyThe session feels slow or expensive and you want to see WHAT is eating the window before compacting.
How/context
Summarise the earlier chat to free up context.
WhyYou are near the window limit but want to keep working in the same session. Compacting early is cheaper than letting it fill.
How/compact
One-line cost summary — model, tokens, dollars.
WhyA quick sanity check mid-task. Use /insights when you want the full breakdown.
How/cost
Token usage for this session — in, out, estimated cost.
WhyYou want the raw numbers rather than a dollar figure, e.g. to compare two models on the same task.
How/usage
Tokens and estimated cost for this chat AND every saved session.
WhyMonth-end question: what has kbcode actually cost me across all my projects?
How/insights
List past chats for this project, or full-text search them.
WhyYou remember solving this two weeks ago but not where. Search your own history instead of redoing the work.
How/sessions oauth refresh
Resume a past session (no id = pick from a list).
WhyContinue yesterday's work with all its context instead of re-explaining the task.
How/resume
Export a session as a markdown file.
WhyYou want the transcript in a PR description, a bug report, or your notes.
How/export
Forget this chat and start a fresh saved session.
WhyThe conversation went down a wrong path and is polluting the context. Memory and kb/ are kept.
How/reset
Re-send your last message as a fresh turn.
WhyA provider error or an interrupt killed the turn — retry without retyping the whole request.
How/retry
Re-run the last shell command — no model turn.
WhyYou just fixed the code and want the test again. Costs nothing because the model is not involved.
How/rerun
Show the last run_command result again without re-running it.
WhyThe output scrolled away and re-running would be slow or destructive.
How/output
Copy the last reply's code block to the clipboard.
WhyYou want to paste the snippet somewhere else without selecting it with the mouse.
How/copy 2
Open the last reply in your browser.
WhyTerminals draw Telugu, Hindi and Arabic scripts broken. This renders them properly — and you can type a reply there and send it back.
How/view
Show this session's work diary — goal, rules, state, doubts, history.
WhyLong session: check the agent still has your goal and standing rules right, before it drifts further.
How/worklog
Show the agent's current task checklist.
WhyMulti-step job — see what it thinks is done and what is left.
How/todo
Show the durable lessons kbcode learned from past mistakes.
WhyYou wonder why the agent avoids a certain move — these are its recorded rules.
How/lessons
Show (or wipe) the mistake notes the model is currently bound by.
WhyThe agent got corrected earlier; this shows the rules it wrote for itself so it will not repeat it.
How/mistakes
Reprint the startup banner panel.
WhyThe screen scrolled and you want the project/model header back.
How/banner
Show the kbcode version.
WhyReporting a bug, or checking whether an update actually landed.
How/version
Quit the chat and return to the terminal.
WhyEnds the session cleanly. It stays saved, so `kb -c` or /resume picks it up later with its context intact.
How/exit
kbcode is not tied to one vendor. Switch model or provider mid-session, cap spend, and set a failover.
Switch model (no id lists this provider's models).
WhyDrop to a cheap model for grunt work, or jump to a strong one for a hard problem — mid-session, without losing context.
How/model claude-sonnet-4-5
Switch provider (no name lists them).
WhyYour Claude quota ran out, or you want to compare the same task on OpenAI. kbcode is not locked to one vendor.
How/provider openai gpt-4o
List the models available from the current provider (picker).
WhyYou are not sure of the exact model id before switching.
How/models
List every configured provider (picker).
WhySee what you can switch to — and which ones already have a key — before running /provider.
How/providers
Unified model manager — change, update or delete the whole model setup in one menu.
WhyYou want to reorganise providers and keys without remembering four separate commands.
How/um
Manage API keys — view or replace the current key, add rotation reserves, set another provider's key, or delete keys.
WhyYour key rotated, or you want a spare so a rate limit does not stop the session.
How/api
Configure integrations from a dedicated submenu; Telegram supports setup, status, verification, chat-ID lookup, a receive on/off switch, the message trigger, five execution modes, removal and help.
WhyYou want to connect Telegram without putting a BotFather token into a model prompt or chat history — and optionally let one verified chat start a turn in the running session.
How/integration telegram trigger
Show the Telegram listener — receive on/off, trigger state, chat, mode, live polling stats, checkpoints, drop counters and the last error — restart the poller, mint or revoke a pairing code, or list and retry failed deliveries.
WhyMessages stopped arriving and you want to see whether receiving is off, the poller died, or Telegram returned an error — then bring it back without restarting kbcode. Pairing a new chat and rescuing a reply Telegram refused live here too.
How/telegram status
Set a failover or image-fallback model; bare /fallback opens a menu, 'off' clears it.
WhyYour main provider errors out mid-task — the fallback finishes the turn instead of dropping it. Also gives vision to a model that has none.
How/fallback openai gpt-4o
Set reasoning effort: off, minimal, low, medium, normal, high, max, xhigh.
WhyHard architectural problem → raise it. Routine edits → lower it and stop paying for thinking tokens.
How/thinking high
Set sampling temperature, or 'none' for the model default.
WhyLower for deterministic refactors, higher when you want more varied ideas in a brainstorm.
How/temperature 0.2
Cap output tokens, or follow the model automatically.
WhyA model that rambles costs money; a cap that is too low truncates a big file write.
How/llm_max_output_tokens auto
Limit LLM requests per rolling minute.
WhyYour provider tier rate-limits you — throttle locally instead of collecting 429s.
How/llm_rpm 20
Limit estimated LLM tokens per rolling minute.
WhySame idea as /llm_rpm, for providers that meter tokens per minute rather than requests.
How/llm_mtpm 100000
Manage anti-repetition penalties (OpenAI-compatible providers only).
WhyA weaker model keeps repeating the same paragraph or loops on a phrase.
How/repetition rep 1.1
LLM Test Center — test, allow, block or remove models, with custom prompts.
WhyBefore trusting a new model with real work, prove it can actually follow tool calls.
How/llm
Quick connectivity and auth check for the current provider.
WhySomething failed — is it your key, your network, or the model?
How/ping
Run the model benchmark suite (makes real API calls).
WhyHead-to-head comparison before you commit to a model for a project.
How/benchmark
The reason session two is cheaper than session one: project notes, durable memory, and skills you teach once.
Scan the project's code and build (or refresh) the kb/ knowledge base.
WhyThe single most valuable command in kbcode. Without kb/ notes the agent re-reads your repo every session and you pay for it. Run once per project.
How/init
List knowledge-base notes.
WhySee what the agent already knows about this project before asking it to re-explain something.
How/kb
Review the knowledge base — stale notes, oversized notes, broken pointers, stats.
WhyHousekeeping after a big refactor, so the notes do not quietly drift from the code.
How/curate
Check (or auto-fix) kb/ pointers.
WhyYou moved code around and want to know which notes now point at the wrong place.
How/kb-check --fix
Batch-scan and auto-fix stale kb/ pointers.
WhyBulk version of /kb-check for after a large rename or move.
How/kb-refresh
Restore a kb/ note from its last pre-overwrite backup.
WhyThe agent rewrote a note and lost something you wanted. Backups live in kb/.history.
How/kb-undo architecture
Show recent long-term memory.
WhyCheck which facts and decisions the agent is carrying between sessions — including any that are now wrong.
How/memory
Remove duplicate and near-duplicate memories, and anything older than [days].
WhyMemory has accumulated noise and you want the signal back.
How/memory-prune 90
Save what you just did as a reusable skill.
WhyYou solved something fiddly — teach it once and re-run it later in ANY session with /<name>.
How/learn deploy-staging
List saved skills.
WhySee what you have taught it; project skills and global skills both show up.
How/skills
Manage skills — run, view, improve, delete, undo.
WhyA skill needs a tweak, or you deleted one by mistake (undo restores the last version).
How/skill improve deploy-staging
Explain what a file or function does.
WhyUnfamiliar code, and you want the explanation without opening five files yourself.
How/explain kbcode/agent.py run
Regex-search the project — instant, no model cost (alias: /grep).
WhyYou know the string you are looking for. This costs nothing because the model is not involved.
How/search TODO --path kbcode
Sweep for symbols defined but referenced nowhere.
WhyCleanup pass before a release — a heuristic candidate list, not a verdict.
How/deadcode kbcode
Turning changes into commits, PRs and reviewed branches — with an undo for every edit.
Stage everything and commit; bare /commit drafts the message from the diff.
WhyYou finished a change and want a real commit message without writing it yourself. --amend folds into the previous commit, --push pushes after.
How/commit --push
Push the branch and open a GitHub PR via gh; bare /pr drafts title and body.
WhyThe branch is ready. /pr comments pulls review feedback back in so the agent can address it.
How/pr
Show git work-in-progress — staged, unstaged and untracked counts.
WhyA one-line answer to 'what have I got going on here?' before switching branches.
How/wip
Show what the AI changed since a checkpoint.
WhyAlways look before you accept. No n = the newest checkpoint.
How/diff
Revert the last turn's edits in one step, or just one file.
WhyThe edit was wrong. Every edit is checkpointed first, so this always works.
How/undo src/app.py
Undo AI edits by picking a checkpoint from a menu.
WhyYou want to go back further than the last turn.
How/rollback
Structured code review — bare reviews uncommitted changes.
WhySelf-review before you ask a human. Also takes a file or a commit range.
How/review @HEAD~3..HEAD
Security and correctness review of ONE file.
WhyDeep pass on the file that matters — auth, payments, parsing — rather than a broad skim.
How/code-review kbcode/auth.py
Guided multi-file refactor: blast-radius scan, plan, atomic edits, targeted tests, diff summary.
WhyA rename or API change that touches many callers, done in the safe order instead of ad hoc.
How/refactor rename Session to ChatSession
Run a whole agent task in the background, in its own git worktree.
WhyLong or risky work that would block your session — the result arrives as a reviewable branch, your working tree untouched.
How/bg upgrade the test suite to pytest 9
Run a background task on a schedule while a session is live.
WhyRecurring chores — dependency checks, doc regeneration — without a cron job.
How/every 2h 'check for dependency updates'
List background agent tasks and their status.
WhySee what is still running and what finished.
How/tasks
Review a background task — see its diff, then merge or discard.
WhyBackground work never lands silently; you decide after reading the diff.
How/task 3 diff
Run the release gate — pytest, ruff --fix, git-status guard, compileall.
WhyThe one command to run BEFORE tagging a release, not after.
How/gate
Switch to working on another project folder (alias: /cd).
WhyMove to a different repo without quitting and losing your setup.
How/open C:\dev\other-project
Show or switch the quality mode (enterprise / fast product).
WhyFast product skips the strict production prompts for fast iteration; enterprise is the full bar.
How/quality
Control what the agent is allowed to do, and diagnose it when something is off.
Switch mode: code, architect, ask, debug, driven, pilot, orchestrator.
WhyThe biggest single lever in kbcode. A mode decides which TOOLS the model gets — /mode ask literally cannot edit your files.
How/mode ask
Toggle auto mode — the agent works without permission prompts (alias: /auto-approve, also Shift+Tab).
WhyYou trust the task and do not want to approve every step. Remember it is full shell approval inside the workspace.
How/auto
List every tool available in the current mode.
WhySee exactly what the model can and cannot do right now — the honest answer to 'can it touch my files?'
How/tools
List available subagents (.kbcode/agents/).
WhySee which specialists exist before delegating an isolated job to one.
How/agents
List every mode with the tools it grants (picker).
WhyDecide which mode fits before switching — it shows what each one can and cannot touch.
How/modes
Show subagent activity and configuration.
WhyA delegated job is running and you want to know what it is doing.
How/subagents
Turn the decision reviewer on or off — it vets risky tool calls before they run.
WhyA second pair of eyes on big or destructive actions. 'selective' reviews only the risky ones.
How/decision-review selective
Show decision-reviewer accuracy — verdict stats, per-tool breakdown, recurring patterns.
WhyFind out whether the reviewer is actually catching things or just adding latency.
How/decisions
Show the PreToolUse/PostToolUse/Stop hooks configured for this project.
WhyHooks can BLOCK tool calls, so you need to see what is armed (and that it is not silently broken) before trusting the run.
How/hooks
Debug mode — kbcode records its own errors and usage, runs self-tests in the background, and fixes or reports them. /debug fix starts the self-repair turn; the hidden alias /debugfix does the same.
WhySomething in kbcode itself misbehaves and you want it diagnosed rather than guessed at.
How/debug fix
Full health check — PATH, install, KB, provider, self-tests.
WhyFirst thing to run when anything is off. It tells you which link in the chain is broken.
How/doctor
Verify this install actually works — config, model call, tool dispatch, session save/load.
WhyProves the INSTALLED build works end to end, not just that files exist.
How/runtime-check
Show or live-toggle advanced knobs (strict_tools, subagent_verbose, image_input_mode).
WhyTune behaviour without editing settings.json by hand; changes persist.
How/config strict_tools on
Show or change everyday settings — compact trigger, resume budget, notebook location.
WhyThe knobs most people actually want; /config has the full list.
How/settings
List the KBCODE_* environment variables that are set, with secret values masked.
WhyAn env var silently overrides settings.json at startup — this shows which ones are in play.
How/env
List connected MCP servers and their tools; reload re-reads settings.json and reconnects.
WhyYou added an MCP server and want its tools available without restarting.
How/mcp reload
List loaded plugin tools (.kbcode/tools/*.py) and any load failures.
WhyYour custom tool is not showing up — this says whether it failed to load and why.
How/plugins
Show the one bridge port every Chrome profile uses.
WhyBrowser automation diagnostics — every profile multiplexes over a single port.
How/port
Browser health check — bridge, extension connection and setup, green/red per check.
WhyA browser_* tool just failed and you want to know which link is broken before retrying.
How/browser-test
Browser session snapshots — save or restore the connected Chrome profile's tabs and cookies (encrypted, local only).
WhyFreeze a working browser state before a risky automation run. Note: /sessions (plural) is chat history, this is browser state.
How/session save before-checkout
One-shot structured answer — a single tool-less call whose output is valid JSON.
WhyYou are piping kbcode's answer into another program and need it parseable.
How/json list the top 3 slowest tests
Send the kbcode team a message, scrubbed of secrets and paths.
WhyReport a bug or ask for a feature. on/off toggles automatic debug-mode reports.
How/feedback the /diff output truncates long files
Sign in with Google to activate kbcode.
WhySame as `kb login`, without leaving the chat.
How/login
Sign out and forget the stored sign-in.
WhyShared machine, or switching to a different approved account.
How/logout
Run the curated smoke-tier tests (tests/smoke/) — middle ground between a focused test and the full suite.
WhyYou want a fast health check across key paths before committing, without burning 10+ minutes on the full pytest run.
How/smoke
Scan code touched in the last 30 days for symbols with zero references (dead code, unwired helpers).
WhyYou shipped a feature and want to know what landed but is never called — the kind of code that rots and confuses the next reader.
How/dev-audit kbcode
Give it more than text — screenshots, video, transcripts.
Capsule menu — back up and restore your kbcode knowledge and memory.
WhyMoving to a new machine, or protecting the notes and memory a project has accumulated.
How/capsule
Back up the capsule now (alias pair: /capsule-restore puts it back).
WhyOne-shot backup before a risky change, without going through the menu.
How/capsule-backup
Attach an image — clipboard or a file — to your next message (alias: /img, also Alt+V).
WhyPaste a screenshot of an error, a design, or a broken UI instead of describing it in words.
How/image screenshot.png
Describe a local video via an auxiliary vision model.
WhyA screen recording of a bug shows what a paragraph cannot.
How/video repro.mp4 what fails at the end?
Fetch a YouTube video's transcript — no API key needed.
WhyPull the content of a talk or tutorial into the chat as text instead of watching it.
How/transcribe https://youtu.be/xyz en
Everything you type before the chat starts, plus the headless one-shot forms.
Start chatting about the current folder.
WhyThe normal way in. Reads AGENT.md and kb/ so it already knows the project.
Howkb
Run one task, print the answer, exit.
WhyScripts and quick questions. Exit code says what happened: 0 done, 1 incomplete, 2 usage error, 130 interrupted.
Howkb "what changed in the last commit?"
Same, but auto-approve every edit and command.
WhyRequired for CI and any headless run — without it the permission prompt has nobody to answer it and every tool call is denied.
Howkb -y "fix the failing tests"
Reopen the last chat for this folder.
WhyContinue where you left off with the context intact.
Howkb -c
Pick an older chat from a list and reopen it.
WhyGo back to a specific past session rather than the most recent one.
Howkb --resume
One machine-readable JSON answer.
WhyFeeding kbcode's output into another tool or a pipeline step.
Howkb --json "list the failing tests"
Work on another project without cd.
WhyDrive a second repo from where you already are, e.g. from a script.
Howkb -C "C:\dev\api" "run the tests"
Set a folder up — AGENT.md + kb/.
WhyOne-time per project. Do this before the first real task.
Howkb init
Provider, key and model wizard.
WhyFirst-run setup, or whenever you change provider. Saves globally so every project inherits it.
Howkb model
Google sign-in (also logout, whoami).
WhyAccess is owner-approved per account; whoami tells you where you stand.
Howkb login
Health check — PATH, install, config, provider.
WhyAnything broken, start here. It names the failing link instead of a generic error.
Howkb doctor
Install the Chrome extension (also doctor, fix).
WhyOne-time setup for browser automation. `kb extension doctor` reports per profile whether Chrome loaded it and the bridge is live.
Howkb extension doctor
Download and swap in the newest kb.exe.
WhySignature- and SHA-verified. --version and doctor deliberately do NOT auto-update, so run this explicitly.
Howkb update
Add or remove MCP tool servers (also mcp-remove).
WhyBring an external MCP server's tools in as ordinary kbcode tools.
Howkb mcp-add filesystem -- npx -y @modelcontextprotocol/server-filesystem .
Remove kbcode and its data.
WhyClean removal, including the machine-bound key store.
Howkb uninstall
Repair "'kb' is not recognized".
WhyPATH did not take. This fixes the user PATH entry without admin rights.
Howpython -m kbcode fixpath
Pipe anything in as context.
Whystdin becomes context (capped, secrets redacted) — review a diff, a log, or a failing test dump.
Howgit diff origin/main... | kb "review this"