📱

Get Our Mobile App

Take your business learning on the go!

Download on the App StoreGet it on Google Play

Claude Code - Are You Using It Wrong?

AI for Work18:14

Transcription

Here are my 10 favorite commands and one bonus tip for you.

First command we're going to run is the init command, which stands for initialize. The init command is uh something that you would normally do in the beginning of the project. Code is currently doing it is actually creating the cloud.md file. So it's running through the codebase um trying to understand the the design system um the actual um structure of the package.json file as well. See what dependencies do we have? How to run lint checks um and so on. So it should be a living document. Don't just use it once. Just keep iterating on it. You can also specify in the cloth.mmd what you would like clot for example not to do.

So, the second command we're going to look at is the command for configuration. I haven't seen many people using it, but it's actually um a great place because you get quite a lot of configuration settings um which you can set up. So, autoco compact, I'm just going to briefly talk through those. Autocompact means that if the context gets too big, it's going to automatically compact the context. Uh so the previous conversation just leaving the most important things. Show tips just shows you tips on boarding. Um thinking mode just make sure that thinking mode is actually uh turned on. You can check that by running the /config and coming here. The first time I had my cloud code set up, it was set to false, but you can override it by setting it to true.

Then the other important one is the rewind code. So ability to rewind and we are going to look at the uh the slash command in one of the later tips. The other thing that is pretty important here is the default permissions mode. So default is pretty much like a default behavior but you can override that as well. So plan mode. So whenever you start a conversation with cloud code it is always going to start in a plan mode, which I'm going to show you in a second. Then you've got the accept edits. So it's always going to accept the edits itself. and then it's not going to ask you for anything. That means that it's going to run bash scripts. It's going to be able to do uh changes on your local machine as well as actually accepting its own edits. So, this is more like a a yolo, I guess, mode. You can you can think of it. I'm just going to have have it to to default because that kind of works for me.

Model is also another one uh that that you can change from here. So if you were to uh press space, it is going to take you to the model selection. So by default the OPUS 4.6 is set up. Um so let me actually select this one. If you press left and right um arrow keys on your keyboard and if you pay attention to the high effort, so those three orange bars, if you go to left, it's going to reduce the effort. So low effort means it's going to probably, you know, take a little bit quicker to give you an output. The result might not be uh the best than medium and obviously high effort. Um the higher the effort obviously it's going to use um more tokens, right? And then you press enter to to confirm the um selection.

Then the other thing if you are using um cloud code with something like VS code or cursor and like in my case here I'm using a separate terminal uh if it is set to true cloud code is going to try and find the connection. If it's set to false you'll have to go and initialize the the connection. So if you were to press shift and tab you'll be able to cycle through different modes. So except at it it's on or plan mode. And if you are going to be building a feature, so I'll show you how that works. This is obviously just a a sample prompt. Um you press enter, uh cloud code is just going to go and think through the problems. Sometimes it might use some kind of a sub agent as well. Um and once it finishes, you're going to get a kind of a summary what is the plan to do and then you have the option to accept or decline.

So when cloud finishes, you are going to get four options um that you can pick. So the first option just clears the context completely just in case the plan was um it took a while and it just ate a lot of context and then go um go off and start developing auto accept edits. It's pretty much the same context and it goes and develops the manually approve edits. It's going to ask you every single time um if you uh accept the edits. And the fourth one is where you can actually type in any change you want to make to the plan u because you might just not agree with the plan. and then hit enter. Uh cloud is going to go off again and update the plan.

You can run clot code in yellow mode. Um so if you do that, it's going to be able to edit any files. Um that also includes running commands in your uh terminal. So make sure that you're okay with it. uh if you're working in a in an environment that you know there's nothing bad can happen I highly suggest using it or even trying out um playing with it. So the way you do it you have to you have to use it when you are starting cloud. So you have to type in cloud and then dash dangerously skip-p permissions and then when when you hit enter you will see that cloud code is running and it says bypass permissions on.

