Summary

For someone who cannot code from scratch, Claude Code seems like magic: you describe what you want, and it builds/does it for you! It’s partly a reason Claude Code has become one of my most-used apps, though I don’t code. Yet, you’d be wrong to assume that Claude Code is completely autonomous. This means you’ll have to respond to queries and provide additional prompts at different stages of this coding process. This is bearable while working on smaller projects, but it can be annoying if you were expecting Claude Code to just do it for you. Recently, though, I realized that Claude Code has a built-in function to help you deal with this. More so, adding a simple command in front of your Claude Code prompt makes such a significant difference: /goal. The /goal command cut my prompts from four to one Here’s the math on what changed Before I tell you what the /goal command does and how it makes a difference, let me walk you through a Claude Code building session without it. Let’s say I want to build a web-based habit tracker app using Claude Code, and the only language I should know is English! I open Terminal, launch Claude Code, and enter a prompt that reads something like “Create a web-based habit tracker for me that stores everything on the browser and works completely offline.” In a second, Claude Code starts thinking and building, but I would also have to answer queries amidst the process. More importantly, the end product from Claude Code is more likely to be incomplete, meaning that I will have to add more prompts and wait for the app to complete everything. Adding the /goal command changes this for good, though. When you add the /goal command in front of a Claude Code prompt, Claude Code will treat the prompt as a condition to be met — or a goal to be achieved by the app. It means, instead of asking for prompts from your side, Claude Code will continue working until that condition is met. Claude Code runs a smaller model after each task to detect whether the goal has been met. If it is, you’d see the result on the screen. If not, Claude Code will continue working towards that goal. Just so you know, this is different from the Auto mode on Claude Code, which simply accepts the tool call but cannot start a new one. Now, for the end user, the /goal command means answering fewer or no follow-up questions or prompts from Claude Code. I’ve also noticed that simply adding the command before the prompt yields a better overall response than omitting it. I’ve been following this trend, and the difference has been night and day. My habit tracker app proved the math Four check-ins became one, and I timed it At this point, adding /goal to the prompt has become second nature to me when using Claude Code. However, I wanted to double-check whether the difference is obvious. So, I decided to run the same prompt twice: once with the /goal command, and once without it. Just so you know, this is the exact prompt I used: “build a single HTML file habit tracking app where I can add habits, check them off per day, the data persists after a page refresh with no backend.” Here’s how they turned out while attempting to build a habit-tracking web app. Without the /goal command, Claude Code created a single HTML file that contained the habit tracker app and followed the instructions. I checked the tool, and it allowed me to add new habits and manage them; everything stayed in the browser as well. However, the tool lacked many of the elements that make for an impressive web app. On the other hand, with the /goal command, I got a fully-fledged web app that met all the conditions I specified. As you can see in the screenshot below, the web app contained a number of features you’d want to see in a habit tracker app. In fact, I’d have spent a few minutes sending additional prompts to the first session to add the elements this session added. This addition also meant I could focus on other things while Claude Code handled everything. However, I had to trust the workspace folder and enable Auto mode for the best results. You must also understand that you’ll appreciate the /goal command more when going through a more complex project. Not every /goal condition saves time Vague goals loop just as long as manual prompting It’s not a good idea to think of the /goal command as a one-stop magical solution, though. You can get the most out of this feature only by crafting your prompt correctly. Even though I notice that this command yields better results in most cases, it is also because my prompts include something Claude Code could use as a condition. It might have been a particular feature or a general state of the app/script I was building. For instance, when I use the /goal command with a prompt about reorganizing my Downloads folder, I add a condition to the prompt, like, say, ensure that files are arranged based on the category. This way, once each rearrangement task is complete, Claude Code can run its smaller model to confirm whether the condition is met. Without this conditional element, you may not always have the best results. In the end, if you keep your goals vague, you’ll end up spending more time with manual prompting once again. Autonomous isn’t the same as unsupervised Ultimately, the goal function would make Claude Code much more autonomous than it currently is. When combined with the right permissions and Auto mode, it can give you better results within a short span. However, you must note that it assumes a few things about building. So, there may be times when you need to go back and reinvest the time you saved. Therefore, it’s not as if you can take supervision out of the equation. But yes, you do save a lot of time and make a big difference by adding this command!

By Abhijith N Arjunan

Original Article