grok-build-upstream-mirror/crates/codegen/xai-grok-pager/docs/user-guide/04-slash-commands.md
grokkybara[bot] a5727c5960 Synced from monorepo
Changes:
- Non-blocking coding-data sharing upsell banner
- Consolidate remediation in Doctor
- Auto mode defers fail-closed gate asks to the classifier
- Coalesce marketplace list fetches
- Allow removing a marketplace source by name
- Contain hung git marketplace sources (timeouts, non-blocking refresh, unbrick modal)
- Label failed workspace RPCs with error_kind
- Drop redundant explicit tonic/prost deps from xai-grok-shell
- Report real exit codes for completed background shells
- Narrow the date-rollover reminder to date-bearing templates
- Wire toolOverrides through the session and agent
- Security: Bash(git:*) allowlist matches whole command chain by prefix
- Split prompt-trigger telemetry and record classifier provenance
- Raise connectors-manager timeout to 60s
- Auto classifier honors recorded approvals for repeat actions
- Apply doctor fixes in the TUI
- Auto-mode classifier timeouts prompt instead of silently denying
- Scope subagent completion drains to the owning session
- Add the toolOverrides wire types
- Set client_identifier=grok-agent-sdk
- Accept both spellings of the workspace-teleport kill switch
- Persist one-shot occurrence journal
- Stop turns that poll the exact same tool call 16x in a row
- Copy compaction checkpoint files when forking sessions
- Auto-focus permission prompt from scrollback
- Esc cancels the running turn in non-vim and minimal modes
- List Ctrl+Z undo and redo in keyboard shortcuts
- Out-of-process macOS mic capture
- Show active auth mode on session-info
- Install the npm binary under $GROK_HOME
- Remove hover/click dead zones between dashboard items
- Route startup warnings to doctor
- Document [feedback.user] author identity config
- Extend bang command timeout
- Close combine-queued edit-hold race
- Integrate relocation recovery
- Expose privacy notice rollout flag
- Break harness discovery ref cycle so connections can idle-evict
- Shift/Alt+Enter inserts newline when editing a queued prompt
- Gate project Claude permissions on folder trust
- Echo response.create.event_id on response.created
- Toast when session creation fails from disk full
- Add shared test process lifecycle
- Enable dynamic workflows by default
- Add relocation transaction state machine
- Add shared test sandbox
- Surface auth failures on model-switch compact
- Persist durable scheduler expiry
- Confirm before removing extensions-modal items
- Re-run compact and prompt after login when compact hit expired auth
- Recap sends hosted tools under backend search
2026-07-22 19:22:27 +01:00

17 KiB
Raw Blame History

Slash Commands

Type / in the prompt to open the command menu. It fuzzy-matches as you type, and picking a command runs it immediately.

Commands come from two places: shell builtins, handled by the agent backend (xai-grok-shell), and pager builtins, handled by the TUI frontend (xai-grok-pager). Both show up in the same menu, and any enabled skill with user-invocable: true appears there too.

Every command below lists its aliases where it has them. A few commands only appear when a feature or session state enables them; those cases are called out inline.


Session Management

/new

Start a fresh session and clear the current conversation. Alias: /clear.

/resume

Open the session picker to reload a previous session from disk.

/compact [context]

Compress conversation history to reclaim context-window space. Pass a note to tell Grok what to keep:

/compact
/compact keep the auth implementation details

Grok also auto-compacts once the context window hits 85% (tune it with [session] auto_compact_threshold_percent).

/context

Show how the context window is being used: a category breakdown (system prompt, messages, reasoning and overhead, free space) plus informational rows for tool definitions, the skills listing, and MCP server announcements with their estimated token cost.

/session-info

Show session details — auth method, model, turn count, and context usage. Aliases: /status, /info.

/fork

Branch the current session into a new agent, keeping history up to this point.

/rewind

Roll the conversation back to an earlier turn and discard everything after it.

/edit-prompt

In minimal mode, open an external editor for an empty composer. Grok resolves $VISUAL, then $EDITOR, then vi; command values may include quoted arguments. Saving replaces the draft without sending it, and saving an empty file clears it. The command is hidden outside minimal mode.

