Guide

Custom slash commands in every AI coding agent: file locations, arguments and examples (2026)

How do I create my own reusable /command in Claude Code, Gemini CLI, Codex, Cursor, Copilot, Junie, OpenCode, Kiro, Qwen Code and Cline?

Most agents turn a prompt file into a /command named after the file. Claude Code uses .claude/skills/NAME/SKILL.md or .claude/commands/NAME.md, Cursor uses .cursor/commands/NAME.md, OpenCode uses .opencode/commands/NAME.md, Junie uses .junie/commands/NAME.md, and VS Code Copilot uses .github/prompts/NAME.prompt.md. Gemini CLI uses TOML files in .gemini/commands/, Qwen Code uses Markdown in .qwen/commands/, and Kiro CLI uses saved prompts in .kiro/prompts/. Codex custom prompts in ~/.codex/prompts/ are deprecated in favor of skills, and Cline and Copilot CLI run skills as slash commands.

Coding agent settings change often

Get one email a week when a setting, flag or permission rule changes, checked against the vendor docs.

Quick answer: where each agent keeps custom commands

  • Claude Code: .claude/skills/NAME/SKILL.md (project) or ~/.claude/skills/NAME/SKILL.md (personal). Old .claude/commands/NAME.md files still work and create the same /NAME.
  • Gemini CLI: NAME.toml in .gemini/commands/ (project) or ~/.gemini/commands/ (user). Run it as /NAME.
  • OpenAI Codex: custom prompts in ~/.codex/prompts/NAME.md, run as /prompts:NAME. Deprecated: use skills instead.
  • Cursor: .cursor/commands/NAME.md. Type / in the Agent input and pick the command.
  • GitHub Copilot in VS Code: .github/prompts/NAME.prompt.md (workspace) or your VS Code profile (user). Copilot CLI does not support prompt files; it runs skills with /skill-name.
  • Junie: .junie/commands/NAME.md (project) or ~/.junie/commands/NAME.md (user). Run it as /NAME arg=value.
  • OpenCode: .opencode/commands/NAME.md (project) or ~/.config/opencode/commands/NAME.md (global), or a command entry in opencode.json.
  • Kiro CLI: saved prompts in .kiro/prompts/ (workspace) or ~/.kiro/prompts/ (global). In V3, run one as /prompt-name [arguments]. Skills in .kiro/skills/ also become slash commands.
  • Qwen Code: NAME.md in .qwen/commands/ (project) or ~/.qwen/commands/ (global). TOML still works but is deprecated.
  • Cline: the docs no longer describe how to write or run workflows. Use skills in .cline/skills/ and run them with /skill-name.

File locations and formats

  • Claude Code: Markdown with optional YAML frontmatter. A skill is a folder with SKILL.md; a command is a single .md file. If a skill and a .claude/commands/ file share a name, the skill wins.
  • Gemini CLI: TOML. prompt is required and description is optional. Subfolders become namespaces, so git/commit.toml is /git:commit. A project command beats a user command with the same name.
  • Codex: Markdown with description and argument-hint in YAML frontmatter. Codex only reads top-level Markdown files in the prompts folder, so subfolders and other file types are ignored. Prompts live in your Codex home and are not shared through the repository.
  • Cursor: one Markdown file per command in .cursor/commands/.
  • VS Code Copilot: Markdown with the .prompt.md extension. Optional frontmatter: description, name, argument-hint, agent, model and tools.
  • Junie: Markdown with YAML frontmatter holding a description. The file name is the command name.
  • OpenCode: Markdown whose frontmatter can set description, agent, model and subtask; the body is the template. You can also define commands under command in the JSON config with a template field. A custom command with the same name as a built-in one overrides it.
  • Kiro CLI: create a workspace prompt with /prompts create --name NAME. Local prompts beat global prompts, which beat MCP prompts with the same name.
  • Qwen Code: Markdown with optional YAML frontmatter (description shows in /help). Subfolders become colon-named commands. A project command beats a user command with the same name.

