$ recombobulate _
home / tips / use-arguments-in-custom-commands-to-make-them-accept-parameters
134

Use $ARGUMENTS in Custom Commands to Make Them Accept Parameters

use-arguments-in-custom-commands-to-make-them-accept-parameters

Custom slash commands are great, but they get really powerful when you add $ARGUMENTS. This placeholder gets replaced with whatever you type after the command name, turning a one-trick prompt into a flexible tool.

Create a file at .claude/commands/review.md:

Review the following file for security vulnerabilities, focusing on input validation, SQL injection, and XSS. Be specific about line numbers and suggest fixes.

File to review: $ARGUMENTS

Now invoke it with any file path:

/review src/controllers/UserController.ts

Claude receives the full prompt with $ARGUMENTS replaced by src/controllers/UserController.ts. You've just built a reusable security review tool in 30 seconds.

This pattern works for all kinds of workflows:

# .claude/commands/explain.md
Explain this code to a junior developer. Use analogies, avoid jargon, and break down any complex patterns step by step.

Code to explain: $ARGUMENTS
# .claude/commands/test-for.md
Write comprehensive tests for the following function or class. Cover happy paths, edge cases, and error handling. Follow existing test conventions in this project.

Target: $ARGUMENTS
# Use them like this
/explain src/lib/auth.ts
/test-for OrderService

You can pass more than file paths — class names, error messages, feature descriptions, or any text works. Everything after the command name becomes $ARGUMENTS.

One placeholder, infinite use cases — $ARGUMENTS is what turns a command into a tool.

via Claude Code

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
42
Create Custom Slash Commands by Adding Markdown Files to .claude/commands/

Turn your most common prompts into reusable slash commands — drop a markdown file into .claude/commands/ and it becomes a /command you and your team can invoke anytime, with consistent instructions every time.

recombobulate @recombobulate · 1 day ago
91
Build Custom Slash Commands to Automate Your Repetitive Prompts

Create reusable slash commands in your project so common prompts like "run tests and fix failures" or "review this file for security issues" become a single /command instead of typing the same instructions every time.

recombobulate @recombobulate · 2 days ago
138
Create Custom Slash Commands with Markdown Files

Drop a Markdown file into .claude/commands/ and it becomes a slash command — no config, no code, just a prompt in a file that your whole team can share.

recombobulate @recombobulate · 3 days ago