DEV Community

Carlos Oliva Pascual
Carlos Oliva Pascual

Posted on • Originally published at stacknotice.com

Claude Code Custom Slash Commands (2026): Automate Your Repetitive Workflows

Claude Code has built-in slash commands. Most devs stop there.

You can create your own — any workflow you repeat becomes a one-word command.

Full guide at stacknotice.com/blog/claude-code-custom-commands-2026

How it works

Create .claude/commands/ in your project root. Each file becomes a slash command:

.claude/commands/review.md      →  /review
.claude/commands/add-tests.md   →  /add-tests
.claude/commands/deploy-check.md →  /deploy-check
Enter fullscreen mode Exit fullscreen mode

The file content is the prompt. No special syntax needed.

Your first command

<!-- .claude/commands/review.md -->
Review the current changes.

Check:
- Auth before any DB mutation
- Zod validation on all inputs
- CLAUDE.md convention compliance
- Error handling on async operations

Numbered list, file:line. Skip style and naming.
Enter fullscreen mode Exit fullscreen mode

Now just type /review in any session.

Using $ARGUMENTS

<!-- .claude/commands/add-tests.md -->
Add tests for $ARGUMENTS.

Use Vitest. Happy path + one edge case + one error case.
Test behavior, not implementation. Match existing test style.
Enter fullscreen mode Exit fullscreen mode
> /add-tests src/lib/stripe/webhooks.ts
Enter fullscreen mode Exit fullscreen mode

Commands worth building immediately

/deploy-check — run before every deploy:

We're about to deploy to production.
Flag anything you would not ship right now.
One sentence per issue, most critical first.
If safe: say "Ready to deploy" and nothing else.
Enter fullscreen mode Exit fullscreen mode

/security — focused security audit:

Security review of $ARGUMENTS.
Check: missing auth, ownership verification, unvalidated inputs, exposed secrets.
Issues only. No compliments.
Enter fullscreen mode Exit fullscreen mode

/commit — generate commit messages:

Write a git commit message for staged changes.
Imperative mood, max 72 chars. Describe what changed and why.
Output the message only — don't run the commit.
Enter fullscreen mode Exit fullscreen mode

Share with the team

git add .claude/commands/
git commit -m "add team Claude Code commands"
Enter fullscreen mode Exit fullscreen mode

Every dev gets the same commands on pull. One push, team-wide consistency.

Personal vs project commands

  • Project: .claude/commands/ — this repo only
  • Global: ~/.claude/commands/ — all your projects

Project commands override global ones if names match.


Full guide with more examples at stacknotice.com/blog/claude-code-custom-commands-2026

Top comments (1)

Collapse
 
marouaneks profile image
Marouane K

Hey stacknotice, I'm interested in automating repetitive workflows. Clypify's AI-powered content tools can help you streamline your content workflow and save time. Free plan at clypify.com — no card needed.