Slash Commands

July 25, 2026 · View on GitHub

All slash commands are available from the TUI input prompt.

Session

CommandDescription
/clearClear the current session (all messages, tokens, compactions).
/newAlias for /clear.
/undoRemove the last exchange (user message + assistant response).
/redoRestore whatever the most recent /undo or /rewind removed.
/rewindOpen a picker to jump the session back to an earlier point.
/retryLoad the last user message into the input editor for editing.
/quitExit zerostack.
/exitAlias for /quit.
/sessionsList recent saved sessions (up to 20).
/sessions <id-or-name>Load a session by its ID prefix or name.
/sessions delete <id-or-name>Delete a session by its ID prefix or name.
/rename <name>Rename the current session.
/historyShow global chat history (last 10 entries across sessions).
/export [file]Export the current session to a standalone HTML page (default zerostack-session-<id>.html), or to JSONL when the file ends in .jsonl. Requires the export feature (default-on).
/import <file>Import a session from a JSONL export (or a native session JSON file), save it, and load it. Requires the export feature.
/shareUpload the HTML export as a secret GitHub gist and print the URL. Requires GITHUB_TOKEN or GH_TOKEN and the export feature.
/queueList input queued while the agent is busy (same as /queue ls).
/queue clearEmpty the queue.
/queue popRemove the last queued input.
/welcomeShow the welcome/onboarding screen.
/tutorialAlias for /welcome.

Provider & Model

CommandDescription
/providerShow the current provider.
/provider <name>Switch to a different provider.
/modelShow the current model.
/model <name>Switch to a different model.
/modelsList all quick models defined in config.
/models <name>Switch to a named quick model.
/models-add <name> <provider> <model>Save a new quick model to the config file.

Context Files

CommandDescription
/addList files currently added to context (with sizes).
/add <path>Add a file to the agent's context (absolute or relative path).
/drop <path>Remove a file from the agent's context.
/drop-allRemove all added files from the agent's context.

Files added with /add are included alongside the conversation in each request, useful for giving the agent reference documentation or code without cluttering the chat directly.

Initialization

CommandDescription
/initCreate an AGENTS.md file for the current project by delegating to the agent.
/init forceOverwrite the existing AGENTS.md if one already exists.

Requires a code prompt to be configured (run /regen-prompts to restore built-in prompts, or create a custom code.md prompt).

Security

CommandDescription
/modeShow the current security mode.
/mode standardAllow path tools within CWD, ask for external paths. Config rules apply.
/mode restrictiveAsk for every operation. Config rules skipped.
/mode readonlyAllow reads only; deny writes, edits, bash, and everything else.
/mode guardedAllow reads; ask for writes, edits, bash, and everything else. Config rules apply.
/mode yoloAllow everything; ask for destructive bash commands. Config rules apply.

Prompts can set the security mode automatically via %%mode=<mode> on the first line. When a prompt with %%mode=last_user_mode is activated, the mode reverts to whatever was last set explicitly by /mode or startup config. See Prompts & Themes below.

Hooks

Requires the hooks feature (default-off; see CONFIG.md).

CommandDescription
/hooksShow whether a hook dispatcher is installed and, if so, each configured event with its handler count.

Run zerostack --hooks-test <tool> [--hooks-test-input <json>] from the shell (not a slash command) to dry-run PreToolUse hooks for a tool without starting a session or making a model call. See CONFIG.md for the full hooks configuration reference.

Prompts & Themes

CommandDescription
/promptList available prompts.
/prompt <name>Activate a named prompt. Also applies %%mode= from the prompt file if present (see below).
/prompt defaultClear the active prompt.

Prompts may include a %%mode=<mode> directive on the first line to automatically switch the security mode when activated. Valid modes: standard, restrictive, readonly, guarded, yolo. Use %%mode=last_user_mode to restore the mode the user last set via /mode or startup config. The directive line is stripped from the prompt content before it reaches the agent.

Example ask.md:

%%mode=readonly

## Read-Only Mode

You are in read-only mode. Only read files and explore.

| /theme | List available themes. | | /theme <name> | Activate a named theme. | | /theme default | Clear the active theme (use config colors). | | /regen-prompts | Restore built-in prompts to the prompts directory. | | /regen-themes | Restore built-in themes to the themes directory. |

Conversation

