You just installed Claude Code and you're staring at a black screen with a blinking cursor? That's normal. Unlike traditional creation tools with buttons and menus, Claude Code works with text commands that you type directly. These commands, called slash commands because they start with /, let you create files, modify code, launch applications, and much more. This guide presents the 20 essential commands to get started, with concrete usage examples.

What are the basic commands for creating files?

The three commands /create, /edit, and /delete let you manage all your files in Claude Code. These are the foundations of your daily workflow.

The /create command generates a new file. You simply type /create index.html and Claude Code creates this file with a basic structure. If you specify the type of content you want, the assistant adapts the file: /create style.css for a recipe website generates a CSS file with relevant classes for your project.

The /edit command modifies an existing file. For example, /edit index.html add a red button in the top right transforms your HTML file without you touching a single line of code. Claude Code understands your request in natural language and applies precise changes.

The /delete command removes a file: /delete old-test.js permanently removes this file from your project. Be careful—this action is irreversible.

These three commands cover 80% of your daily work on Claude Code. You create, you adjust, you clean up. The rest of the commands complement this basic trio.

How do you visualize and test your application in real time?

The /preview command launches a real-time preview of your application in your browser. It's the equivalent of the "Play" button in traditional software.

When you type /preview, Claude Code starts a local server and automatically opens your browser to localhost:3000 (or another available port). Every change you make afterward is visible instantly, without manually refreshing the page.

The /stop command stops this preview server. Useful when you want to free up resources or switch projects.

The /restart command relaunches the server. Sometimes, after installing a new library or modifying configuration files, you need to restart for changes to take effect.

These three commands form the development cycle: you launch your preview, you test, you adjust, and sometimes you restart. According to Anthropic research, developers using Claude Code spend 40% less time switching between editor and browser thanks to this seamless integration.

What commands make navigating your code easier?

The commands /find, /goto, and /search let you move quickly through your project, even with dozens of files.

The /find filename command locates and opens a specific file. For example, /find header.js takes you directly to the file containing your header code. No more digging through the file tree.

The /goto line-42 command positions you at a specific line in the currently open file. Very handy when Claude Code flags an error at line 127: you type /goto 127 and you're there.

The /search keyword command searches for a term across all files in your project. If you're looking for where you used the calculateTotal function, you type /search calculateTotal and Claude Code lists all occurrences with their context.

These navigation commands become essential once your project exceeds 5-6 files. Instead of scrolling manually, you arrive directly where you need to work.

How do you install and manage external libraries?

The /install command adds third-party libraries to your project, like React, Vue, or CSS utilities. It's like an app store for your code.

When you type /install react, Claude Code downloads the React library and automatically configures your project to use it. You don't need to understand npm, yarn, or package.json files: the assistant handles the technical plumbing.

The /uninstall command removes a library: /uninstall jquery removes jQuery from your project and cleans up references in your configuration files.

The /list-packages command displays all libraries installed in your project. Useful for taking stock of what you're actually using.

According to Anthropic usage data, 73% of beginners use /install within their first 10 minutes with Claude Code. It's often the first "magic" command that makes them realize the tool's power: installing a complex library in one sentence.

What commands help you debug and fix errors?

The commands /debug, /fix, and /explain transform cryptic error messages into concrete solutions.

The /debug command analyzes your code for potential errors. Claude Code examines logic, data types, missing references, and flags problems before you even test your application.

The /fix error-message command automatically corrects an error. If your browser displays "Uncaught ReferenceError: calculateTotal is not defined", you copy this message and type /fix Uncaught ReferenceError: calculateTotal is not defined. Claude Code identifies the problem (misnamed function, forgotten import) and applies the fix.

The /explain code-snippet command breaks down a piece of code into simple language. If you don't understand a function Claude Code generated, you select the code and type /explain. The assistant details line by line what's happening.

These debugging commands drastically reduce time spent hunting for bugs. Instead of spending 30 minutes on Stack Overflow, you get a contextualized solution in seconds.

How do you organize and document your project?

The commands /comment, /doc, and /structure keep your code clean and understandable long-term.

The /comment this-file command automatically adds explanatory comments to your code. Claude Code inserts annotations that describe what each section does, without cluttering readability.

The /doc generate-readme command creates a README.md file that explains your project: objective, main files, how to launch the application. Essential if you share your code or return to it after a few weeks.

The /structure command displays your project's complete file tree as a visual diagram. You see at a glance how your folders and files are organized.

The /rename old-name new-name command changes a file's name everywhere it's referenced. If you rename utils.js to helpers.js, Claude Code updates all imports automatically.

These organization commands seem secondary at first, but they become crucial when you return to a project after a break. Well-documented code can be picked up in 5 minutes; code without structure might take an hour to rediscover.

How do you optimize and improve your existing code?

The commands /optimize, /refactor, and /test improve code quality without rewriting it entirely.

The /optimize command analyzes your code to make it faster and lighter. Claude Code identifies inefficient loops, unnecessary loads, repetitions, and suggests optimized versions. For example, if you're loading a large 5 MB image, /optimize might suggest compression or lazy loading.

The /refactor this-file command restructures your code to make it more readable and maintainable, without changing its behavior. If you've written a 200-line function with 8 levels of indentation, /refactor breaks it into small, clear functions.

The /test command generates automatic tests to verify your code works correctly. Claude Code creates test scenarios that simulate using your application and detect regressions.

These continuous improvement commands transform a working prototype into a professional application. They also teach you development best practices: you see how Claude Code optimizes, and you gradually integrate these reflexes.

Conclusion

These 20 commands cover the essentials of what you'll do with Claude Code daily. You don't need to memorize them all on day one: start with /create, /edit, /preview, and gradually add the others to your toolkit. The advantage of Claude Code is that you can also chat in natural language: if you forget a command, simply ask "how do I..." and the assistant will guide you. To go deeper, check out our complete beginner tutorial that shows you how to build your first application step by step.