Anthropic's newly published Claude Code best-practices documentation surfaced at least five mistakes even a working consultant was making daily.
0:00 Hey, Autocode just published documentation about the best practices in Cloud Code. I read the documentation so you don't have to and I noticed at least five things that I was doing wrong. My name is Annie. I'm a tech consultant based in Stockholm and in this tutorial I will show you step-by-step how to avoid most common five mistakes in Cloud Code. Let's get started. [music] Best practice number one. Cloud will always ask you about permissions for writing to files, for doing Git commits, for running bash commands, using MCP tools and this is how Cloud is developed for safety reason. However, this is slowing you down massively. So either you can use dangerously skip permissions that will bypass all the permissions and it will be quite quick or if you don't want to take any dangerous action, you can be like me and you can ask Cloud Code to allow edits to different files, allow Git commands and allow running tests.
0:59 Best practice number two. Create skills for domain knowledges. So in here you can see the example where you are creating the name of the skill [music] and then the description and then you are giving the skill a domain knowledge. For example, in this case it's API conventions, use kebab case for URL path, use camel case for JSON properties, always include pagination for list endpoints. Skills [music] extends Cloud knowledge with information specific to your project. Cloud applies them automatically when relevant or you can invoke them directly with forward slash and skill name. Best practices number three. Create sub agents. The sub agent are running commands on their own context window using their own tools and those are amazing.
1:46 If you don't want to clutter your main agent with sub agent and as you know your main agent has limited [music] context window. So if you delegate some small tasks to sub-agent, then your context window for main agent will be used for longer time. So, in here you can see an example. You will define the name, which is security reviewer, then description, review code for security vulnerabilities, then we have tools, and the model is Optus. Then, you are basically creating what agent needs to do. In this case, you are saying you are a senior security engineer, review code for injection vulnerabilities for authentication and authorization flows, for secrets or credentials in code, and for insecure data handling. As soon as you run this in your context window, the agent will be created.
2:35 Best practice number four is about letting Cloud to interview you. Start with minimal prompt and ask Cloud to interview you using ask user question tool. Cloud asks about things you might not have considered yet, including technical implementation, UI/UX, edge cases, or trade-offs. Use this example command, [music] where you say, "I want to build, for example, LinkedIn scraping tool, then interview me in detail using user question tool." Ask about technical implementation and so on. So, here you will identify what it is that you want Cloud to ask you about. And at some cases, it can be different features that you haven't even thought of, and Cloud will still ask you about those features, which will initiate your thinking and planning product actually [music] want to have before even starting to code it.
3:28 Sometimes Cloud can be stuck with the same task for couple of hours. This can normally happen when you leave your computer and come back, and Cloud is still working on the same task. So, in this case, you can just use ESC key, and this [music] will stop Cloud mid-action, keeping your context. And if you want to go a couple of steps back and rewind, [music] then you can click this button twice. And if Cloud updated something that you don't [music] like, you can use undo.that command. That will undo the last chain. And in between different tasks, if you don't want to keep the current context window, you can always use forward slash clear command. Those were five best practices that I wanted share with you. If you want to get the full list, just like this video and comment full list and I will share it with you.
4:16 Have a good day and bye.