Skip to main content

Loading the visual lab…

#slash-commandsAgentic AI

Slash commands, Claude Code / Cursor style: templates, arguments, chaining.

What you'll play with

  1. Welcome to #slash-commands. On the left, a composer (at the bottom) and an autocomplete popover (above): when you start with "/", the commands from the active catalogue filter down. In the middle, the template of the chosen command; its variables ({selection}, {file}, {diff}…) wait to be filled. On the right, the output window where the response writes itself token by token. A slash command in Claude Code or Cursor style is not just a shortcut to a prompt: it is a template + variables + an execution trigger, often chainable.
  2. Start by simulating typing: /type /re. The popover filters to the commands starting with re — in the Claude Code catalogue, there are two: /review and /refactor.
  3. Pick the first one: /choose 1. The composer fills with the template of /review, and you see its {selection} variable appear in purple in the central panel.
  4. Fill the variable: /apply selection. The purple chip turns green ("selection ✓"), the substitution happens in the template, and the panel border flips to green: we are ready to execute.
  5. Run the command: /execute. A yellow ray leaves the template towards the right-hand window, then the response streams character by character — like a real LLM.
  6. Switch catalogue: /tool cursor. The popover and the title above flip to the native Cursor commands — /edit, /chat, /generate, /docs, /fix. Claude Code and Cursor each have their own shortcuts, but the pattern is the same.
  7. Define your own slash command: /define my-review "Analyze this diff: {diff}". It lands in the custom catalogue — you just created a shortcut that carries your own prompt.
  8. Chain /plan and then your /my-review: first /chain plan,my-review to build the chain (both pills appear at the bottom), then /run-chain to run it — the output of /plan feeds the {result} variable of /my-review.
  9. Your turn. Try /tool claude-code to go back to the natives, /type /te to filter on /test, /apply file to fill another variable, /tool custom to see your my-review command in its catalogue, /reset to wipe everything. Next: #tool-calling (free) shows how commands actually call real tools, and #planning-reflection (Premium) climbs one notch in agency.

Channel commands

  • /type <text>Simulates typing in the composer (filters the popover).
  • /choose <index=1..5>Picks a popover entry and loads its template.
  • /apply <selection|file|diff|language|result>Fills a variable of the current template.
  • /executeRuns the current command (streamed output).
  • /tool <claude-code|cursor|custom>Switches the active slash-command catalogue.
  • /define <name> <template>Creates a custom slash command (in the "custom" catalogue).
  • /chain <cmd1,cmd2,...>Builds a chain: output(i) → {result} variable of (i+1).
  • /run-chainRuns the chain step by step.
  • /resetResets everything (Claude Code catalogue, empty popover).

Glossary

slash command
Shortcut of the form /plan, /review, /test… that triggers a pre-written prompt template, often with variables like {selection} or {file}. Standardised in Claude Code, Cursor, VS Code (Chat) and most modern AI assistants.
autocomplete
Floating menu that appears when you type "/" and filters as you add characters. Cursor and VS Code show at most 5 suggestions, ranked by relevance. Close it with Esc, pick with ↑/↓ + Enter.
template
Pre-written text with named holes ({selection}, {file}…) that are filled before being sent to the LLM. Decoupling the template from the content makes it reusable, versionable and shareable with the team.
context variable
Named marker in a template — {selection} (the highlighted text in the editor), {file} (the active file), {diff} (the uncommitted git diff), {language}. The IDE resolves them automatically from the current state.
chain of commands
Composing several slash commands in a row: the output of one becomes a variable of the next (often {result}). The basis of lightweight agents: /plan → /code → /test already forms a mini workflow that echoes Claude Code subagents.
streaming
Progressive rendering of the LLM response, token by token, as soon as the model produces them. Improves perceived latency: the user starts reading before generation ends. Implemented via SSE or WebSocket on the API side.
built-in command
Slash command shipped by default with the tool: /plan, /review, /refactor in Claude Code; /edit, /chat, /generate in Cursor. Not directly modifiable, but can be overridden with a custom command of the same name.
custom command
Slash command defined by the user (Markdown file in .claude/commands/ for Claude Code, or the integrated editor in Cursor). Lets you freeze a team's in-house prompts and share them via the Git repo.
Claude Code
Anthropic's terminal assistant (2024-2025): agentic loop with slash commands (/plan, /review, /agents, /hooks…), skills, built-in MCP. Complementary to Cursor for long command-line tasks.
Cursor
Agent-IDE built on VS Code (Anysphere): slash commands integrated into the composer (/edit, /chat, /generate, /docs, /fix), VS Code command palette, cloud agent runner, built-in MCP. Direct competitor of GitHub Copilot Chat.

Other channels in Agentic AI

  • #react-loopAn agent's ReAct loop: Thought → Action → Observation, live.
  • #tool-callingTool calling (function calling / MCP): the JSON that makes the LLM act.
  • #slash-commandsSlash commands, Claude Code / Cursor style: templates, arguments, chaining.
  • #context-memoryContext window and agent memory: count, truncate, summarize, index.
  • #planning-reflectionPlanning, reflection and self-correction: from 60% to 90% success.
  • #multi-agentsMulti-agents: planner, workers, verifier. A DAG that beats the monolithic agent.