How to Build Custom Slash Commands in Claude Code (Save 1 Hour/Day)

Опубликовано: 30 Июль 2026
на канале: Code With Harpreet
466
13

How to build custom slash commands in Claude Code — complete step-by-step tutorial. Create /pr, /fix, and /explain commands that automate pull request creation, lint error fixing, and
codebase understanding. Save over an hour of repetitive work every single day.

Tired of typing the same things in Claude Code every day? This video shows you how to create custom Claude Code commands to automate repetitive tasks like writing pull request
descriptions or fixing lint errors — a true boost for AI coding efficiency. By saving your frequently used prompts as markdown files, you can execute them with a simple command, making
your workflow smoother and helping you save time on development. This is one of the best automation tools for any developer looking to integrate more into their daily routine.

⏱ Timestamps:
0:00 — Why you need custom commands
0:20 — What are custom slash commands
0:35 — How to set up the commands folder
1:33 — Building /pr — auto pull request creation
3:15 — Building /fix — auto lint error fixing
5:05 — Building /explain — instant codebase understanding
7:00 — Advanced: $ARGUMENTS, global commands, team sharing
8:25 — 5 bonus command ideas
9:15 — What to build next

⚡ The 3 commands you'll build:
1. /pr — Reads git diff, writes PR title + description + test plan, pushes and creates PR on GitHub
2. /fix — Runs linter, fixes every error across all files, verifies zero errors remain
3. /explain — Reads entire project structure and writes complete architecture summary

🛠 How to create custom commands:
1. Create .claude/commands/ folder in your project
2. Add a markdown file (pr.md becomes /pr)
3. Write your prompt inside the file
4. Type the command in Claude Code — done

📁 Project commands: .claude/commands/ — shared with team via git
📁 Global commands: ~/.claude/commands/ — works in all projects
💡 Use $ARGUMENTS for dynamic input (e.g. /refactor src/utils.ts)

🎁 5 bonus commands:
• /deploy — tests, build, tag, GitHub release in one word
• /test — generate comprehensive tests for any function
• /review — code review without opening a PR
• /seed — realistic database seed data from your schema
• /morning — standup prep from git history

🔗 Claude Code docs: https://docs.anthropic.com/en/docs/cl...

📌 Day 3 of "30 AI Tools in 30 Days" — I'm posting a new AI tool every day for 30 days. Subscribe and turn on notifications so you don't miss Day 4.

💬 Drop a comment: which command are you building first?

#ClaudeCode #ClaudeCodeTutorial #AITools #CodingWithAI #VibeCoding #AICodingTools #DeveloperTools #Programming #CustomCommands #DeveloperProductivity #PullRequest #CodeAutomation
#AICodeGeneration #CodingTips