
Slash commands and AI command palettes
Slash commands open a menu of actions when you type '/'. How Claude Code, Codex, Cursor, Slack and Notion use them, and how to design them so people find them.
What is it and how does it differ from a command palette?
A slash command is typed at the start of a message: “/” followed by the name of the action. Slack’s documentation defines it as a way to invoke an app by typing a string into the message composer. In AI tools the pattern is used to choose a model, load a template or request a specific action without writing a full prompt.
A command palette is similar but has a different scope. It is a global search box that gathers the actions of the whole application and opens with a keyboard shortcut: in Visual Studio Code, Ctrl+Shift+P (⇧⌘P on Mac). The slash command is contextual: it lives inside the field where the writing happens. Many applications use both, each for a different moment.
How do AI tools handle it today?
It helps to look at real products, because each one solves the pattern differently. The data below comes from their official documentation on November 2, 2026:
| Product | What happens when you type “/” | Documented examples |
|---|---|---|
| Claude Code | Shows the available commands and filters as you type letters | /clear (new conversation), /compact (summarize to free context), /model (switch model), /init (create a CLAUDE.md guide), /plan (enter plan mode), /rewind (go back to an earlier point) |
| Codex (CLI) | List of built-in commands | /model, /review (review uncommitted changes), /compact, /diff (show the Git diff), /status, /permissions, /plan, /init (generate an AGENTS.md), /new, /resume |
| Cursor | You type “/” and a skill name in the agent chat | /create-skill and /migrate-to-skills, which converts commands and rules into skills (Cursor 2.4 or later) |
| Slack | You type “/” in the message composer | /remind (create a reminder), /invite, /search, /topic, /mute, /dnd |
| Notion | You press “/” and select or type a content type | /image, /quote, /callout, /comment; /AI Block generates a block with Notion AI |
Three design lessons come out of that table:
- The menu filters as you type. In Claude Code, “/adddir” highlights
/add-dirand “/new” highlights/clearthrough its alias. A menu that tolerates abbreviations and synonyms reduces the need to memorize. - Custom commands enter through the same door. In Claude Code, a file
.claude/commands/deploy.mdand a skill.claude/skills/deploy/SKILL.mdboth create/deploy; the documentation recommends skills for new work. In Cursor, skills are invoked the same way with “/”. For the user there is no difference between what the product ships and what their team added. - Some commands are hidden on purpose. Claude Code leaves commands that aren’t available to you out of the menu and hides a few until you type the full name. That reduces noise, at the cost that those commands are never discovered.
Names change between tools and between versions, so /help or the menu itself is the reliable source for what exists in your version.
Why does it matter to a designer?
Because slash commands are above all a discoverability problem. A text box shows nothing, and the slash is a convention many users don’t know. A command nobody finds does not exist.
The AI UX Playground pattern frames it carefully: slash commands work best as an accelerator layered on top of discoverable buttons, not as the only way to reach a feature. For someone who knows the actions, typing “/summarize” is faster than hunting for a button. For someone who doesn’t, the menu that appears after “/” also works as a catalog of what the AI can do.
So the design has to make the pattern visible: a hint in the field, clear names, a description and, where possible, a preview of the effect. And every important function should also have a button.
One implementation detail matters: if a message legitimately starts with “/”, the menu must not break normal typing. And if the app also uses “@” to mention people or files, the two triggers should be easy to tell apart.
How do you design a good command menu?
Five criteria. Those on names, categories and shortcuts rest on VS Code’s guidance for its palette; the rest are design recommendations, not rules from a standard.
- A visible trigger. A hint text or an icon next to the field that says “/” opens actions.
- Clear names and descriptions. “/summarize” with one line explaining what it will do and to which text. Avoid internal codes. VS Code’s guidance asks for command names to be labeled well so users can find them, and advises against emojis in them.
- Grouping by category. As the list grows, related commands should appear together. VS Code puts a category prefix on each command.
- Preview or confirmation. For actions that change a document or send something, show what will happen before running it. That is the previewing changes pattern.
- Shortcuts that don’t overwrite existing ones. VS Code’s guidance recommends adding keyboard shortcuts where appropriate and avoiding overwriting existing ones.
If the action should appear right where the user is working, without typing anything, see inline AI.
When NOT to use slash commands
These cases match the anti-patterns described by AI UX Playground.
- In consumer products. If most people will never learn the syntax, the menu doesn’t serve them. A visible button is better.
- With few actions. With three or four functions, a button is found faster than a hidden command.
- On mobile. The menu competes with the on-screen keyboard and makes typing worse.
- When two menus overlap. A “/” menu and a “+” menu with the same actions and no shared logic confuse more than they help.
Example
Illustrative example: a document editor for design teams. Next to the cursor, in grey and only when the field is empty, a hint reads “Type / to see actions”. Typing “/” opens a list grouped under “Text” (summarize, rewrite in a formal tone) and “Design” (generate button copy, suggest a title). As the person keeps typing “/sum”, the list filters down to “Summarize”, with a one-line description and a preview of the summary before it is inserted. Anyone who prefers not to use commands finds the same summary in a button on the top toolbar.
Common mistakes
- Making commands the only path to an important feature.
- Using cryptic or internal names such as “/x2” or “/ai-gen-v3”.
- Never telling users that “/” does anything.
- Letting a command run an irreversible action without confirmation.
- Using the same menu style for “/” and “@”, so nobody knows which is which.
- Adding new commands without retiring old ones: the list grows until nobody reads it. Group or filter before that happens.
Sources
- AI UX Playground, “Slash Commands”: https://aiuxplayground.com/pattern/slash-command
- Visual Studio Code, “Command Palette UX Guidelines”: https://code.visualstudio.com/api/ux-guidelines/command-palette
- Visual Studio Code, “User Interface” (palette shortcut): https://code.visualstudio.com/docs/getstarted/userinterface
- Claude Code, “Commands”: https://code.claude.com/docs/en/commands
- Claude Code, “Skills” (custom commands): https://code.claude.com/docs/en/skills
- OpenAI, Codex CLI commands: https://learn.chatgpt.com/docs/developer-commands?surface=cli
- Cursor, “Agent Skills”: https://cursor.com/docs/skills
- Slack, “Slash commands in Slack”: https://slack.com/help/articles/201259356-Slash-commands-in-Slack
- Slack, “Implementing slash commands”: https://docs.slack.dev/interactivity/implementing-slash-commands
- Notion, “Using slash commands”: https://www.notion.com/help/guides/using-slash-commands
- Notion, “Notion AI FAQs” (
/AI Block): https://www.notion.com/help/notion-ai-faqs