---
title: "CLI slash commands"
description: "Every slash command in the Hoplite CLI, from models and retries to pull requests and thread actions."
canonical_url: "https://hoplite.sh/docs/cli/commands"
markdown_url: "https://hoplite.sh/docs/cli/commands.md"
---

# CLI slash commands
URL: /docs/cli/commands
LLM index: /llms.txt
Description: Every slash command in the Hoplite CLI, from models and retries to pull requests and thread actions.
Related: /docs/cli/interactive, /docs/agent/slash-commands, /docs/github, /docs/threads/manage

# CLI slash commands

Type `/` in an interactive session to open the command menu, or `/help` to list every command. Commands act on the current [thread](/docs/threads); you don't need to phrase them as a request to the agent. Commands that act on a thread need one: send a prompt or `/resume` a thread first.

## Command reference

### Threads and sessions

| Command | What it does |
| --- | --- |
| `/new` | Start a new Hoplite thread |
| `/clear` | Clear the screen and start a new thread |
| `/resume` | Pick a recent thread to resume (**Tab** switches between **Mine** and **Team**) |
| `/project` | Switch to another project, grouped by organization, then continue one of its threads or start a new one. The choice is remembered for this checkout. Alias: `/org` |
| `/rename TITLE` | Rename the current thread |
| `/note`, `/note TEXT`, `/note clear` | Show, set, or remove the thread's note on this device |
| `/model`, `/model MODEL` | Pick the thread's model, or switch to the one you name |
| `/reasoning`, `/reasoning LEVEL` | Pick the model's reasoning level, or set it. Alias: `/effort` |
| `/fast` | Turn the fast (priority) speed on or off |
| `/retry` | Retry the last failed run |
| `/retry hoplite` | Retry on Hoplite credits, when a linked subscription hit its usage limit |
| `/continue` | Continue in a new thread |
| `/copy`, `/copy link` | Copy the last response, or the thread's Hoplite link |

### Thread tools

| Command | What it does |
| --- | --- |
| `/pr` | Open a pull request for the thread, or open the existing one in the browser |
| `/pr status` | Show the pull request card |
| `/pr comments` | Add the pull request's review comments to the chat |
| `/pr ready` | Mark the draft pull request ready for review |
| `/merge`, `/merge METHOD` | Merge the pull request after a confirmation. `METHOD` is `squash`, `merge`, or `rebase` |
| `/autofix`, `/autofix on`, `/autofix off` | Show or set whether Hoplite fixes review comments and failing checks |
| `/automerge`, `/automerge on`, `/automerge off` | Show or set whether Hoplite merges the pull request once it is ready |
| `/preview` | Open the workspace preview in the browser |
| `/terminal` | Open the workspace terminal in the browser |
| `/shell` | Open a shell in the thread's sandbox, in this terminal. Type `~.` on a new line to come back |
| `/sync` | Send your uncommitted local changes to the thread's sandbox |
| `/pull`, `/pull dry-run` | Bring the sandbox's changes into this checkout, without committing. `dry-run` lists what would change |
| `/diff`, `/diff stat` | Show the thread's changes, or only a per-file summary |
| `/open` | Open the thread in the Hoplite app |
| `/review`, `/review FOCUS` | Ask Hoplite to review the thread's changes, optionally with something to focus on |
| `/queue` | Show the thread's queued messages, then edit, delete, or run one now |
| `/usage` | Show the thread's context and cost |
| `/compact` | Compact the thread's context |
| `/stop` | Stop the thread's run, including a teammate's (**Esc Esc** stops only yours) |
| `/rewind` | Rewind the thread to an earlier reply |
| `/export`, `/export FORMAT SCOPE` | Save the thread to a file in the current directory. `FORMAT` is `md` or `json`; `SCOPE` is `messages`, `activity`, or `full` |
| `/archive`, `/archive ACTION` | Archive the thread. `ACTION` (`leave`, `draft`, or `close`) says what happens to an open pull request |
| `/unarchive` | Unarchive the thread |
| `/delete` | Delete the thread for everyone, after a confirmation |
| `/pin`, `/unpin` | Pin the thread to the top of `/resume` on this device, or unpin it |
| `/follow`, `/unfollow` | Add a teammate's thread to your threads (**Mine**), or remove one you followed |
| `/good`, `/good COMMENT` | Rate the last reply as good |
| `/bad`, `/bad COMMENT` | Rate the last reply as bad, with reasons |

### General

