slash-command-builder

A guide to creating and troubleshooting Claude Code slash commands, which are custom commands invoked with a slash and optional arguments.

In plain words
What is it for?
Use it to create or improve commands, set descriptions and argument hints, configure allowed tools, reference files, or understand commands versus skills.
Why use it?
It helps avoid incorrect command files, missing configuration, wrong permissions, and argument-handling problems.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/pr-pm/prpm/slash-command-builder
Any agent
npx skills add pr-pm/prpm --skill slash-command-builder
Clone the repo
git clone --depth 1 https://github.com/pr-pm/prpm

Made for: Claude Code, Codex.

Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,627 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00040 $0.02627
Opus 5 $0.00020 $0.01314
Sonnet 5 $0.00008 $0.00525
Haiku 4.5 $0.00004 $0.00263

Measured 2d ago against content hash be2fe2556f9f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

slash-command-builder scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

!`rm -rf node_modules`
.claude/skills/slash-command-builder/SKILL.md · 489 lines

How it starts

The opening of the file, as written. The whole thing — 489 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Slash Command Builder - Claude Code Command Expert

Use this skill when creating, improving, or troubleshooting Claude Code slash commands. Provides expert guidance on command structure, syntax, frontmatter configuration, and best practices.

When to Use This Skill

Activate this skill when:

  • User asks to create a new slash command
  • User wants to improve an existing command
  • User needs help with command arguments or frontmatter
  • User is troubleshooting command invocation issues
  • User wants to understand slash command capabilities
  • User asks about the difference between commands and skills

Quick Reference

Command File Structure

---
description: Brief description shown in autocomplete
argument-hint: [arg1] [arg2] <optional-arg>
allowed-tools: Bash(git *), Read, Write
model: claude-3-5-sonnet-20241022
disable-model-invocation: false
---

Your command prompt here with $ARGUMENTS or $1, $2, etc.

Use !`command` for bash execution
Use @file.txt for file references

File Locations

Project commands (shared with team):

.claude/commands/my-command.md

Personal commands (individual use):

~/.claude/commands/my-command.md

Organized commands (namespaced):

.claude/commands/frontend/component.md  → /component (project:frontend)

Creating Effective Slash Commands

Step 1: Identify the Use Case

Good candidates for slash commands:

  • Frequently repeated prompts
  • Simple, single-purpose tasks
  • Quick code reviews or analyses
  • Common git workflows
  • Standard documentation tasks

NOT good for slash commands (use Skills instead):

  • Complex multi-step workflows
  • Context-aware behavior
  • Team standardization needs
  • Workflows requiring multiple files

Step 2: Choose Command Name

Best practices:

  • Use lowercase with hyphens: /review-pr, /optimize-code
  • Make it memorable and intuitive
  • Avoid conflicts with built-in commands
  • Keep it short (2-3 words max)

Examples:

  • /review-pr - Clear, concise
  • /fix-lint - Action-oriented
  • /review-pull-request-thoroughly - Too verbose
  • /rpr - Too cryptic

Read the full file on GitHub · 489 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 489 lines · 40 tokens per session scan C be2fe2556f9f

Subscribe to this mod's changes

slash-command-builder is a skill published in the GitHub repository pr-pm/prpm (120 stars, last pushed 2mo ago), licensed MIT. It adds 40 tokens to every session and 2,627 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.