So another tip, if you want to run bash commands inside of cloud code, you can actually do that by pressing the exclamation mark. If you do that in cloud code, it is going to switch to um to bash mode. And then you can run your typical npm rundev. If you do that, in this case, it's just going to run the local host for this nextgs application.

Another cool tip is to get cloud code access to the entropic marketplace where you can add more plug-in skills to kind of a supercharge your cloud code uh experience. The easiest way really to do this is to go to the cloud code docs. I'm going to drop a link in the description. Just copy this command from here. Plug-in marketplace at entropic/cloud code and then go back to cloud code and just paste that. Ctrl +V and then press enter. that is going to clone the GitHub repository from Entropic Marketplace and it has added the the marketplace itself. So now to get access to see what is currently uh available in in my instance of cloud code is you just type in /plugin and it's going to show you a few tabs. The first one is discovery or discover. This is where you can actually see what is currently available that was created by the anthropic team. And these are these are pretty much skills that we will be adding later. Uh you can see what is installed. I currently just have an an MCP a cloud code extension in Chrome and then the marketplace itself. You can add more marketplaces. Uh if you know of a private private marketplace the so the way you would do it is just add the marketplace then paste the link here and that's going to also make that private marketplace available here. And if there are any unique skills that that private marketplace has created, you would see it listed here.

Okay, here is a bonus tip which is just super super helpful is to use voice for dictation. So voice to text. Um there's a bunch of uh tools that are available. The way pretty much works, you just have a a shortcut assigned to it and you just talk to claude and then the text is being pasted. It speeds things up uh tremendously and it also kind of a personally it helps me think through whatever I want cloud code to build. Can you please uh tell me something about this uh repository? And then whatever you you're asking cloud code u to do it just pastes the text and you just carry on. So there are different applications. There is the uh super whisper which is available for Mac and Windows. Um so that's one of them. They all have kind of a pretty decent free tiers uh for you to explore. The one that I am currently using is the whisper typing. Uh somehow this one just works for me, but it doesn't really matter. They are all kind of on the same level.

Now to access the marketplace, you type /plugin and then just hit enter. We have different types of um skills really that you can add to your cloth code. So the one that I love using is the front end design uh skill pretty much which is a markdown file which kind of makes all the front end work look um much more modern much more intentional. So there are a few options you can you can choose um from you can either use a user scope or just be very kind of a targeted and use the uh the skill for just this repository. I'm going to just use a use a user scope here and that is pretty much it. If we were to go back to the plugins now and see what is installed, you will see that I have front end design plugin and the other one is just an MCP um which is a Chrome extension MCP.

Another way of uh creating and adding skills is pretty much just asking cloud code to create a skill for you. Um so in this case I'm asking cloud code to create an information architecture good practices um skill for me and I'm just pointing it to the local repository and just adding a link to the dogs just in case. So once the skill is done you see it uses the the correct structure. It is a markdown file which is going to be stored in cloth folder in the subfolder skills and then the sub folder uh in my case it is information architecture. So there are two files patterns which the skill is going to use which is kind of a based on the repository itself and then the skill itself. to see if the actual skill is present in um cloud code you can just press slash skills and it should be listed there. So we see two skills. So the front end design one which we got from the marketplace itself and then the other one information architecture um good practices which is stored in the repository.

Now how would you use that while you're working? You would pretty much have to mention that skill. So in our case information architecture I am going to change to the plan mode. So as you can see information architecture is mentioned. So once I press enter cloud code should know to look for that skill. There it is. So it's using that particular skill. It is looking through the content of it and obviously creating plan uh utilizing the knowledge that is there. So once you have your skills created or added to cloud code uh you don't really have to mention the skill um in the prompt itself you can start with the actual skill. So I'll show you. So in our case we had the the front end design. So you see that this is the skill that we um have added using the marketplace. So if I press enter cloud code should ask me um a question what do I want to build? So it has recognized that this is the front end design skill and it's asking us what component page for application, what is the purpose and then you can obviously describe what you want to u build. So there are a few ways of using skills. Um this one is pretty awesome as well.

