Reading about slash commands is useful. Having a folder full of them that actually work is better.
This article gives you ten real, complete slash command files you can copy into your .claude/commands/ folder right now. Each one solves a specific, common developer task. No placeholders, no “customize this to your needs” hand-waving — just files that work.
📋 TL;DR
– All ten commands below are complete and ready to copy
– Each one is a.mdfile you save inside.claude/commands/
– The filename becomes the command name —review.mdbecomes/review
– Start with 2–3 that match your workflow and add more over time
– You can modify any of these to match your team’s conventions
This is part of our complete Claude Code Slash Commands & Skills — Full Guide. If you’re not sure how to set up the commands folder, How to Create Your First Custom Slash Command covers the full setup process.
Before You Start
Every command below follows the same pattern:
- Create a file with the right name inside
.claude/commands/ - Paste the content from the example
- Call it with
/commandnamein Claude Code
If your .claude/commands/ folder doesn’t exist yet:
# Creates the commands folder in your current project
mkdir -p .claude/commands
Now, the commands.
1. /review — Code Review
File: .claude/commands/review.md
What it does: Reviews your code against a clear checklist and formats the output so it’s easy to scan.
# /review — triggers a structured code review
Review the code I'm working on. Use this checklist:
**1. Bugs and logic errors**
Flag any code that won't behave as intended. Include the line or function name.
**2. Unclear naming**
Point out any variable, function, or class names that don't clearly explain what they do.
**3. Edge cases**
Identify any inputs or conditions the code doesn't handle.
**4. One improvement**
Suggest exactly one change that would most improve this code.
Format your response using these four headers. Keep each section to 2–3 sentences max.
Be direct. No preamble.
2. /commit — Git Commit Message
File: .claude/commands/commit.md
What it does: Writes a properly formatted git commit message based on your current changes.
# /commit — writes a conventional commit message for the current changes
Write a git commit message for the changes I've described or shown you.
Follow the Conventional Commits specification:
<type>(<scope>): <description>
[optional body]
**Types:** feat, fix, docs, style, refactor, perf, test, chore
**Rules:**
- First line must be 72 characters or fewer
- Use the imperative mood: "add feature" not "added feature"
- Do not end the first line with a period
- Add a body only if the change needs context — explain WHY, not WHAT
- The scope is optional but helpful (e.g., auth, api, ui)
Output only the commit message. Nothing before it, nothing after it.
3. /explain — Explain This Code
File: .claude/commands/explain.md
What it does: Explains a piece of code in plain English — useful for onboarding, code archaeology, or unfamiliar libraries.
# /explain — explains the current code in plain English
Explain the code I've shared with you. Follow this structure:
**What it does** (1–2 sentences)
Plain English description of the code's purpose.
**How it works** (step by step)
Walk through what the code does in order. Use numbered steps. No jargon unless you define it.
**Key things to know**
Anything non-obvious: side effects, dependencies, gotchas, assumptions the code makes.
Assume I'm a developer who's comfortable with programming but unfamiliar with this specific code.
Don't talk down to me. Don't pad the explanation.
4. /docs — Write Documentation
File: .claude/commands/docs.md
What it does: Generates documentation for a function, class, or module in a consistent format.
# /docs — generates documentation for the code I share
Write documentation for the code I'm working on. Use this format:
**For functions/methods:**
/**
* [One-sentence description of what the function does]
*
* @param {type} paramName – Description of what this parameter is
* @returns {type} Description of what is returned
* @throws {ErrorType} When this error occurs (if applicable)
*
* @example
* // Concrete usage example
* functionName(exampleInput) // => exampleOutput
*/
**For classes:**
Include a class-level description, then document each public method using the function format above.
**Rules:**
- Use the language's native doc format (JSDoc for JS/TS, docstrings for Python, etc.)
- Every parameter must be documented
- Include at least one concrete example
- Don't document the obvious — add information the code itself doesn't make clear
5. /debug — Debug This Problem
File: .claude/commands/debug.md
What it does: Structures a systematic debugging session, pushing Claude to think through root causes before jumping to fixes.
# /debug — systematic debugging for the issue I describe
I have a bug. Help me debug it systematically.
Work through this process:
**1. Restate the problem**
In one sentence, what is the observed behavior vs. what should happen?
**2. Hypotheses**
List 3–5 possible root causes, most likely first.
**3. Diagnostic steps**
For each hypothesis, give me one specific thing I can do or check to confirm or rule it out.
**4. Most likely cause**
Based on what I've told you, which hypothesis do you think is most likely? Why?
Don't jump straight to a fix. Help me understand the problem first.
Ask me clarifying questions if you need more information before forming hypotheses.
6. /security — Security Review
File: .claude/commands/security.md
What it does: Reviews code specifically for security vulnerabilities and bad practices.
# /security — security-focused code review
Review the code I've shared for security issues. Check specifically for:
1. **Injection vulnerabilities** — SQL injection, command injection, XSS
2. **Authentication and authorization flaws** — missing checks, insecure defaults
3. **Sensitive data exposure** — credentials in code, unencrypted storage, logging secrets
4. **Input validation** — missing or insufficient validation of user-supplied data
5. **Dependency issues** — use of known-vulnerable packages or deprecated APIs
For each issue found:
- Name the vulnerability type
- Show the specific line or code pattern
- Explain the risk
- Suggest the fix
If you find nothing: say so clearly. Don't invent issues.
Rate the overall security posture: Low / Medium / High risk.
7. /test — Write Tests
File: .claude/commands/test.md
What it does: Generates test cases for the code you’re working on, including edge cases you might miss.
# /test — writes tests for the code I share
Write tests for the code I've shown you.
Follow this approach:
**Test coverage:**
- Happy path — the expected inputs and outputs
- Edge cases — empty values, nulls, boundary values, very large inputs
- Error cases — invalid inputs, what should throw or fail
**Format:**
Use the testing framework already present in the project. If you can't detect one, ask me which framework to use.
Write tests that:
- Have descriptive names that explain what is being tested
- Are independent from each other (no test depends on another)
- Test behavior, not implementation details
Output the test code only. No explanation unless I ask.
8. /refactor — Refactoring Suggestions
File: .claude/commands/refactor.md
What it does: Analyzes code and suggests specific refactoring improvements, with before/after examples.
# /refactor — suggests specific refactoring improvements with before/after examples
Analyze the code I've shared and suggest refactoring improvements.
For each suggestion:
1. Name the refactoring pattern (e.g., Extract Function, Replace Conditional with Polymorphism)
2. Show the BEFORE — the current code
3. Show the AFTER — the refactored version
4. Explain in one sentence why this is better
**Prioritize:**
- Changes that reduce duplication
- Changes that improve readability
- Changes that reduce complexity
**Don't suggest:**
- Changes that only affect style (spacing, naming conventions) unless they're causing confusion
- Premature optimization
- Rewrites that change behavior
Limit to the 3 most impactful changes. I'd rather have 3 great suggestions than 10 mediocre ones.
9. /standup — Daily Standup Summary
File: .claude/commands/standup.md
What it does: Converts notes or code context into a formatted standup update. Useful if you use Claude Code to track what you worked on.
# /standup — generates a standup update from my recent work
Based on the code and context in this session, write a standup update for me.
Format it exactly like this:
**Yesterday:**
[What I worked on — 2–3 bullet points, past tense, specific]
**Today:**
[What I'm planning to work on — 2–3 bullet points, present/future tense]
**Blockers:**
[Anything blocking me, or "None"]
Keep each bullet to one sentence. Be specific — reference actual features, bugs, or files where possible. No filler phrases like "continued work on" or "made progress on."
If you don't have enough context to write specific bullets, ask me what I worked on yesterday before writing.
10. /pr — Pull Request Description
File: .claude/commands/pr.md
What it does: Writes a complete pull request description based on the changes in the current session.
# /pr — writes a pull request description for the current changes
Write a pull request description for the changes I've made. Use this structure:
## What this PR does
[1–3 sentences. Plain English. What changed and why.]
## Changes made
[Bullet list of the specific changes. Be concrete — reference files or functions by name.]
## How to test
[Step-by-step instructions for a reviewer to verify this works. Start from zero — assume the reviewer doesn't know the context.]
## Screenshots / before & after
[If there are UI changes, note what screenshots should be added here. Otherwise write "N/A — no UI changes."]
## Notes for reviewers
[Anything the reviewer should pay special attention to, potential risks, or tradeoffs made.]
Write this as if a senior developer who knows the codebase will read it. Be precise, not fluffy.
How to Install All Ten at Once
To install all ten commands in your current project:
# Creates the commands folder and all ten command files at once
mkdir -p .claude/commands
cat > .claude/commands/review.md << 'EOF'
# /review — triggers a structured code review
Review the code I'm working on using a four-part checklist: bugs, naming, edge cases, and one improvement. Keep each section to 2–3 sentences. No preamble.
EOF
cat > .claude/commands/commit.md << 'EOF'
# /commit — writes a conventional commit message
Write a conventional commit message for my changes. Format: <type>(<scope>): <description>. First line under 72 chars. Imperative mood. Body only if needed. Output the message only.
EOF
In practice, it’s faster to create each file individually and paste the full content from this article. The above just shows the pattern is scriptable if you want to automate it.
Making Commands Your Own
These commands are starting points. The best command files are ones tuned to your actual work. Two things that make a command better:
Add your tech stack. Instead of “use the testing framework in the project,” write “use pytest with the fixtures pattern we use in /tests/conftest.py.”
Add your standards. Instead of “follow conventional commits,” write “follow conventional commits AND always include the Jira ticket number in the scope, e.g., feat(ENG-123): add login page.”
The more specific you make a command, the more useful it becomes — because Claude stops guessing and starts following.
💡 Pro Tip: Keep a running note of prompts you type more than twice. Those are your next slash commands.
Key Takeaways
- All ten commands above are ready to copy into
.claude/commands/and use immediately - Start with the 2–3 that match your most repeated tasks and build from there
- The filename is the command name —
review.md=/review - Customize each command with your tech stack and team conventions for better results
- Commit your
.claude/commands/folder to git so teammates get the commands automatically
Next Steps
- Learn to pass arguments:** How to Pass Arguments to Slash Commands and Skills
- Build a full code review command with more depth:** Creating a Code Review Slash Command (Tutorial)
- Keep your folder organized as it grows:** Organizing Your Commands Folder — Best Practices
Return to Claude Code Slash Commands & Skills — Full Guide for the full picture.