# Slash commands

> Interactive / commands for sessions, models, memory, hooks, plugins, themes, and more; pager vs shell builtins; skill-provided commands in the autocomplete menu.

- Repository: xai-org/grok-build
- GitHub: https://github.com/xai-org/grok-build
- Human docs: https://grok-wiki.com/public/docs/xai-org-grok-build-90205de50458
- Complete Markdown: https://grok-wiki.com/public/docs/xai-org-grok-build-90205de50458/llms-full.txt

## Source Files

- `crates/codegen/xai-grok-pager/docs/user-guide/04-slash-commands.md`
- `crates/codegen/xai-grok-pager/src/slash/commands/mod.rs`
- `crates/codegen/xai-grok-shell/src/session/commands.rs`
- `crates/codegen/xai-grok-pager/src/app/dispatch/router.rs`
- `crates/codegen/xai-grok-pager/docs/user-guide/08-skills.md`

---

---
title: "Slash commands"
description: "Interactive / commands for sessions, models, memory, hooks, plugins, themes, and more; pager vs shell builtins; skill-provided commands in the autocomplete menu."
---

Typing `/` in the interactive prompt opens a fuzzy-complete command menu. Grok Build merges **pager builtins** (TUI-local actions in `xai-grok-pager`), **shell builtins** (session/agent actions advertised by `xai-grok-shell` over ACP), and **user-invocable skills** (from `SKILL.md` packages and plugins) into one registry. Execution is synchronous at the pager edge: a command returns a `CommandResult` (local action, queue entry, skill injection, or pass-through to the shell), and the dispatch layer applies the effect.

## How invocation works

1. You type `/` (optionally followed by a name and args).
2. `SlashController` parses the token, ranks triggers with fuzzy matching, and shows up to six visible suggestion rows (with scroll for longer lists).
3. `Tab` or `Enter` accepts a row. Commands that take args insert a trailing space so argument completion can open next (for example `/model` → model list → effort levels).
4. On submit, the pager looks up the command in `CommandRegistry` and runs it. Unknown or shell-owned names are sent as prompt text so the agent can resolve them.

```
/model grok-build
/compact keep the auth implementation details
/commit fix typo in README
```

### Argument completeness

| `takes_args` | `args_required` | Example | Enter with no args |
| --- | --- | --- | --- |
| `false` | `false` | `/quit` | Runs immediately |
| `true` | `false` | `/compact [context]` | Runs with empty args |
| `true` | `true` | `/model <name>` | Blocks until args are present |

Argument placeholders (for example `compaction instructions` on `/compact`) appear in the prompt and autocomplete menu.

## Two handlers: pager vs shell

| Source | Owner | Typical work | How the menu learns about it |
| --- | --- | --- | --- |
| **Pager builtins** | `xai-grok-pager` | UI, theme, screen mode, resume picker, modals, local toggles | Built into `builtin_commands()` at startup |
| **Shell builtins** | `xai-grok-shell` | Compact, memory flush/dream, goal, hooks/plugins CLI, feedback | ACP `AvailableCommandsUpdate` → `CommandRegistry::set_acp_commands` |
| **Skills** | Disk / plugins | Inject structured skill prompts into the turn | Shell advertises user-invocable enabled skills; pager can inject via `InjectSkill` |

Some names exist on **both** sides with different UX. Example: the shell advertises `/hooks-list`, `/hooks-trust`, `/hooks-add`, `/hooks-remove`, `/hooks-untrust`, and `/plugins` subcommands; the TUI consolidates those into the `/hooks`, `/plugins`, `/marketplace`, and `/skills` **extensions modal** tabs. Prefer the modal in interactive sessions; shell subcommands remain useful for headless or ACP clients.

**Precedence:** pager/shell built-in names always win over a skill with the same bare name. Use a qualified skill name when you need the skill instead (see [Skills as slash commands](#skills-as-slash-commands)).

### Execution outcomes

| Result | Meaning |
| --- | --- |
| `Action(...)` | Dispatch a pager action (`SetDefaultModel`, open modal, quit, …) |
| `QueueCommand(...)` | Enqueue work on the session command pipeline (for example `/compact`) |
| `InjectSkill { ... }` | Load skill (or skill-like) prompt blocks for the model |
| `PassThrough(...)` | Send text as a normal prompt; shell resolves ACP or unknown commands |
| `Message` / `Error` | Show user-visible text without starting a turn |
| `Handled` / `HandledNoOp` | Success or no-op with no extra scrollback |

## Autocomplete menu

The dropdown shows, per row:

- Command name (with leading `/`)
- Description
- Argument hint when applicable
- Source context for skills (scope or plugin), via ACP metadata when present

Behavior details:

- **Fuzzy filter** as you type after `/`.
- **Inline ghost completion** for a smart prefix match against the selected row.
- **MRU-aware ranking** for recently used commands.
- **Tool gating:** commands that declare `required_tools()` (for example `/loop` needing `scheduler_create`) stay hidden until the shell advertises those tools in `AvailableCommandsUpdate` meta (`{"tools": [...]}`). Before any toolset is known, tool-dependent commands are fail-closed (hidden).
- **Capability gates (shell):** memory, scheduler, hooks, plugins, feedback, and goal builtins only advertise when `CommandAvailability` allows them.
- **Restricted / tier-hidden** names can be denied even if typed; separate from menu-only hide lists.
- **Session-scoped vs dashboard:** session-only commands (`/compact`, `/fork`, …) are suppressed on the agent dashboard dispatch input unless marked `offered_when_session_less` (for example `/model`, `/plan`). `/cd` is dashboard-only.

## Session management

| Command | Aliases | Purpose |
| --- | --- | --- |
| `/new` | `/clear` | Start a fresh session |
| `/resume` | — | Open the session picker |
| `/compact [context]` | — | Compress history; optional focus text |
| `/context` | — | Context-window breakdown and costs |
| `/session-info` | shell: `/status`, `/info` | Model, turns, usage snapshot |
| `/fork` | — | Branch session history into a new agent |
| `/rewind` | — | Rewind to an earlier turn |
| `/copy [n]` | — | Copy latest (or Nth-latest) response |
| `/export` | — | Export conversation to file or clipboard |
| `/transcript` | — | Open transcript views |
| `/rename <title>` | `/title` | Rename the session |
| `/home` | `/welcome` | Return to the welcome screen |
| `/quit` | `/exit` | Quit the app |
| `/share` | — | Share-session flows |
| `/queue` | — | Inspect the prompt queue |
| `/tasks` | — | Background / scheduled tasks pane |

Auto-compaction also runs when the context window hits the threshold (default **85%**, `[session] auto_compact_threshold_percent` in `config.toml`).

## Model, permissions, and UI mode

| Command | Aliases | Purpose |
| --- | --- | --- |
| `/model <name> [effort]` | `/m` | Switch model; optional effort for reasoning models |
| `/effort <level>` | — | Set effort on the **current** model: `low`, `medium`, `high`, `xhigh` |
| `/always-approve` | shell: `/yolo` | Toggle skip-all permission prompts |
| `/auto` | — | Toggle classifier-based auto-approve (feature-gated; fail-closed until enabled) |
| `/multiline` | `/ml` | Toggle multiline composer (`Enter` = newline) |
| `/history` | — | Fuzzy search this session’s prompts |
| `/compact-mode` | — | Denser visual spacing |
| `/vim-mode` | — | Vim scrollback bindings; persists to `[ui].vim_mode` |
| `/minimal` / `/fullscreen` | `/full` | Sticky screen-mode switch (`[ui].screen_mode`) |
| `/plan [description]` | — | Enter plan mode |
| `/view-plan` | `/show-plan`, `/plan-view` | Preview the saved plan |
| `/theme` | `/t` | Theme picker |
| `/settings` | `/config`, `/preferences`, `/prefs` | Settings modal |
| `/timestamps` | — | Toggle message timestamps |
| `/terminal-setup` | `/terminal-check`, `/terminal-info` | Capability detection and fix hints |

Permission mode tips:

- `/always-approve` and `/auto` are **toggles**: run the active mode again to return to ask.
- Switching with the other command while one is on **changes** modes rather than stacking them.
- `Shift+Tab` (cycle), `Ctrl+O`, and `/settings` also change permission mode.

## Memory

Requires experimental memory (`--experimental-memory` or `GROK_MEMORY=1`) for `/flush`, `/dream`, and `/memory`. `/remember` is always available in the pager.

| Command | Aliases | Purpose |
| --- | --- | --- |
| `/memory [on\|off]` | `/mem` | Browse/manage memories; enable or disable |
| `/flush` | — | LLM summary of important session content → memory |
| `/dream` | — | Consolidate session logs into topics |
| `/remember <note>` | — | Save a note immediately |

Use `/flush` before compaction or when you want durable decisions/patterns captured for later retrieval.

## Hooks, plugins, marketplace, skills UI

| Command | Opens |
| --- | --- |
| `/hooks` | Extensions modal → Hooks |
| `/plugins` | Extensions modal → Plugins |
| `/marketplace` | Extensions modal → Marketplace |
| `/skills` | Extensions modal → Skills |
| `/mcps` | MCP servers modal |

Shell-side `/plugins list|reload|trust|add|remove|install|uninstall|update` and `/reload-plugins` still exist for non-modal clients. Project hook trust is **not** granted merely by opening the modal; see the hooks docs for the trust model.

## Media, scheduling, and goals

| Command | Purpose |
| --- | --- |
| `/imagine <description>` | Text-to-image |
| `/imagine-video <description>` | Planned video generation |
| `/loop [interval] <prompt>` | Recurring prompt (`Ns`/`Nm`/`Nh`/`Nd`, minimum 60s; auto-expires after 7 days) |
| `/goal <objective\|status\|pause\|resume\|clear>` | Autonomous goal (feature + `update_goal` tool required) |

`/loop` injects a structured prompt (and can show a provisional scheduled-task preview immediately). Cancel via `scheduler_delete` with the job id returned at creation.

## Account, agents, and utilities

| Command | Aliases | Purpose |
| --- | --- | --- |
| `/login` / `/logout` | — | Re-auth or sign out without leaving the TUI |
| `/usage` | — | Credits / billing (may be tier-restricted) |
| `/privacy` | — | Privacy / data-retention status |
| `/config-agents` | `/agents` | Agent definitions modal |
| `/personas` | — | Create/edit/delete personas |
| `/btw <text>` | — | Aside to the agent without interrupting the turn |
| `/feedback [message]` | — | Send feedback |
| `/docs [web\|title]` | `/howto`, `/guides` | In-TUI guides or open Build docs |
| `/import-claude` | — | Import `~/.claude` settings into Grok |
| `/release-notes` | `/changelog` | Current version notes |
| `/recap` | — | Session recap (visibility may be gated) |
| `/voice` | — | Voice mode (fail-closed until runtime enables it) |
| `/cd` | — | Dashboard: change dispatch working directory |
| `/help` | — | Help surface |

Debug-oriented commands (for example `/debug`, `/scroll-debug`, `/gboom`) exist in the registry; some stay menu-hidden until unlocked.

## Skills as slash commands

Any **enabled**, **user-invocable** skill appears as `/<skill-name>`:

```
/commit fix the build
/review-pr
```

Rules that matter in practice:

- Frontmatter `user-invocable: false` hides the skill from slash autocomplete (model may still invoke it unless `disable-model-invocation: true`).
- Flat `*.md` under `commands/` directories become slash commands (stem = name), matching legacy Claude Code layout.
- Name collisions advertise **qualified** forms: `/local:commit`, `/user:commit`, or `/plugin-name:commit`.
- Built-ins always take the bare name (`/compact` never becomes a skill unless you use a qualified skill path).
- Skill discovery does **not** honor `.gitignore` under skill roots; use `[skills] ignore` / `disabled` in config to hide entries.
- Sources stay **provider-neutral**: skills load from portable filesystem trees (`.grok`, `.agents`, `.claude`, `.cursor`, plugin roots, and `[skills].paths`), not from a single model vendor.

Invoking a skill loads its instructions into the turn (`InjectSkill` with skill display styling for real skills). Automatic model invocation still uses `description` / `when-to-use`; slash is the explicit path.

## Minimal mode and other constraints

In scrollback-native **minimal** mode (`grok --minimal` or `/minimal`), commands that need fullscreen-only surfaces are refused (for example `/find`, `/copy`, `/dashboard`). Mode-agnostic commands remain available by default (`available_in_minimal` denylist, not allowlist).

Other hide reasons you may see missing entries for:

- Feature flags (`/auto`, `/goal`, voice, experimental memory)
- Missing tools in the advertised toolset
- Account tier restrictions
- No active session (session-scoped commands)
- Dashboard vs agent surface filtering

## Practical recipes

**Start clean, keep history elsewhere**

```
/export
/new
```

**Switch model mid-session with effort**

```
/model Reasoning X high
# or keep model, only change effort:
/effort medium
```

**Preserve knowledge before compaction**

```
/remember staging deploy uses eu-west
/flush
/compact keep auth and deploy decisions
```

**Run a project skill without fighting a builtin name**

```
/local:compact
```

## Related pages

<CardGroup cols={2}>
  <Card title="Sessions" href="/sessions">
    Lifecycle, resume/fork/compact persistence, and CLI session tools.
  </Card>
  <Card title="Skills" href="/skills">
    SKILL.md layout, discovery paths, and user-invocable slash surface.
  </Card>
  <Card title="Custom models" href="/custom-models">
    `-m` / `/model`, BYOK endpoints, and model listing.
  </Card>
  <Card title="Permissions and safety" href="/permissions-and-safety">
    Allow/deny/ask, always-approve and auto modes, and tool authorization.
  </Card>
  <Card title="Project rules and memory" href="/project-rules-and-memory">
    AGENTS.md, `/flush` / `/dream`, and retrieval vs system-prompt injection.
  </Card>
  <Card title="Hooks" href="/hooks">
    Lifecycle hooks and how `/hooks` relates to project trust.
  </Card>
  <Card title="Plugins" href="/plugins">
    Marketplace install, trust, and plugin-bundled commands/skills.
  </Card>
  <Card title="Theming" href="/theming">
    `/theme`, `pager.toml` theme keys, and screen modes.
  </Card>
  <Card title="Keyboard shortcuts" href="/keyboard-shortcuts">
    Prompt/scrollback keys that complement slash commands.
  </Card>
  <Card title="Plan mode" href="/plan-mode">
    `/plan`, approval gates, and tool interaction.
  </Card>
</CardGroup>

## Next

<CardGroup cols={2}>
  <Card title="Configure Grok" href="/configure-grok">
    config.toml / pager.toml precedence and feature flags that gate commands.
  </Card>
  <Card title="CLI reference" href="/cli-reference">
    Top-level `grok` commands and flags outside the interactive slash menu.
  </Card>
</CardGroup>

{/* wiki-source-anchors
- crates/codegen/xai-grok-pager/docs/user-guide/04-slash-commands.md (full command catalog UX)
- crates/codegen/xai-grok-pager/src/slash/commands/mod.rs (builtin_commands registry order)
- crates/codegen/xai-grok-pager/src/slash/command.rs (CommandResult, completeness, session/minimal gates)
- crates/codegen/xai-grok-pager/src/slash/registry.rs (Builtin vs Acp, tool/tier visibility)
- crates/codegen/xai-grok-pager/src/slash/mod.rs (SlashController, fuzzy menu)
- crates/codegen/xai-grok-shell/src/session/slash_commands.rs (shell BUILTIN_COMMANDS, gates, skills)
- crates/codegen/xai-grok-pager/docs/user-guide/08-skills.md (skill slash surface and qualified names)
- crates/codegen/xai-grok-pager/src/app/dispatch/router.rs (action dispatch surface for command effects)
*/}
