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
Reviewed Oct 19, 2026. Settings change often; the linked vendor docs are the source of truth.