Free Tool
Claude Code Slash Command Generator
Build a custom slash command for Claude Code. Choose the new skill format (SKILL.md) or the older .claude/commands file, add arguments with $ARGUMENTS or $0, $1, and pre-approve the tools it needs.
Templates:
Skill file
.claude/skills/fix-issue/SKILL.md
--- name: fix-issue description: Fix a GitHub issue by number: read it, find the cause, fix it and add a test. argument-hint: [issue-number] allowed-tools: Bash(gh issue view *) Read Grep Glob disable-model-invocation: true --- Fix GitHub issue #$ARGUMENTS. 1. Run `gh issue view $ARGUMENTS` and read the issue. 2. Find the code involved and explain the root cause in two sentences. 3. Make the smallest fix and add a test that fails without it. 4. Run the tests and show the result.
Or save it from the terminal
mkdir -p .claude/skills/fix-issue && cat > .claude/skills/fix-issue/SKILL.md <<'EOF' --- name: fix-issue description: Fix a GitHub issue by number: read it, find the cause, fix it and add a test. argument-hint: [issue-number] allowed-tools: Bash(gh issue view *) Read Grep Glob disable-model-invocation: true --- Fix GitHub issue #$ARGUMENTS. 1. Run `gh issue view $ARGUMENTS` and read the issue. 2. Find the code involved and explain the root cause in two sentences. 3. Make the smallest fix and add a test that fails without it. 4. Run the tests and show the result. EOF
How to use your new command
- Save the file at the path shown, or run the save command from your project folder.
- In Claude Code, type
/and pickfix-issue, then add your arguments. - Example:
/fix-issue [issue-number] - "Only I can run it" adds
disable-model-invocation: true, so Claude never starts it by itself. Untick it if you want Claude to use it when a task matches the description.
Frequently asked questions
Yes. Claude Code merged custom commands into skills. Both are called with /name. Your old .claude/commands/*.md files keep working, but the docs recommend a skill (.claude/skills/<name>/SKILL.md) for new work because a skill can also hold supporting files.
For a skill, save SKILL.md in .claude/skills/<name>/ in your project, or in ~/.claude/skills/<name>/ for all your projects. For the older format, save <name>.md in .claude/commands/. A file in a subfolder, such as frontend/component.md, becomes /frontend:component.
$ARGUMENTS is replaced with everything you type after the command. $0, $1 and so on (or $ARGUMENTS[0]) pick single arguments, counting from zero. If the file has no placeholder, Claude Code adds your input at the end as ARGUMENTS: <your input>.
It lets the command use the listed tools without asking you for permission each time, for example Bash(git diff *) Read Grep. The grant only lasts for that turn. Use it for safe, repeatable steps.
It shows a hint in the autocomplete menu when you type the command, such as [issue-number] or [filename] [format], so you remember which arguments to pass.
Yes. A line with an exclamation mark and a command in backticks, like !`git diff HEAD`, runs before the prompt is sent and puts the output in its place. It is handy for giving Claude fresh context.