Transcript for:
Claude Code Commands Overview

hey everyone If you're new to Claude Code you might feel overwhelmed by all the commands available and wonder what they all do So in this video I'll walk you through all the commands that Clawco has and show you what they do and how to use them effectively I'm going to assume you already have Claw Code installed Let's get started The first command is the bug command Since Clawude Code is still a relatively new tool the team at Enthropic is actively building and improving it And like any evolving product that means bugs can pop up If you come across a bug while coding you can use the /bug command to report it directly to the team It's a simple way to contribute and just improve the platform What's really cool is that Anthropic also maintains a public GitHub page for cloud code and this is a page where you can see all the current issues that are being tracked as well as feature requests and any bugs It's very active and you'll often see the actual Cloud Code developers engaging with users here talking through issues bugs and features So if you're interested in the development of Cloud Code this is a great place to get involved in Next up is the clear command and it's probably the most important command in Claude Code So if there's one command to know it's this one What clear does is that it clears out your entire current chat conversation all the context and starts a brand new conversation So why is this such a big deal It's because large language models are stateless That means they don't actually remember past messages between chats Instead every time you send a message in the same conversation window Claude reprocesses the entire conversation history to understand the context So let's just break this down with a simplified example Let's say you send message one which costs 1,000 tokens Then you send message 2 which on its own costs 500 tokens You would think message 2 would only cost 500 tokens But that's not how it works Because LLMs are stateless the model doesn't remember anything you sent in message one And because you are still in the same chat window the model assumes that every message you sent before is still relevant So what the model will do is that it will send all of message one again plus message 2 So in reality message two actually costs 1,500 tokens So if you send message three the actual token cost is going to be message one plus message 2 plus message 3 So you can see that with every follow-up message you send within the same chat window each message is going to cost more and more tokens Which means if you have these super long chat windows with Claude you will quickly use up all your tokens And that's where this clear command comes in So in this example I have a long conversation going on It's just pages and pages and pages So every new message you send in here is also going to send all of this as part of the input and you don't want that So when you run /clear what this is going to do is that it's going to clear up all this context and start a brand new chat So now you can see that once I ran it there's no more context right So if I scroll up there's nothing left All that context has been cleared up and now we have a brand new chat So now your next message you send will be sent without the entire previous context And this helps reduce unnecessary token usage So when should you use this clear command You want to use this command as often as possible A good rule of thumb is to run it whenever you finish a task You don't want multiple unrelated task piling up in the same chat because that's just going to blow it up your token count and make responses less focused And just a quick note this is a simplified example and I do have a video that goes into more depth on how to optimize your token usage and how Claudeco calculates all of it So if you're interested go check it out I'll link it in the description below Next up is the compact command The compact command is one of Claude Code's tools for managing token usage Similar to clear but with a different approach While clear wipes out your chat history completely and starts from scratch compact helps you reduce token usage by summarizing your conversation and starting a new chat with that summary It's a way to keep important context without carrying every message forward And this is how it works When you run slash compact Claude takes your entire current conversation and creates a summary of it and starts a new chat window with that summary preloaded Now by default if you were just to run /compact what this is going to do is it's going to create a summary of your entire conversation So everything you have in your current conversation it's going to take that entire thing and summarize it And just another thing to note here when Claude code reaches 95% capacity so when this thing right here says there's only 5% left it's going to auto compact your conversation So this is Claude Code's way to help you out Now this default way of compacting is fine in many cases but sometimes it's not what you want You can actually customize what Claude summarizes by adding specific instructions So for example if I was just to do /compact you can see that I have this optional custom summarization instructions So I can say things like summarize just the to-do items And this will summarize all the to-do items I have within my current conversation And I can maybe say summarize only the last conversation because maybe that's the only thing that's relevant So Claude Code is just going to go through here find my last conversation and just summarize it Or I can say something like keep the summary to a max of 500 words or something And this is going to further limit what Claude code summarizes So there's a lot of different ways to provide what summary you want to Claude So let's just say for this example I just want to say summarize the last conversation So what this is going to do is Claude's going to read my last conversation provide a summary of it open it up and then preload it So just give it a few seconds and let's see what happens Okay so it looks like claw code has finished summarizing my conversation And you can see right here this is that summary So this is my previous conversation compacted right It read through a bunch of stuff and it provided summary So if I was just to hit CT controllr this will show me what it summarized So this is the summary So now when I continue this conversation this is the only thing that's going to be part of my context It's no longer going to be the entire previous conversation And what's even better is I have a summary of my previous conversation So I can just quickly pick up where I left off Next up is the config command So this command lets you customize Claude codes behavior to fit how you like to work Let's walk through each option and show you what it does So let's go to cloud code and write /config And in here this is where you will find all your settings So the first item is this autocompact This setting controls whether clawed code will automatically compact your conversation once it reaches 95% capacity So remember in the compact command that we saw previously we had that little status indicator at the bottom So when that status indicator reaches 5% claw code will autoco compact And this is the setting that determines if you want it on or off Now I recommend you leaving this on so you don't have to worry about hitting your limit and having everything just break Next up is the use to-do setting This is one of the key reasons Claude Code feels more focused and effective compared to other AI coding tools When you ask Cloud Code to build a new feature Claude Code automatically creates a internal to-do list and follows that list step by step This helps it stay on track even as the task gets complex This is important because LLMs tend to lose focus in long conversations but with a to-do list clawed code keeps its objectives clear and avoids getting lost in the details So I 100% recommend you keep the setting as true So let me show you what I mean with this to-do list I'm just going to exit out of here I am in this Anoax directory and I am just going to ask Claude code to create a new feature to allow users to add multiple animals via a endpoint So I'm just going to let this run and show you that to-do list Okay so now that it finished running let me show you Claude Code's thinking process So if I scroll to the top this is the request that I asked Cloud Code to do just to create a new API endpoint So this right here is a to-do list that Claude Code is creating internally Now remember I did not ask Claude code to create any to-do list This is simply something that Claude Code has created internally And this is just saying hey the first thing that we should do is explore the codebase Then the second thing to do is design the new endpoints and so on and so on So the first step is to explore the codebase So you can see here it does that right here Let's explore the code structure So it goes through here It reads a bunch of files right So now that it finished reading it finished that first item So now it's going to update that to-do list You can see in this update to-do list that first item is now complete So what's the next step Well the next step is to design that new endpoint Okay So what is it going to do Well I am going to create a new schema for it cuz that's designing it right So now it is here and this is going to ask it to make some edits to the animal py file that I have So you can see that claude code is following this to-do list and it's a really cool way for cloud code to keep focus on what it needs to do So going back to the config I 100% recommend you keep this as true Next is the verbose output If you enable this it's going to show you all of Claude's thinking process like what files it's searching through what functions it's reading and so on This is great if you are someone who wants full visibility into the model's decision making But a heads up if you enable this it will literally output you the entire files content in your chat window So if your file content is a,000 lines of code it is literally going to print out a,000 lines of code for you So what I recommend you do is to keep the setting as false which is the default setting And if you need to dig into its thinking process you can actually click CtrlR and that will toggle the verbose view on and off whenever you need it So the next one is theme This one is simple Just choose between light mode or dark mode So just click on it you can choose all the different types of modes you want I'm just going to keep mine on light mode Next is notification Just keep this as auto Next is this editor mode So you have normal and vim If you know what vim is and want to use vim style key binding inside claude code you can switch to vim here Otherwise don't worry about it And the last setting is model This setting lets you choose which model claude code is going to use So by default cloud code is going to use this setting And that means that claude code is going to use opus 4 and automatically switch to sonnet 4 when needed But if you want you can specify a model you want here manually For example if you want to only use Opus 4 then just click on this If you only want to use Sonnet 4 just click on this So this is just a way to switch models And just a note here Opus 4 is only available for max plan users So if you're a pro plan user you won't have this option And the default option actually defaults to Sonnet 4 So let's just say I want to use Sonnet 4 Hit this and it's going back to Sonnet And that's it for the config command The next command is the cost command So this command shows you how much you have spent using clawed code But this is only if you are using the API version If you're on the max or the pro plan this command won't return any data since those plans don't track cost the same way But if you're using the API version if you just do /cost this is just going to tell you how much you have used so far in your session So it's a pretty good way just to keep track of all your cost The next command is the doctor command and it's a simple diagnostic tool It checks whether your cloud code installation is working properly So if we type /docctor this is mostly just going to tell us whether clawed code has the necessary npm permissions to function properly This is just a quick way to confirm everything's configured correctly especially if you are troubleshooting The help command is exactly what it sounds like So if we just do /help it gives you a full list of all the available commands in clawed code along with a short description of what each one does So if we scroll up we can kind of see that these are all the commands that are available to us along with a short description of what they do And if you're just getting started definitely make use of it The init command is your project starting point in Claude Code When you run it Claude scans your entire codebase reading every single file and generates a file called claw.md So let's do that right now for the codebase I'm in So right now I'm in claw code and I am in this animal fax directory So let's just run /init and see what happens And this command is going to take a while because it's going to read through every single file Okay so now that it finished you can see that this is that file that it's going to generate for you So let's just hit yes and it's going to create that claw tomb file So just hit yes and it's going to write that file to your codebase Okay So now that it finished let me open up VS Code And this right here is that new file that just got created And within this file you will find a high-level summary of your project So what it does how it's structured key components important functions and so on So if we look at this cloud md file that was created in my case I can see that we have some stuff in terms of our development commands we have stuff on our architecture overview how the project is structured what key components there are so there's a lot of high-level summary within this file and it's very helpful for the user as well as clawed code so this file essentially acts as a memory for your codebase now by default large language models like claude are stateless which means they don't remember anything from one chat to the next Every new conversation starts with a blank slate unless you give it context And that's where this claw MD file comes in When you run /init claude code builds this file as a persistent summary of your project Then when you start a new conversation Claude automatically reads this file first That way it already understands the context of your project before you ask it to do anything So even though the model itself can't retain memory this claw.md file gives it a way to simulate memory And yes this is the same file used by the memory command which we will cover in more details later You should always run /init when using clawed code on a project for the first time And this is something Enthropic actually recommends you do Also keep in mind that you can edit the cloth MD file manually if you ever want to clarify or update the summary as your codebase evolves So this is just a text file so you can just write and add stuff as needed The login command is pretty straightforward It lets you log into cloud code The one important thing to note here is that when you log in there's two methods You can either log in with the subscription plan which is for those on the pro plan or the max plan And there's also a login through the API plan So just make sure you choose the correct one The log out command is also pretty straightforward It logs you out of cloud code But here's a useful feature When you log out of claw code it actually gives you a summary of your session So you can see how much that session cost how long it ran for and what type of models that session used So it's a great way to track your usage and get a quick snapshot of what Claude did behind the scenes The MCP command allows you to connect Claude code with external MCP servers Now MCP stands for model context protocol and at a high level it's a protocol that standardizes how large language models like Claude interact with external tools systems and applications Now this is a big topic and can get very technical So in this video I'll stick to a high-level explanation of what MCP is and why it's useful I won't cover how to install it or how to set up a MCP server here since it's a more involved process and the installation differs depending on what servers you want installed But don't worry I'll have dedicated videos on MCP soon The easiest way to understand MCP is through a example So by default LLMs like Claude only understand text some images and maybe PDFs They can't directly interact with things like a Postgress database So if you ask Claude hey what does database XYZ do It won't know how to access it It won't know how to read the tables or even understand its structure That's because LLMs can't natively connect to or operate external systems They need everything in a textual format So this is exactly where MCP comes in A MCP server for example one built for Postgress acts as a kind of translator or interface layer It exposes the structure functionality and data of the database in a way that Claude can understand and interact with using natural language So with a MCP connection clar can reason about query or even help modify things like a Postgress database because it now has a structured way to interact with through a MCP layer So this is a powerful concept with a lot of potential and definitely something I will cover more deeply in future videos But if you're interested go to the site here and read through this page It has a lot of good information on what MCP is how to configure MCP servers how to understand the different scoping levels for MCP servers how to set up authentication and even here it has a example on how to connect to a Postgress MCP server So there's a lot of information on this website So definitely go here and give it a read if you're interested The memory command builds directly on what we discussed earlier with the /init command To quickly recap when you run slashinit claude co-cans your project and creates a file called claw.md So this is that file right here This is that claw.md file that is within my codebase called animal factax So this file acts as the memory of your codebase storing a summary of your project structure components and key behaviors Since claude itself is stateless meaning it doesn't retain memory between chats This file gives it a persistent reusable context for future conversations Now memory in clawed code is a deep topic and also very subjective How you use it will vary depending on your workflow and preferences So in this video I'll just give you a high-level overview of what memory is and how to use it And in a future video we'll deep dive into it further Okay So at a high level claude code supports three types of memories There's project memory there's user memory and then there's this project memory local So just ignore this one for now because it's no longer being used So we'll just focus on these two here Now as a FYI all the memory files that gets created are all named claw.md So it can be a bit confusing So the first one is this project memory So this is the claw.md file that gets created in your current project directory when you run /init So this is that file right here So this is the project that I have and this is that file right there within the root folder So when I run /init this is going to get all populated and it's just a summary of what this codebait does So every time you work within this directory claude will reference this file for context So in this file this is where you can store things like a highle architectural description which is what gets autopop populated when you run /init You can also have things like coding standards specific to this project So let's just say that here I want to have a section for coding standards So I can have this little section right here So maybe for this project I want to use four spaces for indentation I want to have a max length of 80 characters I want to make sure that there's specific schemas for data models and so forth So there's just a lot of things you could do here You could have whatever coding standards you want Now just keep in mind this project memory should include things relevant to the whole codebase So the things you write here should not be specific to one file or subfolder Okay Now let's look at the second one User memory This is a global memory file which means it applies across all your projects So whatever project you do within cloud code this user memory file will always be called So let's see how we can actually create it So let's just go into cloud code and I'm just going to write /memory And here this is just going to tell me what type of memories I have So you can see here that I have one project memory and it's that claw.md file that we looked at earlier And here we have the three levels of memory So we have the project memory we have the local one Ignore this one And then this is that user memory So right now we have zero memories in here So if we click on this this is going to open up a new file And this new file is the user memory file This is where you want to store personal preferences that apply across all your projects So for example this is where you can have things like user preferences For example you want cloud code to call you a certain name you could put it here If you want Claude Code to keep your responses short and concise you can mention it here And you could also have Claude Code avoid certain phrases So with Sonnet 4 it really likes to use phrases like "You're absolutely correct." And this is perfect So if you don't like that you could tell Cloud Code to avoid that You can tell Cloud Code to always respond in markdown format Use bullet points instead of paragraphs And for coding style preferences you can say that you like to use snake case You can tell Clark code to avoid short variable names like X and temp So there's a lot of things you can include in this user memory file And the things I have here is just a quick example and you can quickly adapt this to your own personal preferences Okay Now let's look at how to import custom files into memories Okay Now let's look at how to import custom files into memories So with clawed code they also give you the ability to import custom files that can act as your own memory So let's go back to our codebase memory file So that's this one right here So this is the claw that MD file within my codebase So here I have this line right here where I say reference at getit instructions.m MD So if I open up this file this is the one right here I have some custom instructions that I want claude code to know in terms of how to write a get commit message So instead of having all of this within here I can write that instruction here and then within this memory file here I can simply just say hey reference this file in this location And clawed code is smart enough to know that if it sees this at sign it's going to look into this file and pull in the necessary information and make it as part of the memory So the ability to import custom files into this memory file is very nice and it just keeps your memory file short and organized Okay now let's look at a quick way to add something to memory with the memory hashtag sign So if I am in claw code and I want to add something to memory directly without having to go to my claw.md file what I can do is I can just do hashtag and this will tell me to add a memory So let's say that I want to add a memory of prefer map and filter over for loops And if I hit enter now this is going to tell me where I want to save it So let's say that I want to save this memory into our project memory So let's just hit enter And this is going to save it into that memory So now that it finished let's go look at that memory So if we open up our project memory right So we are in our claw.md within our animalax file This is that exact memory that we asked Claude code to create for us and it's stored right here Okay Now let's go look at some best practices when it comes to clawed memories So when it comes to best practices you always want to be specific And that makes sense You always want to be as descriptive as possible So you don't want to have general instructions like use comments in functions That's not very helpful Instead you want to say all functions must include a multi-line comment with a short description parameter list dependencies and return type That is much more specific and Claro will have a better idea of what to do with it And the second is you always want to use structure to organize So that means you want to kind of format each individual memory as a bullet point within a group So in my case here I have a group for coding standards I have a group for local development So you just don't want to have these things scattered throughout the memory file You want to kind of put these into logical groupings So memory is a very powerful tool and it can easily get overwhelming Now my personal recommendation is that if you are just starting with cloud code don't worry too much about memory at first So just use clawed code for a while and just see what type of patterns and preferences come up naturally and then slowly start to add those into your memory over time Also another important thing to note here is do not go overboard I have seen users with thousands of memory entries and that usually ends up confusing both the user and the model So keep your memory files lean The model command lets you choose exactly which claude model you want claude code to use when processing your request So if I go to /model by default if you're on the max plan claude code will use opus 4 until you reach 20% of your sessions usage limits Then it will switch to sonnet 4 If you're on the pro plan it will just default to sonnet 4 Now if you don't like this default option you can specify which model you want Claude Code to use So in this case I can decide if I want to use Opus 4 or Sonnet 4 Now if you want to use a model that's not Opus 4 or Sonnet 4 for example let's say you want to use Sonnet 3.7 or even 3.5 what you can do is you can go to this website here So this is just Anthropics models website So if you go here and scroll down there is a list of all the models that Claude code currently has And let's just say that you want to use Claude Sonet 3.5 So what you're going to do is just copy this name here Now it's important if you're using Claude code to copy the name from this column here So copy from this first column copy this name go back to here exit out and just write /mod and then just paste in that name And now if you hit enter this is going to set Claude code to using that specific model And that's it The permissions command lets you control which tools Claude code can and cannot automatically run in your codebase If you have used cloud code before you have probably run into this situation Claw tries to run a command then pauses to ask for your approval runs a bit more then stops again waiting again for your approval for the next action and so on and so on So this is helpful for safety but when it comes to development speed it can really slow you down That's where the permissions command comes in Once you are comfortable with Claude's tools you can specify which commands it's allowed to run without asking you and which one should still require manual approval So Claude Code supports four types of permission rules So Claude Code supports four types of permission rules You have bash you have read and edit you have web fetch and then you have mcp So let's break each one down The first is the bash commands So for those new to the terminal or Linux which is what Mac is based off so this also applies to Mac users as well bash commands or terminal instructions like running scripts searching and editing text files installing packages and so on And when it comes to permissions for bash commands you can allow specific bash commands using exact matches or wild cards Okay So now let's look at this in claude code So if I go to claude code and write /ermissions you can see that there's three tabs I have the allow I have the deny and I have the workspace tab So let's just say for example that you do a lot of node.js JS projects and you want claude code to always be able to run npm run build without having you to always approve it in any projects So if I go to this allowed tab and I hit enter on here So in here if I write bash mpm run build this is now going to let claude code run this command without having you to ever approve it again And another cool thing is that cloud code also supports wild cards for these bash commands So let's take a look at this example right here So for this example I have mpm run test wildcard So this is kind of saying that anytime claude code encounters a command that starts with mpm run test it will always approve it So let's say that you have mpm run test coverage that is going to be auto approved because you have this here So that's the first type bash Now let's look at the read and write So these permissions control which files claude code can read and edit and they also follow the git ignore filters if you're familiar with git Okay let's go take a look at a example So I'm just going to open up VS Code and I have this hello py file Now currently if I go to cloud code and I just type out this statement of add a print.high statement to the hello py file What's going to happen is that Claude Code is going to need my approval first before it can edit this file So just give it a few seconds and see right here It's going to ask me for approval to add this file But let's say that I don't want this I want Clar Code to auto approve this How can I do this So to do that let me just exit out of this Let me just go to permissions And in here within my allowed tab what I'm going to do is I'm going to add a new rule So I'm going to hit enter And then here I am going to add a rule of edit Now remember this is how it looks like This is how it looks like for edit So I'm going to go to edit hello py and then just hit save and I'm going to save it into my project setting Hit enter And then now I have this new rule that allows me to edit into this hollow py file So now I'm going to exit out this And what you need to do is you actually have to exit first in order for cloud code to refresh So I'm going to exit this Re-enter cloud code And now I'm going to ask that exact same command So I'm going to ask this exact same command and see what happens Now I hit enter and then it says it's going to add it and then there it's done Now it says this file now contains that statement So let's go take a look if I open up this file and there it is So that's the second type read and edit Now let's look at web fetch So clawed code can also fetch information from the web but normally it'll ask you before doing so So if you want claw code to always be able to search a specific site you can add a rule by first going to permissions again going to allow add a new rule and here I'm just going to add a new rule of web fetch and then here just enter the website that I want So I'm going to say google.com hit enter and just hit my project settings And then now if I just refresh let's exit this Go claude And let's just say search Google to see what time it is in New York City Hit enter And then now it should be able to search Google without having me to approve And there it is It just says what time it is Okay Now let's look at MCP So for MCP these permissions control which server tools you can allow So you can allow or restrict certain tools within a MCP server So for example here this is saying that this allows you to use any tools within the puppeteer server But if you want to get more specific you can say to allow or deny a specific tool within that server such as the navigate Now if you want to delete a rule it's really simple All you got to do is go into your permissions find the rule that you want hit on it and just say if you want to delete or not and that's it Now here's something important Be very careful with permissions Don't just copy someone else's permission rules unless you understand exactly what each command does Allowing clawed code to automatically run tools especially ones that create or edit files can cause major problems if misused The PR comments command let you view the comments from a GitHub pull request inside Claude Code And the review command allows Claude Code to review a GitHub pull request for you So the status command shows your working directory It shows what account you're logged into So if you have the Max or Pro plan make sure you are actually logged into that and not the API version It also shows you what type of memories you currently have as well as which model you're using So this is a great command just to kind of get an overview of your entire codebase The terminal setup command allows you to use the option plus enter keyboard shortcut to enter new lines And for the Vim command if you are a Vim user this command will put clawed code into Vim mode enabling Vim style key bindings So if you're not familiar with Vim don't worry about it Personally I don't use Vim so I skip this one And that's it This is a full overview of all the commands clawed code has to offer and how they work and how to use them effectively I know this was a lot of information and some topics like MCP go much deeper than what we covered here but don't worry I'll be making more videos on those topics soon And I hope this was helpful and cleared up some confusions around some of the commands that Claude Code has If you have any questions or want me to cover something specific in a future video feel free to drop a comment below Thanks for watching