/edit-prompt

To edit an existing draft when a terminal or multiplexer reserves Ctrl+G, open the command palette and select Edit Prompt in External Editor. That direct route preserves the existing text and refuses pasted, file-reference, or image chips without flattening them. Typing /edit-prompt into the composer necessarily replaces that input, so it starts from an empty draft.

/copy

Copy the most recent response to the clipboard. Pass a number to copy the Nth-latest response instead, or a file path to write the text to a file rather than the clipboard (handy over SSH, where the local clipboard is often unreachable).

/copy
/copy 2
/copy out.txt
/copy 2 ~/exports/last-reply.md

Every copy is also written to a backup file — ~/.grok/last-copy.txt by default, or GROK_COPY_FILE if set — and the toast tells you exactly where the text landed, so you can retrieve it even when the clipboard couldn't be reached or the copy went out as an OSC 52 escape this terminal couldn't confirm.

/export

Export the conversation to a file or the clipboard.

/quit

Quit the application. Alias: /exit.

/home

Leave the current session and return to the welcome screen. Alias: /welcome.

/rename

Rename the current session. Alias: /title.

/rename new session title

Model and Mode

/model <name>

Switch models. Accepts a model ID or display name (case-insensitive), and for reasoning models you can add an effort level as a second argument. Alias: /m.

/model grok-build
/model Grok Build
/model Reasoning X high

/effort <level>

Set reasoning effort on the current model without reselecting it. Levels are low, medium, high, and xhigh, and it only applies when the active model supports reasoning effort.

/effort high

/always-approve and /auto

Both are real toggles for the permission mode: they stay in the menu, and running the mode you're already in turns it back off.

Command When off When already on
/always-approve Skip all permission prompts Back to ask
/auto Classifier approves safe tools (dangerous ones may still prompt) Back to ask

Running one while the other is active switches modes — for example, /auto while always-approve is on switches to auto. /auto only appears when the auto permission-mode feature is enabled. You can also change mode with Shift+Tab (cycles Normal / Plan / Always-approve), Ctrl+O, or /settings.

/multiline

Toggle multiline input. When it's on, Enter inserts a newline and Shift+Enter (or Alt+Enter) sends the message. Mid-turn, a bare Enter on an empty composer still force-sends the top queued follow-up. Alias: /ml.

/history

Open prompt-history search: fuzzy-search this session's prompts newest-first, then press Enter or Tab to drop a match back into the prompt.

For quick recall, press on an empty prompt instead. The panel opens with your most recent prompt already filled in; / step through entries (each lands in the input), past the newest entry closes the panel, and typing edits the recalled prompt in place.

/compact-mode

Toggle compact display — less padding and tighter spacing for denser output.

/vim-mode

Toggle vim-style scrollback keys (j/k, h/l, g/G, y/Y, and so on). With it off (the default), a bare letter or Shift+letter in the scrollback just focuses the prompt and types the character. The setting persists to [ui] vim_mode.

/minimal and /fullscreen

Reopen the current session in the other render mode. /minimal (offered while you're in fullscreen) switches to the experimental scrollback-native mode; /fullscreen (offered while you're in minimal; alias /full) switches back to the standard alt-screen TUI. Both relaunch the pager on the same conversation for this session only — they don't touch config.toml, and the relaunch banner reminds you how to switch back. The --minimal / --fullscreen CLI flags are session-scoped the same way. To make plain grok open in a given mode by default, use /settingsDefault screen mode or set [ui] screen_mode.

/plan

Enter plan mode.

/plan [description]

/view-plan

Open a preview of the current saved plan. Aliases: /show-plan, /plan-view.


Memory

/flush, /dream, and /memory require memory to be enabled (--experimental-memory or GROK_MEMORY=1); /memory also needs a configured memory backend. /remember is always available.

/memory

Browse, view, and manage saved memories. Pass on or off to enable or disable memory. Alias: /mem.

/memory
/memory off

/flush

Save the current session's knowledge to memory right now, triggering an LLM summary of the most important content. Reach for it before compaction, or any time you want to lock in context.

/dream