| Command | What it does |
| --- | --- |
| `/help` | Show the available slash commands |
| `/status` | Show runtime configuration and the thread's Hoplite link |
| `/mcp` | List the MCP servers the project's runs load, and whether each is connected |
| `/skills` | List the skills this thread can use; picking one puts it in the composer |
| `/instructions` | Show your personal and the project's instructions, with links to edit them in the Hoplite app |
| `/login`, `/login ORG` | Sign in, or sign in to another organization, without leaving the session |
| `/logout` | Sign out of Hoplite on this machine |
| `/settings` | Browse and change [settings](/docs/cli/configuration#settings) |
| `/statusline session`, `/statusline workspace` | Show or hide a status line segment |
| `/paste` | Paste text from the clipboard, or attach the image on it |
| `/attach PATH` | Attach a local file to your next message. See [Attach files and images](/docs/cli/interactive#attach-files-and-images) |
| `/trace` | Copy a private diagnostic trace, for support |
| `/version` | Show the Hoplite CLI version |
| `/quit` | Exit. Alias: `/exit` |

Model, reasoning, retry, and continue are covered in [Interactive sessions](/docs/cli/interactive#model-reasoning-and-speed).

## Pull requests

When the thread has a pull request, it shows as a card with its verdict, checks, and mergeability, and as a chip in the footer.

- `/pr` opens a pull request for the thread's changes. If one exists, it opens it in your browser.
- `/pr status` shows the pull request card again.
- `/pr comments` lists the pull request's review comments. Select the ones you want with **Space** and press **Enter** to add them to the chat.
- `/merge` asks for confirmation, then merges with the repository's default method. `/merge squash`, `/merge merge`, or `/merge rebase` picks a method the repository allows. The CLI tells you when the pull request can't be merged yet.
- `/autofix` and `/automerge` show or set the [review loop](/docs/github#the-review-loop).

Merging and changing the review loop need the `repo:update` permission, as in the Hoplite app: workspace owners and admins can, members can't. Your CLI key gets it when you sign in as an owner or admin. If your role changed since you signed in, run `hoplite login` again for a key with your current role.

See [Pull requests](/docs/github) for how Hoplite opens and updates pull requests.

## Previews and terminal

`/preview` opens the thread's [preview](/docs/sandboxes/previews) in your browser. If the workspace serves several ports, you choose one. `/terminal` opens the workspace terminal in the browser; it needs an active workspace. Both use `$BROWSER` when it's set.

## Usage and context

The footer's meter shows how much of the model's context the thread uses and, when your workspace shows dollar amounts, its cost. `/usage` shows the breakdown: context used, model, input and output tokens, run count, and cost split between the model and the sandbox, plus any [spend limit](/docs/threads/cost).

`/compact` summarizes older context to free space. The compaction run streams into the transcript.

## Skills

The thread's [skills](/docs/agent/skills) appear in the slash menu next to the built-in commands. Choosing one sends it as a prompt, as the web composer does. If a skill has the same name as a built-in command, the built-in command runs.

The agent's task list updates in place as it works, and subagents show under the tool that started them. Long task lists are cut short inline; **Ctrl+O** shows all of them.

## Run commands in the sandbox

In a session, a line starting with `!` runs in the thread's sandbox; see [Run a command in the sandbox](/docs/cli/interactive#run-a-command-in-the-sandbox). From your shell, `hoplite exec` does the same and exits with the command's status, like `ssh`:

```sh
hoplite exec -- npm test
hoplite exec -c 'npm test 2>&1 | tail -20'
git diff | hoplite exec -- git apply
```

| Option | What it does |
| --- | --- |
| `-- <command>...` | The command and its arguments, passed as words that are never split or expanded |
| `-c '<shell>'` | A shell string instead, with pipes and redirects |
| `--resume <id>` | Run in this thread. The default is the latest thread in this repository, the one `hoplite -c` resumes |
| `-r` | Pick the thread from this repository's recent threads (needs a terminal) |
| `--timeout <s>` | Stop the command after this many seconds. The default is 120 and the most is 3,600; a command that times out exits 124 |
| `--cwd <dir>` | The directory to run in. Relative paths start at the repository root |

Piped standard input goes to the command, up to 512 KiB. Its standard output and error print to your terminal's, each up to 2 MiB; `hoplite exec` says on standard error when one was cut. On a terminal, it first prints which thread it runs in. It exits with the command's exit status, with 255 when Hoplite couldn't run it (for example, the sandbox is still setting up, or the thread has no sandbox until you send it a prompt), and with 130 after **Ctrl+C**, which cancels the command in the sandbox. A thread that runs on a local agent has no sandbox; run the command in its folder instead. Like `hoplite ask`, it signs you in first when no CLI key is stored (or Hoplite no longer accepts the stored one); without a terminal to sign in from, it fails at once with 255 and asks you to run `hoplite login` in a terminal first.

It needs the same access as the workspace terminal and a CLI key from `hoplite login`. Each key can run 30 commands a minute.

## Open a shell in the sandbox

`/shell` opens an interactive shell in the thread's sandbox, in place of the session, like `ssh`. From your shell, `hoplite shell` does the same:

```sh
hoplite shell                 # the latest thread in this repository
hoplite shell --resume <id>   # a given thread
hoplite shell -r              # pick from this repository's recent threads
```

It's the web app's workspace terminal. If the sandbox is asleep, Hoplite wakes it first, which can take a while; press **Ctrl+C** to stop waiting. Every key goes to the sandbox as you type it, including **Ctrl+C**, **Ctrl+Z**, and **Ctrl+D**. As in `ssh`, `~` at the start of a line is an escape:

| Escape | What it does |
| --- | --- |
| `~.` | Disconnect. `/shell` returns to the session, and remote updates that arrived meanwhile show then |
| `~?` | List the escapes |
| `~~` | Send a `~` |

The shell ends when you exit it or type `~.`, and `hoplite shell` exits with 0; there's no exit status from the sandbox. It exits with 255 when the connection is lost, for example when the sandbox is archived under it, and with 1 when Hoplite refuses the shell. It needs a terminal; use `hoplite exec` in scripts.

It needs the same access as the workspace terminal and a CLI key from `hoplite login`. You can have 4 workspace terminals open at once, across the web app and the CLI, and open 30 a minute. A thread that runs on a local agent has no sandbox; if you used the thread from this computer, `hoplite shell` names that folder so you can `cd` there instead.

## Send local changes to the sandbox

A thread's sandbox starts from what is on GitHub. To hand it what is on your machine, such as work you haven't committed or pushed yet, run `/sync` in a session, or `hoplite push` from your shell:

```sh
hoplite push                  # the latest thread in this repository
hoplite push --thread <id>    # a given thread
hoplite push --dry-run        # list what would be sent, send nothing
```

It sends your staged, unstaged, and untracked files, as `git status` shows them; files your `.gitignore` ignores stay behind, and your checkout, index, and stash don't change. It first lists what it sends: each file with the lines it adds and removes, and the total size. Credential files, such as `.env`, `.npmrc`, private keys, and files in a `secrets/` folder, are never sent; the list names them. Submodule changes can't travel in a push either; the list names those too, so commit and push them. Put the values the sandbox needs in the project's environment instead.

In the sandbox, the changes apply on the same commit as your checkout:

- When your `HEAD` is pushed and the sandbox is behind it, the sandbox fetches it and fast-forwards its branch first, unless its own changes are in the way.
- When your `HEAD` isn't pushed, the changes go on the newest commit the sandbox has, and your commits after it arrive as uncommitted changes.
- Where the sandbox changed the same files, the changes merge three ways. Lines both sides changed are marked as conflicts in the files, and the command lists them; resolve them in the sandbox with `hoplite shell`, or ask the agent to. Until you do, a later push names them again. When the sandbox has staged a file and changed it again since, the push stops without changing anything, so the merge can't overwrite what it staged.
- Pushing again sends only what changed since the last push, so you can keep editing locally and sync as you go. If you undo a change you pushed and push again, the sandbox undoes it too.

The agent isn't told about a push. Mention it in your next prompt if the agent should look at the changes.

A push carries at most 512 KiB, compressed. Commit and push larger changes with git instead. `hoplite push` exits with 0 when the sandbox has your changes, 1 when it has them with conflicts, 255 when Hoplite or git failed, and 130 after **Ctrl+C**. It needs the same access as `hoplite exec`, and the thread's sandbox must be running: send the thread a prompt first.

## Rewind, export, archive, and delete

- `/rewind` lists the replies you can rewind to. After you confirm, that reply and everything after it are discarded, and the thread reopens. This can't be undone.
- `/export` saves the thread to a file in the current directory. Choose Markdown (`md`, the default) or `json`, and how much to include: `messages` (the default), `activity`, or `full`. A full export includes subagents. See [Export a transcript](/docs/threads/manage#export-a-transcript).
- `/archive` archives the thread. If it has an open pull request, the CLI asks what to do with it. `/archive leave`, `/archive draft`, or `/archive close` answers up front, optionally followed by a comment. See [Archive or delete a thread with an open PR](/docs/threads/manage#archive-or-delete-a-thread-with-an-open-pr). `/unarchive` restores an archived thread; sending it a message does too.
- `/delete` deletes the thread for everyone in the workspace. It can't be undone, so the CLI asks first, with **Cancel** selected. If the thread has an open pull request, the CLI then asks what to do with it, as `/archive` does. After the delete, you're in a new thread. If the CLI says your key lacks the `thread:delete` permission, run `hoplite login` again.

## Pull requests

`/pr ready` marks the thread's draft pull request ready for review on GitHub, so reviewers are asked for their attention. The CLI tells you if the pull request is already ready, merged, or closed.

## Pins, notes, and following

- `/pin` puts the thread at the top of the `/resume` picker, marked **pinned**; `/unpin` removes the pin.
- `/note TEXT` sets a short note that the `/resume` picker shows next to the thread. `/note` shows it, and `/note clear` removes it.
- Pins and notes stay on this device, in `~/.hoplite/threads.json`, just as the web app keeps them in your browser. Your teammates don't see them.
- `/follow` adds a teammate's thread to your threads, so it shows under **Mine**, like **Add to my threads** in the web app. `/unfollow` undoes a follow. A thread you started or wrote in stays in your threads.

## Rate a reply

`/good` and `/bad` rate the last reply. The rating is sent at once; then you can pick reasons, such as **Wrong approach** or **Broke the build**, or press **Esc** to skip. Text after the command is sent as a comment. See [Rate an agent response](/docs/threads/review#rate-an-agent-response).

## Sitemap

Sitemap discovery is not enabled for this deployment.
