2026-06-07
You type the same things into Claude Code repeatedly — "summarise what's changed since last session," "write a git commit message for staged files," "check this for security issues." Custom slash commands let you store those prompts once and call them with a short keyword.
Slash command — a /keyword you type in Claude Code's input box. Built-in ones like /clear are baked into the tool. Custom ones are yours to define.
.claude/commands/ — the folder Claude Code watches for your custom command files. One file = one command.
Custom slash commands are just Markdown files. Claude Code reads the file's contents and uses it as the prompt when you invoke the command. There is no special syntax to learn and no configuration file to update. You write the file, and the command exists.
The command name is the filename minus the .md extension. A file called standup.md becomes /standup.
Create the folder if it doesn't exist:
New-Item -ItemType Directory -Path .claude\commands -Force
Write a command file. Here's a practical example — a daily standup briefing:
New-Item -Path .claude\commands\standup.md -ItemType File
Contents of standup.md:
Look at the git log for the last 24 hours and any uncommitted changes.
Produce a brief standup summary in this format:
**Done:** what was completed
**In progress:** what is currently open or staged
**Blockers:** anything that looks stuck or broken
Keep each section to two or three bullet points. Plain English, no jargon.
Save the file. In your next Claude Code session, type /standup and press Enter. Claude reads the file and runs that prompt against your current project context.
Scope matters. Commands in .claude/commands/ inside a project folder are project-specific — they only appear when you're working in that directory. If you want commands available everywhere, put them in your user-level folder instead:
# Windows user-level commands
New-Item -ItemType Directory -Path "$env:APPDATA\Claude\commands" -Force
Reach for custom commands when you find yourself typing the same prompt more than twice in a week. Good candidates: commit message generation, code review checklists, changelog drafts, security scans, test coverage prompts.
Skip them when the prompt changes significantly every time you use it — a command that needs heavy editing before each run isn't saving you effort. For those, keep the prompt in an Obsidian note and paste it in directly.
Don't put secrets or environment-specific paths in command files if the .claude/ folder is committed to a shared repo. Either add .claude/commands/ to .gitignore or keep sensitive prompts in your user-level folder.
Pick one prompt you've typed more than once this week. Create .claude/commands/ in your current project, write that prompt as a .md file, and test it in Claude Code. The whole thing takes under five minutes and you'll have a reusable shortcut from that point on.
Don't miss what's next. Subscribe to My Claude Daily Learning: