{"componentChunkName":"component---src-templates-section-tsx","path":"/claude-code-slash-commands","result":{"data":{"section":{"title":"Slash Commands in Claude Code","subtitle":"How to Build and Use Slash Commands in Claude Code","slug":"claude-code-slash-commands","videoDuration":291,"releaseDate":null,"tags":["Claude code","slash commands","custom commands","workflow automation","create slash commands","coding shortcuts","developer productivity","markdown commands","Claude tutorial","ai coding tools"],"contentful_id":"4htmN8qCm8tLwVlnpbyhqK","isFree":false,"illustration":null,"source":null,"colors":null,"chapter":[{"title":"Claude Code Crash Course on Agentic Workflows","slug":"claude-code","hoursOfVideo":1,"description":{"description":"This course teaches you how to use Claude Code efficiently with slash commands, hooks, parallel workflows, and more. You’ll learn the mindset of working with AI, simplify repetitive tasks and connect tools into one unified agentic workflow, giving you everything you need to go from idea to working app."},"logos":[{"fixed":{"src":"//images.ctfassets.net/ooa29xqb8tix/1bYdUtniEAUH3jdqQd3Qc1/7cf21d20882bfe59f01d7bc74e81010d/react-logo.png?w=400&q=50"}},{"fixed":{"src":"//images.ctfassets.net/ooa29xqb8tix/39xkJS0CvrRBKgMnyLYBks/14d434f819fef062dce8c72efecbc74d/react-logo.png?w=400&q=50"}}],"instructors":[{"name":"Vanh Roeung","slug":"instructor/vanh","avatar":{"fluid":{"src":"//images.ctfassets.net/ooa29xqb8tix/2anEzU2n2tP4f0kSZCLWb2/0358b4770ab46ed28f961cfb81a09b3b/Screenshot_2025-08-22_at_11.29.49â__AM.png?w=200&h=200&q=50"}}}],"illustration":{"file":{"url":"//images.ctfassets.net/ooa29xqb8tix/304Tlb60pUSlhG8CMC5gUf/4bc2717aad54e15dd68d275520eb06d8/claude-code.svg"}},"illustrationConverted":{"fixed":{"src":"//images.ctfassets.net/ooa29xqb8tix/76YCbDJok71emzDKE43HtK/7383feb1723d2f7e52a76fa4f0186f1a/claude-code.png?w=400&q=50"}},"colors":["#171515","#322E2E"],"sections":[{"title":"Introduction on Claude Code","subtitle":"Getting Started with Claude Code CL","slug":"claude-code-introduction","videoDuration":116,"releaseDate":null,"tags":null},{"title":"Beat Context Pruning & Pick the Perfect Anthropic Plan","subtitle":"Running Claude Code Directly for Full-Context","slug":"claude-code-beat-context-pruning","videoDuration":491,"releaseDate":null,"tags":null},{"title":"Why the Terminal Matters: The Foundation for Claude Code and CLI Tools","subtitle":"Command Line Crash Course: Unlocking Claude Code’s Power","slug":"claude-code-why-the-terminal-matters","videoDuration":600,"releaseDate":null,"tags":null},{"title":"How to Safely Resolve npm Permission Errors Without sudo","subtitle":"Why You Shouldn’t Use sudo for npm Installs","slug":"claude-code-how-to-safely-resolve-npm-permission-errors-without-sudo","videoDuration":443,"releaseDate":null,"tags":["npm permission","sudo","npm installs","error fix"]},{"title":"Using Claude Code’s /init and claude.md Effectively","subtitle":"Customizing Your Project Guide","slug":"claude-code-using-claude-codes-init-and-claude-md-effectively","videoDuration":277,"releaseDate":null,"tags":["Claude code","init","claude.md","customizing Claude.md","project guide","ai coding assistant","Claude setup","claude workflow","next.js project","terminal commands"]},{"title":"Navigating Your Project with Claude Code","subtitle":"Finding and Understanding Feature Implementations","slug":"claude-code-navigating-your-project-with-claude-code","videoDuration":241,"releaseDate":null,"tags":["Claude code","codebase navigation","feature implementation","developer onboarding","code exploration","ai coding tools","code understanding","project navigation","software development","claude ai"]},{"title":"Using Claude Code in the Terminal and IDE","subtitle":"Setting Up the Claude Extension in VS Code, Cursor, or Windsurf","slug":"claude-code-using-claude-code-in-the-terminal-and-ide","videoDuration":262,"releaseDate":null,"tags":["claude code","terminal workflow","ide integration","vs code","cursor editor","windsurf","ai coding assistant","code setup","developer productivity","coding tools"]},{"title":"Slash Commands in Claude Code","subtitle":"How to Build and Use Slash Commands in Claude Code","slug":"claude-code-slash-commands","videoDuration":291,"releaseDate":null,"tags":["Claude code","slash commands","custom commands","workflow automation","create slash commands","coding shortcuts","developer productivity","markdown commands","Claude tutorial","ai coding tools"]}],"releaseDate":"2025-09-01","isFreeCourse":false,"isFeatured":true,"tags":["Claude Code","terminal","slash commands","hooks","parallel workflows","agentic workflows"],"promoUrl":null,"contentType":"Course","source":null}],"author":[{"name":"Vanh Roeung","jobTitle":"Developer","twitterHandle":"@VanhDesign","biography":{"biography":"Developer at Design+Code"},"avatar":{"fluid":{"src":"//images.ctfassets.net/ooa29xqb8tix/2anEzU2n2tP4f0kSZCLWb2/0358b4770ab46ed28f961cfb81a09b3b/Screenshot_2025-08-22_at_11.29.49â__AM.png?w=200&h=200&q=50"}},"location":"Montreal, Canada","slug":"instructor/vanh","chapter":[{"title":"Claude Code Crash Course on Agentic Workflows","slug":"claude-code","hoursOfVideo":1,"description":{"description":"This course teaches you how to use Claude Code efficiently with slash commands, hooks, parallel workflows, and more. You’ll learn the mindset of working with AI, simplify repetitive tasks and connect tools into one unified agentic workflow, giving you everything you need to go from idea to working app."},"logos":[{"fixed":{"src":"//images.ctfassets.net/ooa29xqb8tix/1bYdUtniEAUH3jdqQd3Qc1/7cf21d20882bfe59f01d7bc74e81010d/react-logo.png?w=400&q=50"}},{"fixed":{"src":"//images.ctfassets.net/ooa29xqb8tix/39xkJS0CvrRBKgMnyLYBks/14d434f819fef062dce8c72efecbc74d/react-logo.png?w=400&q=50"}}],"releaseDate":"2025-09-01"},{"title":"Master Agentic Workflows","slug":"agentic-workflows","hoursOfVideo":2,"description":{"description":"In this course, you’ll learn how to add agents to your workflows. An agent workflow is more than just a simple automation. Instead of following a fixed script, agents can make decisions, adjust to changes, and figure out the best way to complete a task. We’ll start by exploring what MCP servers are and all the new possibilities they bring. Then, we’ll dive into agentic frameworks that make it easy to build flexible, helpful agents that can take care of your everyday tasks."},"logos":[{"fixed":{"src":"//images.ctfassets.net/ooa29xqb8tix/7bIHb2z3qClO9GfyPwj6nP/4cb3a08cdc0d34645540b1295f96dc67/Logo_React.png?w=400&q=50"}},{"fixed":{"src":"//images.ctfassets.net/ooa29xqb8tix/7bIHb2z3qClO9GfyPwj6nP/4cb3a08cdc0d34645540b1295f96dc67/Logo_React.png?w=400&q=50"}}],"releaseDate":"2025-04-29"},{"title":"Build a React Native app with Claude AI","slug":"react-native-ai","hoursOfVideo":14,"description":{"description":"This comprehensive course explores the integration of cutting-edge AI tools into the React Native development workflow, revolutionizing the approach to mobile application creation. Participants will learn to leverage AI-powered platforms such as Claude and Locofy to expedite coding processes, enhance problem-solving capabilities, and optimize productivity."},"logos":[{"fixed":{"src":"//images.ctfassets.net/ooa29xqb8tix/66irryXYcTuNVwWnuuzYz5/6097d6a5f5bf4d44678566034879d2a1/logo-react-native.png?w=400&q=50"}},{"fixed":{"src":"//images.ctfassets.net/ooa29xqb8tix/66irryXYcTuNVwWnuuzYz5/6097d6a5f5bf4d44678566034879d2a1/logo-react-native.png?w=400&q=50"}}],"releaseDate":"2024-09-17"}]}]},"en":{"title":"Slash Commands in Claude Code","subtitle":"How to Build and Use Slash Commands in Claude Code","excerpt":{"markdown":{"html":"<p>One of Claude Code’s most powerful features is the ability to create and use <strong>slash commands</strong>. These are essentially shortcuts that package prompts and workflows into reusable commands you can trigger at any time. Think of them as templates for your development workflow, consistent, repeatable, and easy to share with teammates. This section will guide you through what slash commands are, why they’re useful, and how to create your own.</p>","excerpt":"One of Claude Code’s most powerful features is the ability to create and use slash commands. These are essentially shortcuts that package…"}},"content":{"markdown":{"htmlAst":{"type":"root","children":[{"type":"element","tagName":"h2","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"What Are Slash Commands?"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"A slash command is a special instruction you give to Claude Code that begins with a /. These commands can:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Control Claude’s behavior"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Trigger specific actions"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Accept arguments, making them flexible for different contexts"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Claude Code already comes with several "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"built-in slash commands"}]},{"type":"text","value":" for common tasks. For example:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"/clear → resets the current conversation"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"/config → updates your settings"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"/memory → manages Claude’s memory"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"/help → lists all available commands"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"/status → shows system and account status"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"These built-ins are useful, but the real power comes from creating your own custom commands."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Custom Slash Commands"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Custom slash commands are "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"user-defined"}]},{"type":"text","value":" commands. You create them yourself, usually to save frequently used prompts or automate multi-step workflows. Each custom command is stored as a simple "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Markdown file"}]},{"type":"text","value":" that Claude Code can execute."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Here’s why this is a game-changer:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Any repetitive or structured task can be turned into a slash command."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"They adapt to your personal workflow or your team’s processes."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"They make prompts "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"consistent, reusable, and shareable"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"For example, instead of typing out a long request every time you want Claude to review code for performance issues, you can just type /optimize and instantly run that workflow."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Types of Slash Commands"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"There are two main types of slash commands:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ol","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Project-specific commands"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"These live in your project’s repository."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"They can be shared with teammates when the repo is committed."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Great for team workflows, code reviews, or documentation tasks."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"User-specific commands"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"These live outside of a single repo."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"They’re tailored to your personal workflow and available across projects."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In this lesson, we’ll start with "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"project-specific commands"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Creating Your First Project-Specific Command"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Let’s walk through building a simple custom command."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Step 1: Create the Commands Directory"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Claude Code looks for commands inside a special folder:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"text"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-text"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":".claude/commands"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If it doesn’t exist yet, create it in the root of your project—either manually in your editor or with a terminal command."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Step 2: Add a Markdown File"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Each custom command is just a Markdown file in that folder. The "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"file name becomes the command name"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"For example, to create a command named /optimize:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"text"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-text"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":".claude/commands/optimize.md"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Step 3: Define the Command Prompt"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Inside optimize.md, you can write the actual instructions for Claude Code. For instance:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"text"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-text"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":"Analyze this code for performance issues and suggest optimizations."}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"That’s it—you’ve created your first command. You can make it more specific, like analyzing the entire project, a particular file, or a single function. The prompt is fully customizable."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Step 4: Run the Command"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Once your session is running in Claude Code, new commands are detected automatically. If not, you may need to restart the session."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"To use the command, just type:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"text"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-text"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":"/optimize"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Claude will execute the Markdown prompt as if you had typed it directly."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Why This Matters"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Slash commands act like "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"prompt templates"}]},{"type":"text","value":". They save time, reduce errors, and keep workflows consistent. You can create commands for:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Reviewing code"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Running security audits"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Generating documentation"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Refactoring or testing"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Any structured or repetitive task"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"When stored in a project repo, these commands can be shared with teammates—so everyone benefits from the same automated workflows."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Summary"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Slash commands are reusable shortcuts that begin with /."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Claude Code has built-in commands, but you can also create your own."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Custom commands are stored as Markdown files in .cloud/commands/."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"The file name becomes the command name."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Perfect for automating repetitive tasks and sharing workflows across a team."}]},{"type":"text","value":"\n"}]}],"data":{"quirksMode":false}}}}},"contentfulChapter":{"test":null,"metadata":{"title":"Claude Code Crash Course on Agentic Workflows","slug":"claude-code","description":"This course teaches you how to use Claude Code efficiently with slash commands, hooks, parallel workflows, and more. You’ll learn the mindset of working with AI, simplify repetitive tasks and connect tools into one unified agentic workflow.","keywords":"claude code, agentic workflow, slash command, hooks, parallel workflows, ","image":"https://www.dropbox.com/scl/fi/nlvmlv8l7ss5wr2blrwzk/claude-code.jpg?rlkey=blzzwn00ujon53e0xlwwswxa6&dl=0"}},"contentfulMetadata":{"title":"Claude Code Crash Course on Agentic Workflows","slug":"claude-code","description":"This course teaches you how to use Claude Code efficiently with slash commands, hooks, parallel workflows, and more. You’ll learn the mindset of working with AI, simplify repetitive tasks and connect tools into one unified agentic workflow.","keywords":"claude code, agentic workflow, slash command, hooks, parallel workflows, ","image":"https://www.dropbox.com/scl/fi/nlvmlv8l7ss5wr2blrwzk/claude-code.jpg?rlkey=blzzwn00ujon53e0xlwwswxa6&dl=0"}},"pageContext":{"slug":"claude-code-slash-commands","contentType":"Courses","isCourse":true,"isLivestream":false,"isTutorial":false,"chapterSlug":"claude-code"}}}