How arguments are passed

  • Claude Code: $ARGUMENTS is the full argument string. $ARGUMENTS[N] or $N picks one argument, counting from 0. With no placeholder, Claude Code appends ARGUMENTS: <your input> to the end.
  • Gemini CLI: {{args}} is replaced with the text after the command name (shell-escaped inside !{...}). If the prompt has no {{args}} and you pass arguments, the CLI appends your full command after two newlines; with no arguments the prompt is sent unchanged.
  • Codex: $1 to $9 come from space-separated arguments, $ARGUMENTS holds them all, and uppercase names like $FILE take KEY=value (quote values with spaces). Write $$ for a literal $.
  • VS Code Copilot: type extra text after the name, for example /create-react-form formName=MyForm, or use ${input:variableName} and ${input:variableName:placeholder} in the file.
  • Junie: put $argumentName in the prompt and pass name=value. The command only runs when every argument is given. allowPromptArgument: true adds a free text $prompt; if the prompt does not use $prompt, the text is appended as User Input: ....
  • OpenCode: $ARGUMENTS for everything, or $1, $2, $3 for single arguments.
  • Kiro CLI V3 (file prompts only): ${1} to ${10} for positional arguments, $ARGUMENTS for all of them, and ${@} for the same full argument string.
  • Qwen Code: {{args}}. With no marker, any arguments you pass are appended to the end of the prompt after two line breaks.
  • Cursor: the official docs do not describe an argument placeholder for commands.

Shell and file injection: Claude Code runs !`command` before sending the skill. OpenCode also uses !`command` and @filename. Gemini CLI and Qwen Code use !{command} and @{path}, and both ask you to confirm before a shell command runs.

Minimal examples

Claude Code: .claude/skills/migrate-component/SKILL.md

---
name: migrate-component
description: Migrate a component from one language to another
---

Migrate the $0 component from $1 to $2.
Preserve all existing behavior and tests.

Run it in Claude Code

/migrate-component SearchBar JavaScript TypeScript

Gemini CLI: .gemini/commands/git/fix.toml (run as /git:fix)

description = "Generates a fix for a given issue."
prompt = "Please provide a code fix for the issue described here: {{args}}."

Codex (deprecated): ~/.codex/prompts/draftpr.md (run as /prompts:draftpr FILES="src/lib/api.ts")

---
description: Prep a branch, commit, and open a draft PR
argument-hint: [FILES=<paths>] [PR_TITLE="<title>"]
---

Create a branch named dev/<feature_name> for this work.
If files are specified, stage them first: $FILES.
Commit the staged changes with a clear message.
Open a draft PR on the same branch. Use $PR_TITLE when supplied; otherwise write a concise summary yourself.

Cursor: .cursor/commands/review.md (run as /review)

Review the current changes for bugs and missing tests.
List problems in order of severity.

VS Code Copilot: .github/prompts/create-react-form.prompt.md

---
description: Create a React form component
agent: agent
---

Create a React form named ${input:formName:MyForm} using react-hook-form.

Junie: .junie/commands/explain.md (run as /explain file=src/main.kt)

---
description: Explains code in a given file
---
Explain the code in $file and suggest improvements.

OpenCode: .opencode/commands/component.md (run as /component Button)

---
description: Create a new component
---

Create a new React component named $ARGUMENTS with TypeScript support.
Include proper typing and basic structure.

Kiro CLI V3: create and run a saved prompt

/prompts create --name code-review
/code-review src/app.ts

Qwen Code: .qwen/commands/fix.md (run as /fix)

---
description: Fix an issue
---

Please provide a code fix for the issue described here: {{args}}.

Per-agent gotchas

  • Claude Code: set disable-model-invocation: true for commands with side effects like /deploy, so Claude cannot run them on its own.
  • Gemini CLI: run /commands reload after editing a file instead of restarting.
  • Codex: restart Codex or open a new chat after editing a prompt file. Move shared or new prompts to skills, since custom prompts are deprecated.
  • Cursor: in Cursor 2.4 or later, /migrate-to-skills converts eligible rules and commands into skills and keeps explicit invocation.
  • VS Code Copilot: prompt files run only in Local harness sessions. For other harnesses, use an agent skill, which also shows up as a slash command.
  • Copilot CLI: prompt files are not supported. Put a skill in .github/skills/, .claude/skills/ or .agents/skills/ and call it with /skill-name in your prompt.
  • Junie: Tab completes a missing argument name, and the command will not run until all template arguments are set.
  • Kiro CLI: the /prompt-name form is for V3. Other CLI engines use @prompt-name [arguments].
  • Qwen Code: TOML command files still load, but new commands should be Markdown.
  • Cline: the config docs still list a workflows/ folder under .cline/, but no current page explains how to invoke one. Skills are the documented slash command path.