Now another very powerful feature of clot code is the agents where the CLI can actually delegate work to um sub agents. So the way you would go about it again it's a slash command. So slash and then agents. You will see that I don't really have any. So the way you would go about it you just um press enter create new agent. You can either do a personal which is going to be kind of a um a user scope your system operating system user scope or you can do that in the actual project. So I'm just going to select the project and then it suggests to generate u with claude. Can you please create a an agent that is going to be um doing an accessibility um validation for me? Now we are getting a few options here. I normally just leave everything on and then hit continue. We can also choose which model. Um that can be actually very important because if you know that you don't need a very powerful um LM like opus maybe you can just default to Sonet and then we can obviously pick a color that color is going to indicate the actual agent itself running and we can read through the description what the agent is going to do. We save this and now you can see that we have our project agent which is the accessibility validator. If we press into it, we can see the details of it. We can obviously remove it or edit the agent as well, which is kind of cool as well because you can keep iterating on it, right? So, hey, can you do um a quick accessibility validation using the accessibility um validator agent for me? Thank you. So we should see that agent being used um if it all worked correctly. There you go. Accessibility validator. It's an agent that is currently running and do doing the validation. So the difference between let's say a skill and an agent. You can think of an agent as your kind of a coworker. It has its own context. It has um it can have its own prompts and um skills and so on.

There's another super useful uh slash command which is the context one. So if you use slashcontext, you are going to see how much of your context currently is being used and what it is being used for. You've got this kind of a nice visual over here. And here is the breakdown of what is using mod. Why it is important? It is important because you don't want to like add too much context just before you start asking cloud to to do something for you. So just making sure that you don't have too many MCPs running. Um if I'm not using the cloud in Chrome MCP, I might just turn it off to save some some tokens and then free up the context as well. Also the the agent or agents in general are going to be listed here. In our case, we just have one the accessibility one skills. So the information architecture and the front end design, you don't have to use it all the time, but it's um it's a good way of kind of understanding, you know, how much has been already used. And if you would like to free up the the context itself, the other slash command that is super helpful is the clear command. So if you type clear, and by the way, all the slash commands have description, so it's really easy to understand um what they would do. So if you were to hit clear, it's going to clear the history, but also free up the the context as well.

So, so the compact command, not sure if you need to use that because you can set the compacting of the conversations uh to be always set to true. So, not that many people uh talk about this slash command, but it is actually very useful. It is similar to cursor checkpoint. So, you can reverse the the changes that the uh LLM has made. So, rewind slash command. If you press enter, it is going to show you a list of pre previous changes and then you can pick and revert to the uh previous state. So that's one way of accessing it. The other the other way is by uh double uh pressing the escape key. So if you press the escape key twice, it is going to bring that list again. The um the cool part about double double pressing the escape is also if you have um text in cloth code and you uh press the escape key um twice, it is going to just clear the entire text for you. So you don't have to use the backspace to just clear the text. You can pretty much just do this with pressing uh escape twice and then twice again. It's going to show you the rewind um slash command.

Now, cloud code also has automation which you can find under the slash command called hooks. No context is being used during the hook execution and it doesn't really use the LLM's um capabilities of what it does. It kind of sets a pattern. If something happens, then something else needs to be triggered uh and so on. So, it's um it's kind of an automation. Pretty pretty simple automation. So if you go to hooks at this stage you're selecting when the automation needs to happen like does it need to need to happen like pre-tool use meaning let's say um some code is thinking of executing something and that's when this tool needs to um be triggered or when the tool has just ended um it's execution and that's when the hook is going to kick in. So another way as in most cases in cloud code you can just pretty much ask it. So kind of the most obvious things that you can um probably add as a hook is one to never run npm rundev and let the end user to handle the um the server itself the local host.

Okay guys um that's it. Thanks for watching. I hope this was helpful slash commands and the way I use cloud code. Um it's been awesome. It's pretty pretty amazing. I'm going to leave the the slash commands in the description. Um, so go check it out and if you have any ones that I haven't covered here but you're using or maybe you have a workflow, just put it in the comment. Um, it's going to be much appreciated. Thank you. Bye.