CommandDescription
/compress [instructions]Compress conversation history to free context window space.
/compactAlias for /compress.
/editsysShow the current edit system mode (similarity or hashedit).
/editsys similarityUse SEARCH/REPLACE with fuzzy matching for edits (default).
/editsys hasheditUse CRC-32 tag-based edits (token-efficient, CAS-guarded).
/btw <message>Ask a quick side question in parallel, without touching the main conversation. It forks the current context (including the main agent's in-flight turn, if any), answers using read-only tools (read/grep/find_files/list_dir, no writes or bash), and prints the answer inline. Works even while the main agent is running. Nothing is written to history; its token cost is shown separately as btw:$…. Ctrl-C cancels an in-flight /btw without disturbing the main agent.
/reasoningToggle LLM reasoning on/off (requires model support).
/thinkingAlias for /reasoning.
/review [msg]Run a one-shot code review. Activates the review prompt in readonly mode, submits a review message, and restores the previous prompt afterward. Without a message, auto-generates one based on session and worktree context.
/toggleShow available toggleable features.
/toggle todo [on|off]Enable or disable todo-list tools.

Memory (feature-gated)

Requires building with --features memory.

CommandDescription
/memoryShow memory status (MEMORY.md, scratchpad, daily log).
/memory statusSame as /memory (explicit status check).
/memory search <query>Search all memory files with case-insensitive keyword matching.
/memory read long_termRead the global MEMORY.md file.
/memory read scratchpadRead the project scratchpad (open checklist items).
/memory read daily [date]Read a daily log (defaults to today; use YYYY-MM-DD for past).
/memory read note <name>Read a named note.
/memory write long_term <content>Append to the global MEMORY.md.
/memory write scratchpad <content>Append to the project scratchpad.
/memory write daily <content>Append to today's daily log.
/memory write note:<name> <content>Append to a named note.
/memory editorOpen MEMORY.md in your system $EDITOR.
/memory clear scratchpadClear all scratchpad items.
/memory clear dailyClear all of today's entries.

Long-term memory (MEMORY.md) and open scratchpad items are automatically injected into every request. Daily logs (today + yesterday) are also included. Notes and older daily logs are accessible via /memory read and memory_search.

MCP (feature-gated)

CommandDescription
/mcpList connected MCP servers and their tool counts.
/mcp <server>List tools of a specific MCP server.
/mcp login <server>Run the OAuth 2.0 login flow for a URL server, then reconnect it.
/mcp logout <server>Remove a server's stored OAuth token.

Advisor (feature-gated)

CommandDescription
/advisorShow current advisor status (enabled, mode, model, max uses).
/advisor onEnable the advisor tool.
/advisor offDisable the advisor tool.
/advisor handoffToggle human handoff mode on.
/advisor handoff onEnable human handoff mode (route calls to the user).
/advisor handoff offDisable human handoff mode (use advisor model).
/advisor model <name>Change the advisor model.
/advisor max-uses <n>Set max advisor calls per request (0 = unlimited).
/advisor context-limit <n>Set max kilobytes of conversation context sent to advisor.

Subagents (feature-gated)

Requires the subagents feature (default-on; see SUBAGENTS.md).

CommandDescription
/model-subagentShow the model currently used for subagents.
/model-subagent <name>Switch the subagent model.
/models-subagentList quick models available for subagents.
/models-subagent <name>Switch subagents to a named quick model.

Worktree (feature-gated)

CommandDescription
/worktree <name>Create a git worktree on a new branch and cd into it.
/wt-merge [branch]Merge the worktree branch back into the target branch.
/wt-exitExit the worktree and return to the main repo.

Loop (feature-gated)

CommandDescription
/loop [prompt]Start the iterative coding loop.
/loop stopStop the active loop.
/loop statusShow current loop status.

Shell Commands

Prefix a message with ! to run it as a shell command instead of sending it to the agent. The command's output is captured and stored in the session history as an Assistant message. Works in both TUI and --print mode.

ExampleDescription
!ls -laList files in the current directory.
!git statusCheck git status without involving the agent.
!cargo testRun tests and capture the output.
!Empty command shows an error.

If you want to run a command and then discuss the output with the agent, just type !<command> first (it stores the output as an Assistant message), then follow up with a normal message asking the agent about it.

Prompt Shortcut

Prefix a message with . to quickly switch prompts or run a one-shot query with a different prompt.

ExampleDescription
.Open the prompt picker (same as /prompt picker).
.askSwitch to the ask prompt (same as /prompt ask).
.plan what files changed?Temporarily use the plan prompt for this query, then restore the previous prompt and security mode.

The .[prompt] [msg] syntax is a one-shot: it sets the prompt, submits the message, and after the response restores the previous prompt and last_user_mode.

General

CommandDescription
/helpShow the full help message listing all commands and keybindings.

Keybindings

ShortcutAction
EnterSend message.
Shift+EnterInsert newline.
Ctrl+CCancel current agent response or quit.
Ctrl+DSend message (alternative).
Ctrl+WDelete word backwards.
Ctrl+UDelete to beginning of line.
Ctrl+LClear terminal.
Ctrl+GOpen the current input in the system editor ($EDITOR).
Ctrl+HLaunch lazygit (git TUI) in the project directory.
Ctrl+SSave session.
TabActivate file picker / auto-complete paths.
Up / DownNavigate command history.
PageUp / PageDownScroll viewport.
Home / EndJump to start/end of input.
Alt+EnterRetry last prompt.
EscapeClose active picker / cancel.