I Made $600K with Claude Code. My Full AI Business Setup.
Introduction to Claude Code
Overview of Claude Code
- Claude Code is presented as an AI tool that automates coding tasks, allowing users to focus on project execution rather than manual coding.
- The speaker, Chris, shares his experience building a successful AI consulting business and emphasizes the importance of understanding how AI impacts people.
Getting Started with Claude Code
- Users need to install Claude Code via the official documentation found at code.claude.com/doccks.
- Authentication requires creating an account at anthropic.com and logging in through a provided prompt after installation.
Using Visual Editors with Claude Code
Installation Options
- Two main visual editors are recommended: Visual Studio Code (with the Claude extension) and Anti-gravity, Google's AI coding platform.
- The tutorial will demonstrate using Anti-gravity for its user-friendly interface while still retaining all functionalities of Claude Code.
Understanding claude.md
Importance of claude.md
- The file
claude.mdis crucial as it sets context for every session; it contains project rules and preferences that guide the AI's responses.
- Without
claude.md, each session starts from scratch, requiring constant re-explanation of project details which can be inefficient.
Practical Application
- Think of
claude.mdas a briefing document that allows the AI to start working immediately without needing background information each time.
File Structure and Rules
Organization of Files
- The naming convention for
claude.mdis case-sensitive; it must be named exactly as specified and placed in specific directories for proper functionality.
- There are three layers of
claude.md: global (applies to all workspaces), local (specific to current projects), and enterprise (system level).
Managing Project Specificity
- Global rules set overarching guidelines while local rules cater specifically to individual projects; conflicts favor global settings.
Best Practices for Using claude.md
Structuring Your Project Files
- A dedicated
.claudefolder should be created within projects to keep files organized and hidden from standard file explorers.
Splitting Rules into Focused Files
- As projects grow, splitting
claude.mdinto smaller focused files helps maintain clarity and manageability, preventing rule conflicts during updates.
How to Effectively Structure Claude MD
Best Practices for Onboarding and Structuring Claude MD
- When onboarding new team members, provide them with relevant files instead of overwhelming them with lengthy documents. Start with a single Claude MD file and only split it when necessary to avoid creating too many small, hard-to-find files.
- A poorly structured Claude MD can be overly verbose (e.g., 2,000 words), making it resemble an essay rather than a set of actionable rules. Important instructions should not be buried in the text as they may be ignored by Claude.
- Focus on behavioral instructions in your Claude MD rather than reference material. For example, specify that "always use the V3 endpoint" instead of providing extensive API documentation.
Writing Style and Structure
- Avoid writing in full paragraphs or including unnecessary context; instead, present clear and concise rules. For instance, state "Use Tailwind for all styling" directly without additional explanations.
- The first line of your Claude MD should contain the most critical rule. Follow this with bullet points that are short and actionable to enhance clarity and recall.
Organizing Rules for Maximum Recall
- Limit your Claude MD to 200 lines maximum; longer files carry dead weight. Place the most critical rules at the top since primacy bias means these will be remembered best.
- Ensure that important rules are not left in the middle of the document where they might be overlooked. Move less critical preferences towards the bottom while keeping essential guidelines easily accessible.
Adapting Based on Mistakes
- Use repeated mistakes as indicators to update your Claude MD by adding specific rules based on common errors made by Claude during projects (e.g., "Never use relative imports").
- Treat your Claude MD as a living document that evolves over time; regularly review and prune it to maintain its relevance and effectiveness.
Specificity is Key
- Avoid vague instructions like "be smart." Instead, provide concrete directives such as "Always use transactions for multi-table writes," which can be verified against actions taken by Claude.
- Understand that vague rules are ineffective; every rule must be specific enough to allow verification of compliance by Claude.
Memory vs. Project Rules
- Recognize that there is a distinction between memory (personal preferences saved across sessions automatically by Claude) and project-specific rules maintained within your Claude MD file.
- Use memory for non-critical personal preferences while ensuring all significant project quality standards are documented in your structured CLAUDE.md file.
How to Effectively Use Claude for Coding
Iterative Development Process
- Emphasizes the importance of iterative development by comparing current code with the original, focusing on spacing, font weight, and alignment. Each iteration should bring you closer to satisfaction.
- Highlights that without verification steps like screenshot comparisons or automated tests, much value is lost. AI's strength lies in its ability to iterate quickly.
- Introduces a free live training session every Friday that discusses client acquisition strategies and success stories from students who have achieved significant results.
Managing Permissions in Claude
- Discusses four permission modes in Claude:
- Ask Before Edits (default mode)
- Edit Automatically
- Plan Mode (read-only)
- Bypass Permissions (no restrictions)
- Explains that "Ask Before Edits" allows users to see changes before they happen, which is beneficial for learning but can become cumbersome over time.
Transitioning Between Modes
- Suggests switching to "Edit Automatically" after gaining familiarity with Claude's operations to enhance efficiency while maintaining some control.
- Describes "Edit Automatically" as the ideal day-to-day mode where Claude makes edits without asking but still checks before creating new files.
Caution with Bypass Permissions
- Warns against using "Bypass Permissions" carelessly; it allows immediate action on instructions but can lead to unintended consequences if not managed properly.
- Advises using bypass only for well-understood tasks and emphasizes the need to switch back once completed.
Importance of Planning Mode
- Stresses the significance of starting projects in "Ask Before Edits" mode for understanding processes before transitioning to more efficient modes.
- Advocates for using "Plan Mode" frequently as it prevents costly mistakes by allowing thorough planning before any coding begins.
Cost Efficiency Through Planning
- Argues that planning saves time and resources by avoiding unnecessary rebuilding due to incorrect assumptions made during coding.
- Points out that a small investment in planning can save substantial costs associated with fixing errors later on, emphasizing the financial benefits of careful preparation.
This structured approach provides clarity on how best to utilize Claude effectively while managing permissions and ensuring cost-efficient coding practices through proper planning.
Planning for Successful Project Development
Importance of Planning Before Coding
- Always plan before starting a new project, especially when adding major features or integrating third-party services like Stripe or Superbase.
- Read the plan thoroughly; don’t just glance at it. Check file structure, tech stack decisions, and user flow to catch potential issues early.
- If there’s ambiguity in your requirements, use planning mode to clarify your thoughts before any code is written.
Benefits of Using Plan Mode
- In plan mode, Claude can generate a structured overview including tech stack and user flow without touching any files.
- A well-defined architecture decision (e.g., public intake form vs. protected dashboard) can prevent significant mistakes during development.
- The plan serves as a reference document post-development; it allows you to verify if the build matches the original intent.
Building a Full Stack Application
Step-by-Step Workflow
- Follow the beginner workflow by building a proposal generator with features like login, proposal creation, e-signatures, and payments.
- Start by switching to plan mode and typing out your requirements directly into Claude Code for clarity on what you want to build.
Clarifying Requirements
- Claude will ask clarifying questions regarding framework preferences and database choices; provide answers to ensure accurate planning.
Execution Steps
- After confirming the plan's accuracy, switch to edit mode for Claude to start building while setting up external services like Superbase and Stripe in parallel.
Finalizing Your Application
- Once built, run commands in your terminal to launch the application live with all integrations completed within 15–20 minutes.
Advanced Features and Next Steps
- After mastering basics, explore advanced topics such as context management and token economics that differentiate users of Claude Code from those who manage complex systems.
Understanding Context Management in Claude Code
Importance of Context Management
- Context management is crucial for effectively handling tokens in a prompt, which can significantly reduce operational costs when mastered.
- Users often overlook the underlying mechanics of Claude, leading to performance issues as the context window fills up and older information is discarded.
- The cost implications are significant; every token processed incurs a charge, making efficient context management essential for both quality and budget.
Defining Context Window
- A context window refers to the total number of tokens a model can process in one session, varying by model and plan.
- It's important to distinguish between context window size (memory capacity) and model intelligence (reasoning ability); they operate independently.
System Tools and Token Usage
- System tools consume around 17,000 tokens per session that cannot be removed, impacting overall token usage.
- Understanding what loads into your context before sending messages helps manage costs effectively; system tools act like fixed furniture in a room.
Strategies for Effective Token Management
Key Strategies to Reduce Costs
- Regularly check your spending with the command
/costto develop an awareness of what's expensive versus cheap during sessions.
- Use
/clearwhen switching tasks to eliminate irrelevant history from previous tasks that could slow down performance.
Custom Compaction Techniques
- The command
/compactallows users to selectively keep relevant information while discarding unnecessary conversation history, optimizing memory use.
Understanding Manual vs. Auto Compaction in Claude
The Importance of Control in Compaction
- Manual compaction allows users to control what information is preserved, unlike auto compaction which relies on Claude's judgment.
- Users should manually compact when they notice a slowdown or forgetfulness from Claude, indicating that context is becoming heavy.
- Waiting for auto compaction can lead to important details being lost; manual intervention ensures critical information is retained.
Strategies for Effective Use of Claude
Conciseness and Efficiency
- Implementing a conciseness instruction at the beginning of prompts can significantly reduce token usage, leading to cost savings.
- Verbose responses not only increase costs but also clutter context with unnecessary information, hindering performance.
Choosing the Right Model
- Utilize simpler models like Sonnet or Haiku for specific tasks instead of the more expensive Opus model, which should be reserved for complex synthesis tasks.
- Using high-capacity models unnecessarily can lead to inefficiencies akin to hiring an executive for basic tasks.
Auditing Context Usage
- Regularly check MCP tools that may consume excessive context space; disconnect those not needed during a session to optimize memory usage.
- Some setups may have MCP tools consuming up to 40% of total context before any work begins.
Crafting Specific Prompts
Maximizing Token Efficiency
- Specific prompts yield better results than vague ones; detailed instructions minimize token waste and enhance clarity in responses.
- Conduct research before building by planning out steps rather than making web requests mid-session, which can overload context with irrelevant data.
Respecting Context Limitations
Key Takeaways on Context Management
- All strategies emphasize the importance of managing the context window effectively; less clutter leads to improved performance and reduced costs.
- A small improvement in efficiency across multiple sessions can result in significant time and cost savings over time.
Leveraging Skills for Long-Term Capability
Transitioning from One-Time Tasks to Permanent Skills
- Developing skills transforms one-time tasks into repeatable capabilities within Claude, enhancing productivity and efficiency.
Understanding Skills in Claude
The Concept of Skills
- A skill is defined as a reusable checklist that automates repetitive tasks such as scraping leads, qualifying prospects, updating CRM, and generating reports.
- Without a skill, the process involves multiple clarifying questions from Claude, leading to a lengthy manual script-writing and debugging cycle that can take up to 30 minutes.
Efficiency of Skills
- With skills, all necessary decisions are pre-defined; Claude executes the task immediately without needing clarification or script creation.
- Skills differ from static scripts by being dynamic; they adapt to unexpected changes (e.g., API updates or rate limits), ensuring continuous operation without crashing.
Structure of Skills
- Each skill consists of two main components:
skill.md, which contains instructions and goals, and a scripts folder with executable code.
- Users do not need programming knowledge; they simply describe their desired outcomes in plain language while Claude generates the necessary code.
Learning and Adaptation
- If an error occurs (like hitting a rate limit), Claude learns from it by adjusting parameters (e.g., adding delays between requests) and updates
skill.mdfor future runs.
- Over time, skills become more robust through accumulated fixes without user intervention, enhancing reliability significantly.
Cost Efficiency of Skills
- Running multiple skills leads to compounding reliability improvements at no additional cost since users don't have to manage fixes themselves.
- Unlike MCP tools that incur costs regardless of usage, skills only consume resources when actively invoked. This makes them economically advantageous for recurring tasks.
Building Effective Skills
Skill Creation Process
- To create a skill, clearly articulate its purpose. For example: "I want a skill that automates client outreach based on industry and region."
- Specify inputs (industry and target region) and outputs (exporting results to Google Sheets). Clarity enhances the effectiveness of the generated skill.
Importance of Specificity
- Precise descriptions yield better results; vague instructions lead to imprecise skills. Clear input-output definitions improve overall functionality.
Skill Execution and Automation
Overview of Skill Functionality
- The file explorer allows users to open
skill.md, which contains essential front matter including name, description, and allowed tools. The full checklist is only loaded upon invocation.
- When a skill is invoked with a request (e.g., "Scrape me 10,000 cleaning services across Canada"), Claude automatically matches the request to the appropriate skill based on its description.
- Clear and specific descriptions in
skill.mdare crucial for Claude to find the right skill; vague descriptions may lead to missed matches or unnecessary task execution from scratch.
System Efficiency
- A system of multiple skills can be created where each performs a specific function (scraping leads, qualifying them, drafting emails, etc.), significantly improving efficiency while costing very little in tokens.
- This approach transforms Claude from merely an assistant into an operational system that runs autonomously while users focus on other tasks.
Model Context Protocol (MCP)
Introduction to MCP
- MCPS are pre-built skills maintained by developer teams that integrate various software applications like Gmail and Slack into Cloud Code using a JS snippet.
- Users can find MCP resources at mcpservers.org or GitHub. Caution is advised as these third-party libraries may not all be safe.
Installation Process
- To install an MCP, copy the provided JS snippet into Claude code and execute it within your local workspace. A new instance of Claude code must be opened for proper loading.
- While MCP installations are quick, they tend to be expensive in terms of token usage compared to custom skills created after testing tasks through MCP.
Sub Agents: Benefits and Risks
Understanding Sub Agents
- Sub agents offer powerful capabilities but can lead to increased costs and coordination issues if used prematurely or incorrectly. They should not be seen as a universal solution.
Parallelization Advantages
- Sub agents allow for parallel processing—while one agent writes code, others can review or test simultaneously, drastically reducing build time for large projects.
Cost Management Strategies
- Using less expensive models like Sonnet for routine tasks instead of premium models like Opus can save costs without sacrificing output quality.
Operational Mechanics of Sub Agents
Contextual Limitations
- Each sub agent operates within its own ephemeral context window; once the task is complete, this context dies. If a sub agent fails during execution, recovery requires rerunning the entire process without memory retention from previous sessions.
Understanding Sub Agents and Their Reliability
The Nature of Sub Agents
- Sub agents are designed to perform tasks independently, completing them and returning results without retaining context. This design choice makes them lightweight but also isolates them from one another.
- If a sub agent fails during a task, it cannot resume; the entire task must be restarted. This emphasizes the importance of keeping tasks small to minimize failure costs.
Importance of Task Size
- Smaller tasks lead to lower failure costs. For example, if a sub agent reviewing five files crashes on the third file, all five must be re-evaluated.
- The reliability math shows that with multiple agents (e.g., 10 agents at 95% success), the overall success rate drops significantly due to compounding probabilities.
Compounding Failure Risks
- In practice, if nine out of ten sub agents succeed but one fails silently, it can corrupt the final output synthesized by the parent agent.
- Debugging becomes challenging when mixed results occur because identifying which result is faulty requires sifting through outputs from all agents.
Best Practices for Designing Sub Agents
- Each sub agent should focus on a single task to isolate failures effectively. Combining multiple tasks increases complexity and debugging difficulty.
- A clear guideline is that if you can't describe a sub agent's task in one sentence, it's too complex and should be split into simpler components.
Workflow Automation with Sub Agents
- Examples of effective sub agents include:
- A code reviewer that identifies issues without fixing them.
- A QA agent responsible for generating tests and handling failures within its domain.
- A research agent that summarizes findings without making decisions based on them.
Establishing Consistent Workflows
- Each agent should have a defined responsibility with clear handoff points to ensure smooth operation within workflows.
- Documenting workflows in claude.md ensures consistency across sessions by automating processes like code review and testing.
Final Recommendations for Agent Management
- Use specific tools (Sonnet or Haiku for sub agents; Opus for parents), keep tasks simple, avoid large outputs returned to parents, and apply results directly within workflows.
- Be cautious about spawning sub agents for trivial tasks as they may incur overhead similar to having the parent handle those tasks directly.
Understanding Agent Efficiency and Team Dynamics
Task Overhead and Sub-Agent Utilization
- A complex task may have negligible overhead if it takes 5 minutes of actual work, while a simple task taking 10 seconds could incur more overhead than the task itself.
- For tasks under 30 seconds, it's advised not to spawn a sub-agent; instead, let the parent handle them directly. Sub-agents are beneficial for time-intensive or parallelizable tasks.
Managing Output from Sub-Agents
- When sub-agents return large outputs (e.g., a 2,000 line code review), it can flood the parent's context window with tokens.
- To mitigate this issue, sub-agents should apply changes directly rather than returning extensive results. The parent agent receives concise status updates instead.
Agent Teams: Structure and Functionality
- Experimental agent teams operate independently without a hierarchical structure; they share a task list and coordinate among themselves.
- This model mimics real team dynamics where agents can be productive or chaotic based on setup. Use cases include design exploration and adversarial analysis.
Cost Implications of Agent Teams
- Careless use of agent teams can lead to significant costs (over $10,000 per day). Each independent agent incurs token costs for messages and tasks.
- Without proper management, agents may enter loops debating results, wasting resources on unproductive discussions.
Best Practices for Using Agent Teams
- Agent teams are most effective when diverse perspectives are needed that cannot be achieved sequentially. For example, generating different website designs benefits from independent input.
- If only parallel execution is required without diversity in output, sub-agents are recommended as they are cheaper and more predictable.
Recommendations for Implementation
- Start small with agent teams while monitoring token usage closely. Utilize git worktrees to prevent conflicts when multiple agents edit the same file simultaneously.
- Git worktrees allow each agent to work in isolated copies of the codebase, merging results later to avoid execution conflicts.
Learning Curve with Agents
- It’s advisable to master sub-agents before experimenting with agent teams due to their increased complexity and cost implications.
- Once comfortable managing sub-agents efficiently, one can explore team dynamics on smaller tasks while keeping an eye on budget constraints.
Building Automated Systems
- With acquired skills from both tracks, users can build websites quickly using automated systems that integrate various functionalities like scraping and API skills.