To work on a codebase with Claude Code, type a slash command at the prompt, such as /help or /clear, to run a built-in action. You can also create commands to reuse your own instructions. These shortcuts help with recurring tasks, such as reviewing changes or applying a project’s coding conventions.
Claude Code runs in the terminal, IDE extensions, desktop app, and web. Its slash commands vary by version and environment, so use /help or type / in your current session to see what is available. The Claude Code overview describes its supported surfaces and coding tasks.
Use built-in commands for session tasks
Built-in commands help you manage a Claude Code session, check settings, and use tools. For example, /clear starts a fresh conversation, /compact reduces the conversation context, and /model lets you select a model. Commands such as /init, /memory, and /permissions help you work with project instructions and access settings.
Other commands include /context, /cost, /resume, /add-dir, /doctor, and /mcp. The exact set depends on the Claude Code version and environment. This is a sample command list. Check the official command reference or type / to inspect your session.
Some commands require extra setup or access. For example, a command that interacts with GitHub requires the relevant command-line tools and session configuration. Read its description before using it.
Create a command for recurring work
A custom slash command stores reusable instructions in a Markdown file. Store project commands in .claude/commands/ in the repository so others who work there can use them. Store personal commands in ~/.claude/commands/ for your own use. The custom-command documentation describes supported locations and behavior.
For example, a file named .claude/commands/review.md can hold instructions for reviewing code. You can then call the command with /review. To pass text into a command, include $ARGUMENTS in its instructions. For separate arguments, use $0, $1, and subsequent numbered placeholders.
A command file might say:
Review the changes in $ARGUMENTS for correctness and missing tests. Report findings with file and line references. Do not edit files.
Then you could call /review src/auth.ts. Clear limits help keep a reusable command focused. Specify whether Claude should edit files and define what it should inspect. Also say what form the response should take. Vague instructions can lead to unnecessary changes or work beyond the task.
If Claude Code reports “Unknown slash command,” first check the file path and name, then confirm that your version discovers commands from that location. A reported discovery issue affected a specific version, and success elsewhere does not establish that every installation loads the command.
Choose commands and skills based on the task
Use a built-in command when you need a session action, such as changing a setting or clearing context. Create a custom command to reuse specific instructions. For instructions that need supporting files or a broader structure, Claude Code also documents skills. Commands and skills serve related purposes. Follow the format documented for your version because their setup and behavior vary.
Review commands carefully when they trigger side effects, such as committing or deploying code. State the action and its limits plainly, and review the command before running it. For a command that should require an explicit user action, check the current documentation for controls that prevent Claude from invoking it on its own.