Key Concepts
Cloth Code, AI coding agent, claw.md file, settings.json file, GitHub CLI, MCP (Modular Control Protocol), Playwright MCP, custom slash commands, explore-plan-code-commit workflow, sub-agents, thinking budget, test-driven development, headless mode, multicloud workflows, Vectal.
Cloth Code: The Best Coding Agent
The video introduces Cloth Code as a powerful AI coding agent and provides a guide on how to effectively use it to boost coding abilities. It emphasizes that Cloth Code is accessible even to those who aren't professional developers. The speaker claims to have used Cloth Code for over 200 hours and read the "Cloth Code Bible," an article by Boris Churnney, the creator of Cloth Code.
Customizing Your Setup
This section details the initial steps for optimizing Cloth Code's performance.
- Creating a
claw.mdfile: This file acts as the main system prompt, defining how Cloth Code behaves. It can include instructions like prioritizing clean code, writing comments, and adhering to UI design principles. The/initcommand can automatically generate aclaw.mdfile by analyzing an existing codebase and creating instructions based on its structure. - Curating a list of allowed tools: This is done in the
settings.jsonfile within theclothfolder. This file specifies which commands Cloth Code can automatically run (allowed list) and which it can never run (deny list). Curating this list speeds up Cloth Code by eliminating the need for constant permission requests. - Installing the GitHub CLI: This allows Cloth Code to interact with GitHub, enabling it to access pull request details, create new pull requests, and manage GitHub issues. The installation command for macOS is
brew install gh, and a specific command is provided for Windows.
Giving Cloth Code Access to More Tools
This section focuses on expanding Cloth Code's capabilities by integrating additional tools.
- Adding Custom MCPs: While Cloth Code has access to the shell environment, custom MCPs can enhance its power. The Playwright MCP is highlighted as essential. Installing it via a terminal command allows Cloth Code to interact with the browser, take screenshots, click buttons, and debug the front end. The command to install Playwright MCP is not explicitly stated in the transcript, but the video mentions pasting a command into the terminal.
- Adding Custom Slash Commands: Users can create their own commands to automate workflows. These commands are defined in markdown files within the
cloth/commandsfolder. The video demonstrates creating afix github issue.mmdfile with instructions for fixing GitHub issues. The file uses$argumentsto accept custom arguments when the command is used. For example, the command/fix github issue 1526would instruct Cloth Code to analyze and fix issue #1526. This allows developers to condense complex workflows into single commands.
Trying Common Workflows
This section outlines recommended workflows for using Cloth Code effectively.
- Explore-Plan-Code-Commit: This workflow involves first exploring the codebase, then switching to plan mode (using Shift+Tab) to analyze and create a plan, then writing the code, and finally committing to GitHub. The use of sub-agents during the planning stage is recommended for complex tasks. Phrases like "think," "think hard," and "ultra think" increase the reasoning budget allocated to Cloth Code.
- Test-Driven Development: This involves writing tests before writing the code. Cloth Code writes tests that initially fail, and then the code is written to pass those tests. This workflow is recommended for backend APIs, business-critical logic, and library/SDK development. It's not ideal for UI-heavy apps or rapid prototyping.
- Write Code, Screenshot Results, Iterate: This workflow involves providing Cloth Code with screenshots of desired designs and iterating on the code based on the results. The Playwright MCP can automate the screenshot process. Iteration is emphasized as a key factor in improving Cloth Code's output.
- Use Cloth Code for Git Operations: Automating Git operations using custom commands like
/create PR,/explain pull request, and/push to GitHubcan save significant time.
Vectal: An Agentic Task Management Tool
Vectal is introduced as an AI-powered task management tool designed to boost productivity. It uses context about the user (work description, goals) to prioritize tasks, generate ideas, conduct research, and manage projects. Vectal also offers MCP integrations for connecting with Cloth Code and other tools.
Optimizing Your Workflow
This section provides tips for improving Cloth Code's performance.
- Be Specific in Your Instructions: More specific instructions lead to better results. Examples of bad and good prompts are provided.
- Directly Mention Files: Specifying the files you want Cloth Code to focus on improves its accuracy.
- Give Specific URLs: Cloth Code can browse the web, so providing URLs allows it to access relevant information.
- Course Correct Early and Often: Use the Escape key to interrupt Cloth Code if it's going in the wrong direction.
- Use
/clearand/compactCommands:/clearresets the conversation history, while/compactsummarizes it.
Use Headless Mode to Automate Your Infra
Cloth Code includes a headless mode for non-interactive contexts like CI, pre-commit hooks, build scripts, and automation. It's activated using the -p flag. Headless mode can power automations triggered by GitHub events, such as analyzing pull requests. Customizing the prompt in the clo.yaml file is essential for concise reviews. Headless mode can also be used as an advanced linter.
Uplevel with Multicloud Workflows
Running multiple Cloth Code instances in parallel can enhance performance.
- Code and Verify: One instance writes the code, and another reviews it.
- Parallel Execution: Run two instances side-by-side, potentially using different models (Opus for planning, Sonnet for execution). The speaker uses a 50/50 screen setup with two Cloth Code instances.
- Git Work Tree Method: Use Git work trees to see multiple branches at once and launch Cloth Code in each work tree.
-verboseFlag: Use the-verboseflag for detailed debugging information.
Cloth Code Mastery Workshop
The speaker promotes a Cloth Code Mastery workshop within the "New Society" that provides access to resources like the speaker's claw.md file, settings.local.json file, and other prompts and commands.
Conclusion
The video provides a comprehensive guide to using Cloth Code effectively, covering customization, tool integration, workflows, optimization, headless mode, and multicloud setups. It emphasizes the importance of experimentation and continuous learning to maximize the benefits of this AI coding agent. The speaker also introduces Vectal as a complementary tool for task management and productivity.
AI summaries can miss context or contain errors. Check important details against the original video.