TL;DR
This video serves as a comprehensive guide to mastering Claude Code, Anthropic's AI coding agent, based on insights from the "Cloth Code Bible" by its creator. It emphasizes customizing the setup through files like cloth.md (system prompt) and cloth_settings.json (tool permissions), and integrating GitHub CLI. A key takeaway is extending Claude's capabilities with custom MCPs like Playwright for browser interaction and creating custom slash commands to automate complex workflows, significantly boosting productivity. The guide details four recommended workflows: Explore-Plan-Code-Commit (with sub-agents and thinking budget prompts), Test-Driven Development, Write Code-Screenshot-Iterate, and leveraging Claude for Git operations. It also covers workflow optimization through specific instructions, URL browsing, early course correction, and context management commands (/clear, /compact). Finally, it introduces advanced uses like headless mode for CI/CD automation and multi-Claude parallel workflows for enhanced code generation, review, and refactoring, positioning Claude Code as an indispensable tool for developers at any level.
Information Mind Map
- What is it?: Best coding agent by far.
- Source of Knowledge: Based on the "Cloth Code Bible" by Boris Churnney (creator of Claude Code).
- Goal: Massively boost coding ability for developers of all levels.
- 1. Create
cloth.mdFile- Purpose: Main system prompt that dictates Claude Code's behavior.
- Content Examples: Prioritize clean/simple module code, write lots of comments, UI design principles.
- Autogeneration: Type
/initinside Claude Code.- Analyzes existing codebase structure.
- Generates high-density instructions based on codebase documentation.
- 2. Curate
cloth_settings.jsonFile- Purpose: Defines allowed and denied lists of commands Claude Code can run automatically.
- Benefit: Speeds up workflow by eliminating permission prompts.
- 3. Install GitHub CLI
- Mac OS:
brew install gh - Windows: [Specific command mentioned in video, but not transcribed]
- Functionality: Allows Claude Code to use GitHub CLI commands (e.g., view PR details, create PRs, get issues).
- Mac OS:
- 1. Add Custom MCPs (Managed Code Providers)
- Concept: Claude Code can act as both an MCP server and client, connecting to multiple MCP servers.
- Essential MCP: Playwright MCP
- Installation:
pip install playwright-mcp(implied from "paste in this command") - Verification: Type
/mcpin Claude Code to see it listed. - Capabilities: Interact with browser, take screenshots, click buttons, debug frontend.
- Installation:
- 2. Add Custom Slash Commands
- Location: Create
.mmdfiles inside yourcloth/commandssubfolder. - Benefit: Automate entire workflows (8-12 actions) with a single command.
- Example:
create PR: Instructions for creating a pull request. - Example:
fix github issue- File:
cloth/commands/fix github issue.mmd - Arguments: Use
$argumentsat the top of the.mmdfile (e.g.,/fix github issue 1526). - Process: Claude analyzes and fixes the specified GitHub issue.
- File:
- Ease of Creation: Simply create a Markdown file with instructions.
- Location: Create
- 1. Explore Plan Code Commit Workflow
- Explore: Tell Claude to explore codebase, find relevant files.
- Plan Mode: Shift to plan mode (
Shift + Tabto cycle modes: Default, Auto Accept, Plan).- Characteristics: More exploratory, analyzes files, thinks about best practices, creates optimal plan.
- Code: Tell Claude to write the code (feature/bug fix).
- Commit: Commit changes to GitHub.
- Pro-Tip: Sub-Agents:
- Usage: Tell Claude to "launch a sub agent to figure out..."
- Indicator: Look for "task" at the end of Claude's output.
- Function: Delegates research/specific tasks to dedicated agents.
- Pro-Tip: Thinking Budget Phrases:
think,think hard,think harder,ultra think- Effect: Directly maps to increasing reasoning tokens/thinking budget, leading to better results for complex issues.
- 2. Test-Driven Development (TDD)
- Workflow:
- Write tests (Claude writes tests that fail initially).
- Commit tests (once happy).
- Write code (tell Claude you're doing TDD).
- Iterate over code until happy.
- Commit complete feature.
- Anthropic's Favorite: Especially good for verifiable changes.
- Ideal Scenarios: Backend APIs, business-critical logic (high bug cost), library/SDK development (clear expected behavior).
- Not Ideal Scenarios: UI-heavy apps (visuals), rapid prototyping (can slow down).
- Workflow:
- 3. Write Code, Screenshot Results, Iterate
- Input: Drag screenshots directly into Claude Code (hold
Shift). - Automation: Use Puppeteer MCP or Playwright MCP to let Claude take screenshots itself.
- Benefit: Iteration significantly improves Claude's outputs, similar to human development.
- Input: Drag screenshots directly into Claude Code (hold
- 4. Use Claude for Git Operations
- Custom Commands Examples:
create PRexplain pull request: Reviews PRs, runsGitHub PR view,GitHub PR diffs, provides testing instructions.review specific files(in a PR)push to GitHub: Stages files, writes commit message, checks branch, pushes.
- Efficiency: Saves significant time daily by automating multi-step Git processes.
- Anthropic Usage: Engineers use Claude for >90% of their Git interactions.
- Custom Commands Examples:
- Purpose: Boosts productivity by managing tasks and projects.
- Features: Prioritize tasks based on context, generate ideas, automatic daily research, project management.
- Integration: MCP integrations available to connect Vectal into Claude Code, Cursor, etc.
- Access:
vectal.ai(free to start).
- 1. Be Specific in Instructions
- Impact: Significantly improves Claude Code's success rate, especially on first attempts.
- Bad Prompts: "add tests for file name", "why does execution factory have such a weird API".
- Good Prompts: "look through execution facto's git history and summarize how its API came to be."
- 2. Directly Mention Files
- Example: "look at left sidebar and tell me how it's structured."
- Benefit: Claude knows exactly what file to analyze, speeds up codebase learning.
- 3. Give Specific URLs
- Capability: Claude can browse the web using the
fetchtool. - Usage: Paste URL and give instructions (e.g., "implement this tool calling in our back end").
- Capability: Claude can browse the web using the
- 4. Course Correct Early and Often
- Action: Press
Escapeto interrupt Claude if it's going in the wrong direction. - Benefit: Prevents wasted time and resources.
- Action: Press
- 5. Use Context Commands
/clear: Completely resets conversation history, deletes all context, starts from zero./compact: Heavily summarizes conversation history for most important information, allowing continued work on the same feature/bug.
- Purpose: Non-interactive contexts like CI, pre-commit hooks, build scripts, automation.
- Activation: Run
clot -p "your prompt here" - JSON Output:
d-output format stream JSON - Automations: Triggered by GitHub events.
- Example: PR analysis (e.g., Vectal team uses Claude to analyze PRs for critical issues).
- Critical for GitHub Actions: Customize the prompt in
.github/workflows/clo.yamlto ensure concise reviews (default is verbose).
- Claude as an Advanced Linter:
- Catches issues beyond normal linters: typos, stale commits, misleading function/variable names.
- Concept: Running multiple Claude instances in parallel for powerful applications.
- 1. Write Code & Verify Workflow (5-Step)
- Use Claude 1 to write the code.
- Use
/clearto reset context. - Use Claude 2 to review Claude 1's work (separate context).
- Use
/clearagain (or start Claude 3) to read both feedback and original implementation. - Use Claude 3 to edit code based on feedback (no emotional attachment).
- 2. 50/50 Screen Workflow (e.g., in Cursor)
- Run one Claude on the left, another on the right.
- Model Selection: Use
/modelcommand.Opus: More powerful, slower (good for planning).Sonnet: Faster (good for building/execution), recommended default for most tasks.
- Benefit: See code diffs directly in the terminal as Claude makes changes, reducing need to switch to editor.
- 3. Git Work Tree Method
- Steps:
- Create Git work trees:
git worktree add <path>(allows seeing multiple Git branches at once). - Launch Claude in each work tree by
cding into the path and runningclot. - Create additional work trees and repeat as needed in new terminal tabs.
- Create Git work trees:
- Steps:
- 4. Verbose Flag (for debugging)
clot -d-verbose: Shows more detailed output.- Recommendation: Use only for debugging, not practical for daily use.
- Claude Core Mastery Workshop:
- Access: Available in "The New Society" classroom under "Code with AI".
- Content: Step-by-step training to become a top 1% Claude Code user.
- Resources: Access to speaker's
cloth.md,settings.local.json,protocol.md, and other prompts/commands.
- Call to Action: Join "The New Society".