Run memory consolidation — merge session logs into organized topics.

/remember

Save a note to memory immediately, without waiting for an automatic summary.

/remember the staging deploy uses the eu-west cluster

Hooks and Plugins

/hooks, /plugins, /marketplace, and /skills all open the same extensions modal, each on its own tab.

/hooks

Open the extensions modal on the Hooks tab, where you can view loaded hooks, add or remove custom ones, and toggle them individually. The modal does not grant project trust — see 10-hooks.md for the trust model.

The shell also advertises individual /hooks-list, /hooks-trust, /hooks-add, /hooks-remove, and /hooks-untrust commands; in the TUI pager these are folded into the /hooks modal.

/plugins

Open the extensions modal on the Plugins tab to view installed plugins, install new ones from the marketplace, and manage trust.

The shell additionally supports subcommands (/plugins list, /plugins install <source>, /plugins uninstall <name>, /plugins update, /plugins reload). In the TUI, the modal does the same work visually.

/marketplace

Open the extensions modal on the Marketplace tab to browse and install plugins.

/skills

Open the extensions modal on the Skills tab to view installed skills.


Media Generation

/imagine <description>

Generate an image from a text description.

/imagine a golden sunset over a calm ocean with silhouetted palm trees

/imagine-video <description>

Generate a video from a text (or image) description. It plans shots, generates source images, and animates them with image_to_video.

/imagine-video a cat playing piano in a jazz club

Scheduling

/loop [interval] <prompt>

Run a prompt on a recurring interval. Give the interval as 30m, 1 hour, or every 2 days; leave it out and Grok will ask.

/loop 30m check deploy status
/loop check deploy status every hour

Intervals are Ns (seconds, minimum 60), Nm (minutes), Nh (hours), or Nd (days); anything under 60 seconds is raised to the minimum. Recurring tasks expire after 7 days, and you can cancel one with scheduler_delete using the job ID reported when the loop is created.


Workflows and Goals

/goal

Set, manage, or check an autonomous goal. Grok works across rounds and only marks the goal complete after an independent evidence review confirms the claim; if that review can't reproduce the result or has no usable evidence, the goal stays active or pauses with concrete gaps.

/goal Migrate the auth module to the new API
/goal status
/goal pause
/goal resume
/goal clear

Arguments are <objective> [--budget <tokens>], or one of status, pause, resume, clear. The --budget here is a token budget for the goal run, separate from the agent-count budgets that workflows use. /goal appears when goal mode is enabled for the session. Which driver runs it depends on background workflows: with them on, the host evaluates each model round and runs adversarial verification on completion candidates; with them off, the legacy model-facing update_goal path reports progress and triggers verification.

/deep-research <query>

Kick off a background research workflow. It plans a bounded set of questions, gathers structured claims with source evidence, cross-checks each claim on an independent verifier shard, and renders only the claims that survive, with their verified source locators. Failed shards, dropped claims, and researcher uncertainties are reported as coverage limitations, and the report is marked Partial whenever any remain.

/deep-research Compare the migration risks of PostgreSQL 17 and MySQL 9

The command returns right away — follow progress in /workflows, and the final report appears in the conversation on its own.

Model-launched workflows may set agent_budget on the workflow tool. It's an absolute cumulative cap on logical child-agent calls: every agent() call and every item in a parallel() panel spends one slot, while schema-correction retries don't. The default is 128, explicit values run 11,024, and a panel that would cross the remaining budget is rejected before any of its children launch. budget() reports the cap as total, admitted calls as spent, reserved (always zero), and remaining. Named slash launches use the default budget.

/workflow

Launch a saved workflow, or manage a running one by the session-unique display name shown in /workflows. Launch the same workflow twice and the display names are numbered (review-changes, review-changes-2); you never need the internal run IDs.

/workflow review-changes {"target":"origin/main...HEAD"}
/workflow pause review-changes
/workflow resume review-changes
/workflow stop review-changes-2
/workflow save review-changes

Project workflows live in .grok/workflows/*.rhai; user workflows live in ~/.grok/workflows/*.rhai. A same-process pause/resume continues the original immutable script, args, and agent_budget cap from committed host-call results — to iterate, edit the returned script copy and launch it as a new run.

A budget-limited run is different: it only resumes through a model/tool resume request that supplies an agent_budget above the admitted agent count. A bare /workflow resume <name> can't raise the cap, so it rejects budget-limited runs. Runs interrupted by a process restart aren't resumed at all, because external effects have no stable cross-process identity. And resume is not exactly-once: an external effect whose result wasn't committed before a same-process pause can run again.

/workflows

Open the live workflows run dashboard — active and retained runs, not a catalog of saved definitions. Each row shows the run's display name, phase, agent roster, progress, and result. Inside a run's detail view, p pauses, r resumes an ordinary pause, and x stops. Budget-limited runs can't bare-resume: r returns the shell's rejection (raise the cap with a model/tool resume that passes a higher agent_budget), while x still stops. s saves the run's script, but it's hidden for known built-ins and numbered duplicate handles — for those, choose a new unique meta.name and save the edited script explicitly.


Other

/theme

Switch the TUI color theme. Alias: /t.

/feedback [message]

Report an issue or send feedback.

/feedback Something isn't working correctly

/btw

Send an aside to the agent without interrupting the current task. In minimal mode (--minimal), the answer shows up in a dismissible panel above the prompt: Esc dismisses it, a finished answer is saved into native scrollback, and a late reply to an already-dismissed panel is dropped. The side question and its answer aren't part of the main turn.

/btw also check the error handling

/mcps

Open the MCP servers management modal.

/doctor

Check the current session for terminal, clipboard, color, input, notification, and sandbox issues. Doctor shows what it found and how to resolve each issue. Run /doctor fix to list available automatic fixes; other findings include manual steps. /terminal-setup, /terminal-check, and /terminal-info remain aliases.

/release-notes

View release notes for the current version. Alias: /changelog.

/docs

Browse the in-TUI How-to Guides, open the online Build docs, or jump straight to a guide by title. Aliases: /howto, /guides.

/docs
/docs web
/docs Getting Started
  • Bare /docs (or /docs how-to) opens the How-to Guides picker.
  • /docs web opens https://docs.x.ai/build/overview in your browser.
  • /docs <title> opens a specific guide by case-insensitive title match.

/import-claude

Open the Claude import modal to bring over ~/.claude settings: permissions, environment variables, MCP servers, hooks, and paths.


Agents and Personas

/config-agents

Open the agents modal to view and manage agent definitions, set the default, and switch the active one. Alias: /agents.

/personas

Create, edit, and delete personas. A subagent can apply a persona to shape how it behaves.


Account and Billing

/login

Log in or re-authenticate without leaving the session.

/logout

Log out and return to the login screen.

/usage

View credit usage or manage billing. Alias: /cost.

/usage
/usage manage

/privacy

Show or toggle privacy and data-retention status.

/privacy
/privacy opt-in
/privacy opt-out

/privacy doesn't touch [features] telemetry, trace_upload, or your external OTEL settings — see Monitoring Usage. On team accounts, only a team admin can toggle privacy this way, and admins can also enable or disable Zero Data Retention for the team (how to enable ZDR).


Configuration and UI

/settings

Open the settings modal to view and change configuration interactively. Aliases: /config, /preferences, /prefs.

/timestamps

Toggle message timestamps on or off.


Skills as Slash Commands

Any enabled skill with user-invocable: true in its SKILL.md frontmatter shows up as a slash command. (Turn a skill off via /skills and it stops being advertised.) So a skill at ~/.grok/skills/commit/SKILL.md runs as:

/commit fix typo in README

Skills from plugins work the same way. When two skills share a name across scopes, qualify it:

/local:commit      # Project-scoped skill
/user:commit       # User-scoped skill

Built-in commands always win over a skill with the same name. Name a skill "compact" and /compact still runs the built-in — but /local:compact invokes the skill.


Autocomplete

The menu supports fuzzy search: start typing after / to filter. Each entry shows the command name, its description, an argument hint when it takes arguments, and its source (builtin, skill scope, or plugin name). Press Tab or Enter to accept the highlighted command.