a bit more advanced tip, with a steeper learnin...
Claude code tip! Everyone knows slash commands, but do you know how to use arguments? Most people don't, and this is where it gets really powerful. A basic Claude code slash command is static. It's gonna run the same thing every time. But when you use arguments, you make them dynamic. So here's how you make an argument-based command. First, if you don't already have one, create a commands folder inside the .claude folder of the project you want to make this command for. Inside the commands folder, make a markdown file with the same name as the command you're trying to create. Then you can just start writing the prompt for the command in this markdown file. Where you want your input to go, use hashtag $arguments. So now with this issue command, I can let Claude code know which exact issue to take a look at. But if you want to get a bit more advanced with it, use positional arguments. Let's say I just want to make a migrate command. I can use positional arguments to denote the prior and posterior framework I would like to convert a component into. So instead of using hashtag $arguments, you would instead use $ and then the position of the input. Save yourself a lot of time and make one of these for every unique part of your workflow.
Summary
This video explains how to enhance Claude commands using arguments for dynamic functionality. It covers creating a commands folder, writing prompts, and using positional arguments for advanced commands.
Key Points
- Use arguments in Claude commands for dynamic functionality.
- Create a commands folder in the .claude directory for your project.
- Write your command prompt in a markdown file named after the command.
- Use hashtag $arguments for input placeholders in your command.
- Positional arguments allow for more advanced command configurations.
- Save time by creating unique commands for different workflow parts.
Tags
Repurpose Ideas
- LinkedIn post: How to enhance Claude commands with arguments
- Tweet: 3 tips for using positional arguments in Claude
- Checklist: Set up your Claude commands folder and markdown files
Save videos. Search everything.
Build your personal library of inspiration. Find any quote, hook, or idea in seconds.
Create Free Account No credit card required