Chapter 2: Build Core Todo
Creating Custom Commands
Creating Custom Commands
You've been using built-in slash commands like /plan and /compact. Now let's create your own. Custom commands turn prompts you use repeatedly into one-word shortcuts.
This is where Claude Code goes from a tool to YOUR tool. Custom commands encode your workflow — the prompts that work best for you, saved so you never have to retype them.
How custom commands work
Custom commands are markdown files in a .claude/commands/ directory. Each file becomes a slash command you can run.
todo-app/ .claude/ commands/ today.md → run with /project:today status.md → run with /project:status standup.md → run with /project:standup
The file contents are the prompt that gets sent to Claude Code when you run the command.
Build your first command: /today
Let's create a command that shows your todos due today. Ask Claude Code:
/plan Create a custom slash command at .claude/commands/today.md that asks Claude Code to read the todo app's data and list all todos due today, grouped by priority. It should also show overdue items highlighted as urgent.
Review the plan, then let Claude Code create it. The file will look something like this:
Read the todo app source code and find where todos are stored.
List all todos that are due today, grouped by priority (High → Medium → Low).
If there are overdue todos, list them first with an "OVERDUE" label.
Format the output as a clean checklist I can use for my day.Now run it:
The project: prefix means this command lives in your project's .claude/commands/ folder. Commands in ~/.claude/commands/ use the user: prefix and work across all your projects.
Build a /status command
This one gives you a quick project health check:
"Create a custom command at .claude/commands/status.md that reads the project and gives me a status report: how many components, what features are built, what's missing compared to the original plan, and any code quality issues."
This is incredibly useful when you come back to a project after a break — one command to get caught up.
Build a /standup command
Perfect for daily standups or progress tracking:
"Create .claude/commands/standup.md that reads the recent git history and the current state of the code, then writes a standup update: what was done since the last commit, what's in progress, and what's next based on the TODO comments or missing features."
User-level commands
Commands that work across ALL your projects go in your home directory:
~/.claude/ commands/ review.md → run with /user:review refactor.md → run with /user:refactor
For example, a personal /user:review command:
Review the code I just changed. Check for:
- Bugs or logic errors
- Missing error handling
- Security issues
- Performance problems
- Unclear naming
Be direct. If it looks good, just say "Looks good."User-level commands are great for encoding your personal code review standards, refactoring patterns, or documentation style — things that apply to every project, not just this todo app.
Commands with arguments
Custom commands can accept arguments using $ARGUMENTS in the template:
Review the file at $ARGUMENTS and check for:
- Type safety issues
- Missing edge cases
- Opportunities to simplifyThen run it with:
The filename gets substituted into the prompt.
The power move
By the end of this course, you'll have a .claude/commands/ folder with commands tailored to your exact workflow. Each one saves you from typing (and remembering) your best prompts. This is how power users work — they build tools for themselves.
Start with /today, /status, and /standup. As you notice yourself typing the same kind of prompt repeatedly, turn it into a command. Your future self will thank you.