Full guide for each agent

Get coding agent settings changes by email

When a setting, flag or permission rule in this guide changes, it goes in the weekly AgentAtlas update, checked against the vendor docs. One email a week.

Sources

Other guides

How to allow Cursor to run all commands: Run Everything, allowlist and sandboxHow to allow Claude Code to run all commands: permission modes, allow rules and skip permissionsClaude Code permissions: allow, ask and deny rules, rule syntax and allowed toolsCodex CLI: approval and sandbox modesGemini CLI: YOLO mode, auto_edit and allowing specific shell commandsCursor Privacy Mode: telemetry, training and data retentionClaude Code telemetry and data retention: what is sent and how to turn it offGemini CLI: turn off usage statistics and telemetryCLAUDE.md: where it goes, how it loads, and how it works with AGENTS.mdClaude Code hooks: format on save, block risky edits, get notifiedClaude Code subagents: create one, limit its tools, and call itAdd MCP servers to Cursor with mcp.json: Keep files out of Cursor with .cursorignore: Configure Codex with config.toml: Configure Gemini CLI with settings.json: Add MCP servers to Claude Code (claude mcp add, .mcp.json, scopes): Claude Code custom slash commands and skills (SKILL.md): GitHub Copilot custom instructions: Adding MCP servers to GitHub Copilot: Claude Code settings.json: file locations, precedence, and key settingsClaude Code plugins and marketplaces: install, create, and shareGemini CLI extensions and custom commands: Configuring OpenCode with opencode.json: Cline Rules: workspace, global, and conditional rulesKiro steering files: .kiro/steering, inclusion modes, and AGENTS.mdZed agent: instruction files, MCP servers, tool permissions, and ACP agentsCursor CLI: install, headless mode, permissions and CIAider: CONVENTIONS.md, .aider.conf.yml and API keysJunie guidelines, MCP and the Action Allowlist: Amp AGENTS.md, settings.json and MCP: Configure Goose extensions, hints, recipes and permissions: Customize OpenHands with skills, AGENTS.md, setup.sh and MCP: Configure Factory Droid CLI: AGENTS.md, settings.json, autonomy, custom droids and MCPConfigure Qwen Code: settings.json, providers, QWEN.md, MCP and approval modesCursor hooks: hooks.json, beforeShellExecution, afterFileEdit and exit codesCursor sandbox: sandbox.json, network allowlist and run modesCursor settings: settings.json, Cursor Settings and the ~/.cursor config filesCursor browser agent: @browser, browser automation and approval modesCursor subagents: .cursor/agents, frontmatter, built-in Explore and BrowserCursor telemetry and OpenTelemetry export (Privacy Mode, OTLP, Analytics API): Cursor rules setup: project, user and Team Rules, .mdc frontmatter, globs and AGENTS.mdClaude Code headless mode: claude -p, --output-format json, --bare and CI flagsClaude Code statusline: custom status bar in settings.json with context %, cost and git branchClaude Code /model: switch models, aliasesClaude Code /cost and /usage: check token spend, usage limits and reduce costsClaude Code VS Code extension: install, shortcuts, settings and /ideCodex AGENTS.md: global, project and override instruction files explainedCodex MCP servers: codex mcp add and [mcp_servers] in config.tomlCodex sandbox modes: read-only, workspace-write, danger-full-access and network accesscodex exec: run Codex non-interactively in scripts and CI with JSON outputCodex skills: create SKILL.md, skill folder locations and $skill invocationGEMINI.md in Gemini CLI: context file locations, imports and /memoryGemini CLI MCP servers: gemini mcp add and mcpServers in settings.jsonGemini CLI custom slash commands: TOML files, {{args}}, !{shell} and @{file}Gemini CLI headless mode: gemini -p, JSON output and exit codes for scripts and CIGemini CLI sandbox: enable Docker, Podman, macOS Seatbelt or gVisorcopilot-setup-steps.yml: set up the GitHub Copilot cloudGitHub Copilot CLI permissions: --allow-tool, --deny-tool, --allow-all-tools and trusted directoriesGitHub Copilot custom agents: .github/agents/*.agent.md profiles, tools and frontmatterGitHub Copilot code review settings: automatic PR reviews, rulesets, effort level and approvalsOpenCode MCP Server Setup: Local and Remote Servers in opencode.jsonOpenCode Permissions: Allow, Ask or Deny Bash, Edit and WebfetchOpenCode Custom Agents and Subagents: Markdown Files, Modes and @ MentionsCline MCP Setup: cline_mcp_settings.json for Local and Remote ServersCline Auto Approve and YOLO Mode: Run Commands and Edits Without PromptsCline Skills: SKILL.md Location, Format and Slash Command UseAmp MCP Setup: amp mcp add, amp.mcpServers and Workspace ApprovalAmp AGENTS.md: File Locations, @ Mentions and Glob-Scoped GuidanceAmp Skills: SKILL.md Folders, amp skill add and Search OrderKiro MCP Setup: .kiro/settings/mcp.json, autoApprove and OAuthKiro Hooks: .kiro/hooks JSON, PreToolUse, PostFileSave and StopKiro Permissions: permissions.yaml Allow, Ask and Deny RulesFactory Droid MCP Setup: droid mcp add, mcp.json Locations and /mcpFactory Droid Hooks: hooks.json, PreToolUse Matchers and Exit CodesFactory Droid Custom Droids (Subagents): .factory/droids Markdown FilesJunie MCP Setup: .junie/mcp/mcp.json for CLI and /mcp CommandJunie Brave Mode and Action Allowlist: Auto-Approve Commands in Junie CLIJunie Custom Slash Commands: .junie/commands Markdown Files and Argumentsgoose .goosehints and AGENTS.md: Global and Project Instructionsgoose Permission Modes: GOOSE_MODE auto, approve, smart_approve and chatgoose Recipes: recipe.yaml Format, Parameters and goose run --recipeZed Agent Tool Permissions: Auto-Approve Terminal Commands with tool_permissionsUse Claude, Codex and Gemini CLI in Zed: External Agents and agent_serversZed with Ollama, LM Studio and llama.cpp: Local Model Setup and Context LengthMCP 2026-07-28 Migration Guide: Stateless Protocol, No Sessions, server/discover, MRTR, and SDK v2 UpgradeSubagents and Custom Agents Compared: Claude Code vs Codex vs Cursor vs Gemini CLI vs GitHub CopilotAllow all commands in any AI coding agent: Cursor, Claude Code, Codex, Gemini CLI, Copilot CLI and 7 moreAdd an MCP server to any AI coding agent: Claude Code, Cursor, Codex, Gemini CLI, VS Code and 8 moreSettings file locations for every AI coding agent: Claude Code, Cursor, Codex, Gemini CLI, OpenCode, Qwen Code, Amp and Factory DroidRules and instruction files in every AI coding agent: .cursor/rules, CLAUDE.md, AGENTS.md, GEMINI.md, Copilot instructions and moreGemini CLI hooks: settings.json, BeforeTool, AfterTool, exit codes and /hooksGitHub Copilot hooks: .github/hooks/*.json for Copilot CLI and the cloud agentHooks in every AI coding agent: Claude Code, Cursor, Gemini CLI, GitHub Copilot, Kiro and Factory DroidAgent Skills (SKILL.md) in every AI coding agent: Claude Code, Codex, Cline, Amp and OpenHandsHow to deploy a remote MCP server (Streamable HTTP): Cloudflare Workers, Vercel, Railway and moreHeadless mode in every AI coding agent: claude -p, codex exec, gemini -p, Cursor agent -p and copilot -p for scripts and CIClaude Code sandbox: /sandbox, sandbox.enabled, allowedDomains, excludedCommands and strict modeSandbox modes in every AI coding agent: Claude Code, Cursor, Codex and Gemini CLI comparedMigrate from Gemini CLI to Antigravity CLI (2026): Config, MCP, Skills, FlagsRun GitHub Copilot CLI with copilot -p in scripts and CI (2026):

Reviewed Oct 19, 2026. Settings change often; the linked vendor docs are the source of truth.