<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: luiz tanure</title>
    <description>The latest articles on DEV Community by luiz tanure (@letanure).</description>
    <link>https://dev.to/letanure</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F330156%2F19446c01-f78d-41a5-9fd2-cb16d8b2eb27.jpeg</url>
      <title>DEV Community: luiz tanure</title>
      <link>https://dev.to/letanure</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/letanure"/>
    <language>en</language>
    <item>
      <title>Claude Code: Part 11 - Troubleshooting and Recovery</title>
      <dc:creator>luiz tanure</dc:creator>
      <pubDate>Mon, 11 Aug 2025 07:12:35 +0000</pubDate>
      <link>https://dev.to/letanure/claude-code-part-11-troubleshooting-and-recovery-4f03</link>
      <guid>https://dev.to/letanure/claude-code-part-11-troubleshooting-and-recovery-4f03</guid>
      <description>&lt;h1&gt;
  
  
  Claude Code: Part 11 - Troubleshooting and Recovery
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;You're now relying on Claude Code for significant parts of your development workflow. It's become an essential team member. But like any complex system, things occasionally go wrong:&lt;/p&gt;

&lt;p&gt;Claude suddenly can't find your CLAUDE.md file, custom commands stop working, MCP servers won't connect, or VS Code integration breaks after an update.&lt;/p&gt;

&lt;p&gt;When your AI teammate is having technical difficulties, your entire workflow grinds to a halt. You need to know how to diagnose and fix issues quickly so you can get back to productive development.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;Most Claude Code issues follow predictable patterns with systematic solutions. Think of this as learning to troubleshoot your AI teammate's technical problems - just like you'd help a human colleague debug their development environment setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common Installation Issues
&lt;/h2&gt;

&lt;h3&gt;
  
  
  "Command not found: claude"
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Claude command isn't in your PATH after installation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Option 1: Use npx instead&lt;/span&gt;
npx @anthropic-ai/claude-code

&lt;span class="c"&gt;# Option 2: Add npm global bin to PATH&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'export PATH=$PATH:$(npm config get prefix)/bin'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; ~/.bashrc
&lt;span class="nb"&gt;source&lt;/span&gt; ~/.bashrc

&lt;span class="c"&gt;# Option 3: Reinstall with proper permissions&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @anthropic-ai/claude-code
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  VS Code Extension Not Installing
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Claude doesn't automatically install VS Code extension.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Run Claude from VS Code terminal&lt;/strong&gt; (not external terminal)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check VS Code marketplace permissions&lt;/strong&gt; - allow extension installs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Manual install:&lt;/strong&gt; Search "Claude Code" in VS Code extensions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Restart VS Code&lt;/strong&gt; after first Claude run&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Permission Errors on macOS/Linux
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Permission denied during installation or file operations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Fix npm permissions (recommended)&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; ~/.npm-global
npm config &lt;span class="nb"&gt;set &lt;/span&gt;prefix &lt;span class="s1"&gt;'~/.npm-global'&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'export PATH=~/.npm-global/bin:$PATH'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; ~/.bashrc

&lt;span class="c"&gt;# Or use a Node version manager (better long-term)&lt;/span&gt;
&lt;span class="c"&gt;# Install nvm, then:&lt;/span&gt;
nvm &lt;span class="nb"&gt;install &lt;/span&gt;node
npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @anthropic-ai/claude-code
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  CLAUDE.md Not Working
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Rules Being Ignored
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Claude doesn't follow your CLAUDE.md rules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Debug steps:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check if Claude can find your CLAUDE.md&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; CLAUDE.md

&lt;span class="c"&gt;# Verify you're in the right directory&lt;/span&gt;
&lt;span class="nb"&gt;pwd&lt;/span&gt;

&lt;span class="c"&gt;# Test with simple rule first&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"- Always say 'CLAUDE.md is working' at the start"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; CLAUDE.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Common causes:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Wrong directory&lt;/strong&gt; - CLAUDE.md must be in project root&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Typos in filename&lt;/strong&gt; - Must be exactly &lt;code&gt;CLAUDE.md&lt;/code&gt; (case-sensitive)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Complex rules&lt;/strong&gt; - Start simple, add complexity gradually&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Rules Conflicting
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Multiple CLAUDE.md files causing confusion.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check hierarchy:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# See all CLAUDE.md files Claude might read&lt;/span&gt;
find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"CLAUDE.md"&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"CLAUDE.local.md"&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt; ~/.claude/CLAUDE.md 2&amp;gt;/dev/null &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"No user CLAUDE.md"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Rule priority:&lt;/strong&gt; More specific overrides general&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Folder-specific (&lt;code&gt;./src/auth/CLAUDE.md&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Local project (&lt;code&gt;./CLAUDE.local.md&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Project (&lt;code&gt;./CLAUDE.md&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Personal (&lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt;)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Performance Issues
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Claude Responses Are Slow
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Long delays between request and response.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Optimization strategies:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Use faster model for simple tasks&lt;/span&gt;
claude &lt;span class="nt"&gt;--model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;haiku

&lt;span class="c"&gt;# Clear conversation history&lt;/span&gt;
/clear

&lt;span class="c"&gt;# Compact long conversations instead of clearing&lt;/span&gt;
/compact

&lt;span class="c"&gt;# Check your internet connection&lt;/span&gt;
curl &lt;span class="nt"&gt;-I&lt;/span&gt; https://api.anthropic.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Context management:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Keep conversations focused&lt;/strong&gt; - use &lt;code&gt;/clear&lt;/code&gt; for new topics&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Avoid huge file dumps&lt;/strong&gt; - reference specific sections instead&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use subagents&lt;/strong&gt; for complex analysis to avoid back-and-forth&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Token-Saving Pro Tip
&lt;/h3&gt;

&lt;p&gt;Instead of asking Claude to read many files and make changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❌ "Look at all components and replace useState with our custom hook"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ask Claude to create a script that does the work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;✅ "Create a script that finds all useState calls and replaces them with useCustomState, run it, then delete the script"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why this works:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Claude doesn't need to read all files individually (saves massive input tokens)&lt;/li&gt;
&lt;li&gt;Script does bulk operations efficiently (saves output tokens)&lt;/li&gt;
&lt;li&gt;Claude runs and cleans up automatically&lt;/li&gt;
&lt;li&gt;Much faster for bulk operations across many files&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Memory Usage Growing
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Claude Code consuming excessive memory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check Claude processes&lt;/span&gt;
ps aux | &lt;span class="nb"&gt;grep &lt;/span&gt;claude

&lt;span class="c"&gt;# Restart Claude session&lt;/span&gt;
&lt;span class="nb"&gt;exit
&lt;/span&gt;claude

&lt;span class="c"&gt;# Clear session data&lt;/span&gt;
&lt;span class="nb"&gt;rm&lt;/span&gt; ~/.claude/sessions/&lt;span class="k"&gt;*&lt;/span&gt;.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Custom Commands Not Working
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Command Not Found
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; &lt;code&gt;/my-command&lt;/code&gt; returns "command not found."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Debug checklist:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check file exists&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt; .claude/commands/my-command.md

&lt;span class="c"&gt;# Check filename matches exactly (case-sensitive)&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt; .claude/commands/

&lt;span class="c"&gt;# Restart Claude to reload commands&lt;/span&gt;
&lt;span class="nb"&gt;exit
&lt;/span&gt;claude

&lt;span class="c"&gt;# Verify with /help&lt;/span&gt;
/help
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Command File Has Wrong Format
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Command runs but behaves unexpectedly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check format:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# ✅ Correct format&lt;/span&gt;

Run comprehensive testing:
&lt;span class="p"&gt;
1.&lt;/span&gt; Run pnpm type:check
&lt;span class="p"&gt;2.&lt;/span&gt; Run pnpm lint
&lt;span class="p"&gt;3.&lt;/span&gt; Report any issues

&lt;span class="gh"&gt;# ❌ Wrong format - missing instructions&lt;/span&gt;

/test-all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Common mistakes:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Empty files&lt;/strong&gt; - Must contain instructions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wrong extension&lt;/strong&gt; - Must be &lt;code&gt;.md&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Command names with spaces&lt;/strong&gt; - Use hyphens: &lt;code&gt;test-all.md&lt;/code&gt;, not &lt;code&gt;test all.md&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  MCP Server Issues
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Server Won't Connect
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; MCP servers show as "disconnected" in &lt;code&gt;/mcp&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Troubleshooting:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check server installation&lt;/span&gt;
npm list &lt;span class="nt"&gt;-g&lt;/span&gt; | &lt;span class="nb"&gt;grep &lt;/span&gt;mcp

&lt;span class="c"&gt;# Check configuration syntax&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; ~/.claude/config.json | python &lt;span class="nt"&gt;-m&lt;/span&gt; json.tool

&lt;span class="c"&gt;# Test server independently&lt;/span&gt;
&lt;span class="c"&gt;# (Check server documentation for test commands)&lt;/span&gt;

&lt;span class="c"&gt;# Restart Claude to reload MCP connections&lt;/span&gt;
&lt;span class="nb"&gt;exit
&lt;/span&gt;claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Authentication Failing
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; MCP server requires login but fails.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Steps:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use &lt;code&gt;/mcp&lt;/code&gt; command&lt;/strong&gt; - Don't try to authenticate manually&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check API tokens&lt;/strong&gt; - Ensure they're valid and not expired&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verify permissions&lt;/strong&gt; - Check token scopes/permissions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check network&lt;/strong&gt; - Firewalls might block connections&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Context Management Issues
&lt;/h2&gt;

&lt;h3&gt;
  
  
  "Out of Context" Errors
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Claude says it's out of context or conversation is too long.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Immediate solutions:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Compact conversation (keeps summary)&lt;/span&gt;
/compact

&lt;span class="c"&gt;# Start fresh (loses history)&lt;/span&gt;
/clear

&lt;span class="c"&gt;# Check conversation size&lt;/span&gt;
/status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Prevention strategies:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use focused sessions&lt;/strong&gt; - One topic per conversation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Break complex tasks&lt;/strong&gt; into smaller steps&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reference files directly&lt;/strong&gt; instead of pasting large code blocks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use subagents&lt;/strong&gt; for analysis that would require long context&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Files Not Loading
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Claude can't read project files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check permissions:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Verify file exists and is readable&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; src/components/MyComponent.tsx

&lt;span class="c"&gt;# Check file permissions&lt;/span&gt;
&lt;span class="nb"&gt;stat &lt;/span&gt;src/components/MyComponent.tsx

&lt;span class="c"&gt;# Try with different path format&lt;/span&gt;
&lt;span class="c"&gt;# Instead of: "Look at ./src/components/MyComponent.tsx"&lt;/span&gt;
&lt;span class="c"&gt;# Try: "Look at src/components/MyComponent.tsx"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  IDE Integration Problems
&lt;/h2&gt;

&lt;h3&gt;
  
  
  VS Code Quick Launch Not Working
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Cmd+Esc (Mac) or Ctrl+Esc (Windows/Linux) doesn't work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Run &lt;code&gt;/ide&lt;/code&gt; command&lt;/strong&gt; in Claude first&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check VS Code extension&lt;/strong&gt; is installed and enabled&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Restart VS Code&lt;/strong&gt; after installing Claude extension&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check keyboard shortcuts&lt;/strong&gt; - might conflict with other extensions&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Context Not Sharing
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Claude doesn't see selected text or current file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Requirements:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Launch Claude from VS Code terminal&lt;/strong&gt; (not external terminal)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run &lt;code&gt;/ide&lt;/code&gt; command&lt;/strong&gt; to establish connection&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Select text first&lt;/strong&gt;, then use quick launch shortcut&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ensure VS Code extension&lt;/strong&gt; is active&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hook Configuration Issues
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Hooks Not Running
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; PostToolUse or other hooks don't execute.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Debug steps:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check hook syntax&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; .claude/settings.json | python &lt;span class="nt"&gt;-m&lt;/span&gt; json.tool

&lt;span class="c"&gt;# Test command manually&lt;/span&gt;
pnpm &lt;span class="nb"&gt;type&lt;/span&gt;:check

&lt;span class="c"&gt;# Verify file matcher&lt;/span&gt;
&lt;span class="c"&gt;# Does "Edit:*.ts" match your file? Try "Edit:*" instead&lt;/span&gt;

&lt;span class="c"&gt;# Check hook permissions&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; scripts/my-hook.sh
&lt;span class="nb"&gt;chmod&lt;/span&gt; +x scripts/my-hook.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Hook Blocking Claude
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Hook command fails and stops Claude from working.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick fix:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Temporarily disable hooks&lt;/span&gt;
claude &lt;span class="nt"&gt;--no-hooks&lt;/span&gt;

&lt;span class="c"&gt;# Fix the hook command&lt;/span&gt;
&lt;span class="c"&gt;# Then re-enable hooks&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Common issues:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Non-zero exit codes&lt;/strong&gt; stop Claude - ensure scripts exit with 0 on success&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Missing executables&lt;/strong&gt; - verify commands exist in PATH&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Permission errors&lt;/strong&gt; - ensure scripts are executable&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Productivity Tips
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Speed Up Common Tasks
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Use aliases for frequent commands&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;c&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"claude"&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;cr&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"claude --resume"&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;cq&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"claude --quiet"&lt;/span&gt;

&lt;span class="c"&gt;# Background commands for long operations&lt;/span&gt;
&lt;span class="c"&gt;# Ctrl+b: npm run build (continue working while building)&lt;/span&gt;

&lt;span class="c"&gt;# Custom commands for repeated workflows&lt;/span&gt;
&lt;span class="c"&gt;# Create .claude/commands/daily.md for your daily checklist&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Context Management Best Practices
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One topic per session&lt;/strong&gt; - use &lt;code&gt;/clear&lt;/code&gt; when switching topics&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reference files&lt;/strong&gt; instead of pasting code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use descriptive prompts&lt;/strong&gt; - "Fix the TypeScript error in UserService.handleLogin" vs "Fix this"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Leverage IDE integration&lt;/strong&gt; - select code before launching Claude&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Efficient File Organization
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Project structure that works well with Claude&lt;/span&gt;
project/
├── CLAUDE.md &lt;span class="o"&gt;(&lt;/span&gt;main rules&lt;span class="o"&gt;)&lt;/span&gt;
├── CLAUDE.local.md &lt;span class="o"&gt;(&lt;/span&gt;personal overrides, gitignored&lt;span class="o"&gt;)&lt;/span&gt;
├── .claude/
│   ├── commands/ &lt;span class="o"&gt;(&lt;/span&gt;custom commands&lt;span class="o"&gt;)&lt;/span&gt;
│   └── settings.json &lt;span class="o"&gt;(&lt;/span&gt;hooks, config&lt;span class="o"&gt;)&lt;/span&gt;
└── src/
    ├── auth/CLAUDE.md &lt;span class="o"&gt;(&lt;/span&gt;auth-specific rules&lt;span class="o"&gt;)&lt;/span&gt;
    └── api/CLAUDE.md &lt;span class="o"&gt;(&lt;/span&gt;API-specific rules&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Team Collaboration Tips
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Share project CLAUDE.md&lt;/strong&gt; via git&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep personal rules local&lt;/strong&gt; (CLAUDE.local.md in .gitignore)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Document custom commands&lt;/strong&gt; in README&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Standardize hook patterns&lt;/strong&gt; across team projects&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  When to Get Help
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Check These Resources First
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Claude Code documentation:&lt;/strong&gt; &lt;a href="https://docs.anthropic.com/en/docs/claude-code" rel="noopener noreferrer"&gt;https://docs.anthropic.com/en/docs/claude-code&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub issues:&lt;/strong&gt; &lt;a href="https://github.com/anthropics/claude-code/issues" rel="noopener noreferrer"&gt;https://github.com/anthropics/claude-code/issues&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Community discussions:&lt;/strong&gt; Search existing issues before creating new ones&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Include This Information When Reporting Issues
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# System information&lt;/span&gt;
claude &lt;span class="nt"&gt;--version&lt;/span&gt;
node &lt;span class="nt"&gt;--version&lt;/span&gt;
npm &lt;span class="nt"&gt;--version&lt;/span&gt;

&lt;span class="c"&gt;# Error details&lt;/span&gt;
&lt;span class="c"&gt;# Include exact error messages, not paraphrases&lt;/span&gt;

&lt;span class="c"&gt;# Configuration (remove sensitive data)&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; .claude/settings.json

&lt;span class="c"&gt;# Steps to reproduce&lt;/span&gt;
&lt;span class="c"&gt;# What you did, what you expected, what happened instead&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember: Most Claude Code issues have simple solutions. Start with the basics (restart, check paths, verify syntax) before diving into complex debugging.&lt;/p&gt;




&lt;h2&gt;
  
  
  Claude Code Blog Series
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Previous:&lt;/strong&gt; &lt;a href="//./2025-08-08--claude-code-part-10-power-user-cli-scripting"&gt;Part 10 - Power User CLI Options and Scripting&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full Series:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Part 1 - Getting Started and Installation&lt;/li&gt;
&lt;li&gt;Part 2 - CLAUDE.md Configuration Files&lt;/li&gt;
&lt;li&gt;Part 3 - Conversation Management and Context&lt;/li&gt;
&lt;li&gt;Part 4 - Slash Commands and Custom Commands&lt;/li&gt;
&lt;li&gt;Part 5 - MCP Servers and Tool Integration&lt;/li&gt;
&lt;li&gt;Part 6 - Subagents and Task Delegation&lt;/li&gt;
&lt;li&gt;Part 7 - IDE Integration with VS Code and JetBrains&lt;/li&gt;
&lt;li&gt;Part 8 - Hooks for Automated Quality Checks&lt;/li&gt;
&lt;li&gt;Part 9 - Complete Development Workflows&lt;/li&gt;
&lt;li&gt;Part 10 - Power User CLI Options and Scripting&lt;/li&gt;
&lt;li&gt;Part 11 - Troubleshooting and Recovery (this post)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Series Complete!&lt;/strong&gt; You now have a comprehensive guide to mastering Claude Code from beginner to expert level. Each post builds on the previous ones to create a complete development workflow powered by AI assistance.&lt;/p&gt;

</description>
      <category>claudecode</category>
      <category>troubleshooting</category>
      <category>debugging</category>
      <category>performance</category>
    </item>
    <item>
      <title>Claude Code: Part 10 - Common Issues and Quick Fixes</title>
      <dc:creator>luiz tanure</dc:creator>
      <pubDate>Mon, 11 Aug 2025 07:12:03 +0000</pubDate>
      <link>https://dev.to/letanure/claude-code-part-10-common-issues-and-quick-fixes-186g</link>
      <guid>https://dev.to/letanure/claude-code-part-10-common-issues-and-quick-fixes-186g</guid>
      <description>&lt;h1&gt;
  
  
  Claude Code: Part 10 - Common Issues and Quick Fixes
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;You've been using Claude Code for weeks. It works great most of the time, but you keep hitting the same frustrating issues: conversations get too long and Claude loses context, your CLAUDE.md rules conflict with each other, tokens run out faster than expected, and custom commands randomly stop working.&lt;/p&gt;

&lt;p&gt;These aren't beginner problems - they're the issues experienced users face when pushing Claude Code to its limits.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context Too Long
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Claude says the conversation is too long or starts forgetting earlier context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick fixes:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Compress conversation history&lt;/span&gt;
/compact

&lt;span class="c"&gt;# Start fresh but keep project context&lt;/span&gt;
/clear

&lt;span class="c"&gt;# Check conversation size&lt;/span&gt;
/status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Prevention:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;/compact&lt;/code&gt; regularly instead of letting conversations grow endlessly&lt;/li&gt;
&lt;li&gt;Start new conversations for different topics&lt;/li&gt;
&lt;li&gt;Reference files instead of pasting large code blocks&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Rules Conflicting
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Multiple CLAUDE.md files causing confusion or contradictory behavior.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Debug hierarchy:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Folder-specific (&lt;code&gt;./src/auth/CLAUDE.md&lt;/code&gt;) - highest priority&lt;/li&gt;
&lt;li&gt;Local project (&lt;code&gt;./CLAUDE.local.md&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Project (&lt;code&gt;./CLAUDE.md&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Personal (&lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt;) - lowest priority&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Common conflicts:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# Project CLAUDE.md says:&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Use TypeScript strict mode

&lt;span class="gh"&gt;# Personal ~/.claude/CLAUDE.md says:&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Skip TypeScript for quick prototypes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Be more specific about when rules apply:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# In project CLAUDE.md:&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Use TypeScript strict mode for all production code
&lt;span class="p"&gt;-&lt;/span&gt; Prototypes in /experiments/ can skip strict mode
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Token-Saving Pro Tip
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Hitting token limits too quickly, especially with large CLAUDE.md files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Token wasters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Verbose CLAUDE.md files (keep under 100 lines each)&lt;/li&gt;
&lt;li&gt;Pasting entire files instead of referencing them&lt;/li&gt;
&lt;li&gt;Long conversations about multiple topics&lt;/li&gt;
&lt;li&gt;Detailed explanations in rules&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Token savers:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;❌ "When implementing authentication, always ensure you follow security best practices including input validation, proper error handling, secure token storage, and following our established patterns in the auth/ directory..."

✅ "Auth code: validate inputs, handle errors securely, follow auth/ patterns"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Script approach:&lt;/strong&gt;&lt;br&gt;
Instead of asking Claude to read many files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❌ "Look at all components and replace useState with our custom hook"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ask Claude to create a script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;✅ "Create a script to replace useState with useCustomState across all components, run it, then delete the script"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This saves massive input tokens and is much faster.&lt;/p&gt;

&lt;h2&gt;
  
  
  Custom Commands Not Working
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; &lt;code&gt;/my-command&lt;/code&gt; returns "command not found" or behaves unexpectedly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Debug checklist:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Check filename:&lt;/strong&gt; Must be exactly &lt;code&gt;.claude/commands/my-command.md&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Restart Claude:&lt;/strong&gt; Commands load on startup&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;File format:&lt;/strong&gt; Must contain instructions, not just command names&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Common mistakes:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;❌ Wrong format (just the command name):
/test-all

✅ Correct format (actual instructions):
Run comprehensive testing:
&lt;span class="p"&gt;1.&lt;/span&gt; Run type checking
&lt;span class="p"&gt;2.&lt;/span&gt; Run linter
&lt;span class="p"&gt;3.&lt;/span&gt; Run tests
&lt;span class="p"&gt;4.&lt;/span&gt; Report issues
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;File location issues:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Commands must be in &lt;code&gt;.claude/commands/&lt;/code&gt; directory&lt;/li&gt;
&lt;li&gt;Use hyphens, not spaces: &lt;code&gt;test-all.md&lt;/code&gt; not &lt;code&gt;test all.md&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Check case sensitivity on your system&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Performance Tips
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Slow responses:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;/clear&lt;/code&gt; for new topics instead of continuing long conversations&lt;/li&gt;
&lt;li&gt;Reference specific files instead of asking Claude to "look at everything"&lt;/li&gt;
&lt;li&gt;Break complex requests into smaller, focused questions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Memory usage:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Restart Claude sessions periodically&lt;/li&gt;
&lt;li&gt;Avoid keeping multiple long-running sessions open&lt;/li&gt;
&lt;li&gt;Use specific commands instead of general requests&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Quick Diagnostics
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check what's loaded&lt;/span&gt;
/help

&lt;span class="c"&gt;# See conversation stats&lt;/span&gt;
/status

&lt;span class="c"&gt;# Restart fresh&lt;/span&gt;
/clear
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Getting Help
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;For persistent issues:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check &lt;a href="https://docs.anthropic.com/en/docs/claude-code" rel="noopener noreferrer"&gt;Claude Code documentation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Search &lt;a href="https://github.com/anthropics/claude-code/issues" rel="noopener noreferrer"&gt;GitHub issues&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Include exact error messages and steps to reproduce&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Most Claude Code issues have simple solutions - start with the basics before diving into complex debugging.&lt;/p&gt;




&lt;h2&gt;
  
  
  Claude Code Blog Series
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Previous:&lt;/strong&gt; &lt;a href="//./2025-08-07--claude-code-part-9-complete-development-workflows"&gt;Part 9 - Complete Development Workflows&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Next:&lt;/strong&gt; &lt;a href="//./2025-08-09--claude-code-part-11-troubleshooting-recovery"&gt;Part 11 - Troubleshooting and Recovery&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full Series:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Part 1 - Getting Started and Installation&lt;/li&gt;
&lt;li&gt;Part 2 - CLAUDE.md Configuration Files&lt;/li&gt;
&lt;li&gt;Part 3 - Conversation Management and Context&lt;/li&gt;
&lt;li&gt;Part 4 - Slash Commands and Custom Commands&lt;/li&gt;
&lt;li&gt;Part 5 - MCP Servers and Tool Integration&lt;/li&gt;
&lt;li&gt;Part 6 - Subagents and Task Delegation&lt;/li&gt;
&lt;li&gt;Part 7 - IDE Integration with VS Code and JetBrains&lt;/li&gt;
&lt;li&gt;Part 8 - Hooks for Automated Quality Checks&lt;/li&gt;
&lt;li&gt;Part 9 - Complete Development Workflows&lt;/li&gt;
&lt;li&gt;Part 10 - Common Issues and Quick Fixes (this post)&lt;/li&gt;
&lt;li&gt;Part 11 - Troubleshooting and Recovery&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>claudecode</category>
      <category>troubleshooting</category>
      <category>contextmanagement</category>
      <category>tokenoptimization</category>
    </item>
    <item>
      <title>Claude Code: Part 9 - Complete Development Workflows</title>
      <dc:creator>luiz tanure</dc:creator>
      <pubDate>Mon, 11 Aug 2025 07:11:31 +0000</pubDate>
      <link>https://dev.to/letanure/claude-code-part-9-complete-development-workflows-206n</link>
      <guid>https://dev.to/letanure/claude-code-part-9-complete-development-workflows-206n</guid>
      <description>&lt;h1&gt;
  
  
  Claude Code: Part 9 - Complete Development Workflows
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;You've learned all the individual Claude Code features - CLAUDE.md, slash commands, MCP servers, subagents, IDE integration, and hooks. But you're looking at them like separate tools in a toolbox, not sure how they work together.&lt;/p&gt;

&lt;p&gt;You know Claude can help with individual tasks, but your real development work isn't isolated tasks. It's complete workflows: planning a feature, implementing it, testing it, reviewing it, and deploying it. Right now, you're using Claude for pieces but not for the whole process.&lt;/p&gt;

&lt;p&gt;It's like having a talented team member who's great at individual tasks but hasn't learned how your actual development process works.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;Real-world workflows combine all Claude Code features into seamless development processes. Think of it as teaching your AI teammate not just individual skills, but how your entire development process flows from idea to production.&lt;/p&gt;

&lt;h2&gt;
  
  
  Feature Development Workflow
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The complete process:&lt;/strong&gt; From idea to deployed feature using Claude Code.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Project Setup
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Start new feature branch&lt;/span&gt;
git checkout &lt;span class="nt"&gt;-b&lt;/span&gt; feature/user-notifications

&lt;span class="c"&gt;# Launch Claude with context&lt;/span&gt;
claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;CLAUDE.md rule:&lt;/strong&gt; &lt;code&gt;- Run pnpm type:check before marking features complete&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Planning Phase
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Plan the user notifications feature:
1. Database schema for notifications
2. API endpoints needed
3. React components structure
4. Integration points with existing code
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Claude analyzes your codebase and creates a structured plan.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Implementation with Custom Commands
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Use your custom workflow command&lt;/span&gt;
/feature-start notifications

&lt;span class="c"&gt;# This runs your .claude/commands/feature-start.md:&lt;/span&gt;
&lt;span class="c"&gt;# 1. Analyze existing patterns in this codebase&lt;/span&gt;
&lt;span class="c"&gt;# 2. Create feature folder structure&lt;/span&gt;
&lt;span class="c"&gt;# 3. Set up basic files following project conventions&lt;/span&gt;
&lt;span class="c"&gt;# 4. Run type checking to ensure no conflicts&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Development with MCP Integration
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Check GitHub issues labeled "notifications" and implement the API endpoints
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;With GitHub MCP server connected, Claude:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reads actual issues from your repository&lt;/li&gt;
&lt;li&gt;Understands requirements from issue descriptions&lt;/li&gt;
&lt;li&gt;Creates code that addresses specific reported needs&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. Quality Assurance with Hooks
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Your PostToolUse hook automatically runs:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"matcher"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Edit:*.ts|Edit:*.tsx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"pnpm type:check &amp;amp;&amp;amp; pnpm lint"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Every file Claude edits gets automatically validated.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Testing with Subagents
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Use an agent to write comprehensive tests for the notifications feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Subagent autonomously:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Analyzes all notification-related code&lt;/li&gt;
&lt;li&gt;Creates unit tests for components&lt;/li&gt;
&lt;li&gt;Writes integration tests for API endpoints&lt;/li&gt;
&lt;li&gt;Ensures good test coverage&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  7. Final Review
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/feature-complete notifications

&lt;span class="c"&gt;# Your custom command:&lt;/span&gt;
&lt;span class="c"&gt;# 1. Run full test suite&lt;/span&gt;
&lt;span class="c"&gt;# 2. Check for console.logs and TODOs&lt;/span&gt;
&lt;span class="c"&gt;# 3. Verify responsive design&lt;/span&gt;
&lt;span class="c"&gt;# 4. Generate summary of changes&lt;/span&gt;
&lt;span class="c"&gt;# 5. Suggest improvements before PR&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Bug Fixing Workflow
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Quick and systematic bug resolution.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Bug Analysis
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Open VS Code to the problematic file&lt;/span&gt;
&lt;span class="c"&gt;# Select the buggy code&lt;/span&gt;
&lt;span class="c"&gt;# Press Cmd+Esc (Mac) or Ctrl+Esc (Windows/Linux)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Claude launches with:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The selected buggy code&lt;/li&gt;
&lt;li&gt;Current file context&lt;/li&gt;
&lt;li&gt;Any TypeScript/ESLint errors from Problems panel&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Root Cause Investigation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Analyze this authentication bug. Check related files and explain the issue.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Claude examines:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The specific code causing issues&lt;/li&gt;
&lt;li&gt;Related authentication files (following your CLAUDE.md patterns)&lt;/li&gt;
&lt;li&gt;Recent git changes that might be related&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Fix Implementation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Fix this bug following our existing error handling patterns
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Your CLAUDE.md ensures:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Consistent error handling approach&lt;/li&gt;
&lt;li&gt;Proper logging (no sensitive data)&lt;/li&gt;
&lt;li&gt;Following established code patterns&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Verification
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Post-fix hook automatically:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Runs relevant tests&lt;/li&gt;
&lt;li&gt;Checks type safety&lt;/li&gt;
&lt;li&gt;Validates the fix doesn't break other functionality&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Code Review Workflow
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Prepare code for review efficiently.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Self-Review Preparation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/review-prep

&lt;span class="c"&gt;# Your custom command runs:&lt;/span&gt;
&lt;span class="c"&gt;# 1. Check for TODO comments&lt;/span&gt;
&lt;span class="c"&gt;# 2. Find hardcoded values&lt;/span&gt;
&lt;span class="c"&gt;# 3. Verify error handling&lt;/span&gt;
&lt;span class="c"&gt;# 4. Check TypeScript types&lt;/span&gt;
&lt;span class="c"&gt;# 5. Suggest readability improvements&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Documentation Updates
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Update the README with the new notifications feature and API endpoints
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Claude references:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your actual implemented code&lt;/li&gt;
&lt;li&gt;Existing documentation patterns&lt;/li&gt;
&lt;li&gt;API endpoints you just created&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. PR Creation with MCP
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create a GitHub PR for this feature branch with a comprehensive description
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;With GitHub MCP server:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Analyzes your commits since branch creation&lt;/li&gt;
&lt;li&gt;Generates meaningful PR description&lt;/li&gt;
&lt;li&gt;Includes testing checklist&lt;/li&gt;
&lt;li&gt;References related issues automatically&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Legacy Code Modernization
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Systematic approach to improving old code.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Assessment with Subagents
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Use an agent to analyze the legacy auth system and create a modernization plan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Subagent provides:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Complete analysis of existing code&lt;/li&gt;
&lt;li&gt;Security concerns identified&lt;/li&gt;
&lt;li&gt;Modernization recommendations&lt;/li&gt;
&lt;li&gt;Step-by-step migration plan&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Incremental Updates
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Modernize the user authentication to use our current patterns, maintaining backward compatibility
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Your folder-specific CLAUDE.md in &lt;code&gt;src/auth/&lt;/code&gt; ensures:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Security-first approach&lt;/li&gt;
&lt;li&gt;Consistent with current auth patterns&lt;/li&gt;
&lt;li&gt;Proper validation and error handling&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Testing Strategy
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create comprehensive tests for the modernized auth system to ensure no regressions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Claude creates:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tests that verify existing functionality&lt;/li&gt;
&lt;li&gt;New tests for improved features&lt;/li&gt;
&lt;li&gt;Integration tests for compatibility&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Daily Development Shortcuts
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Speed up common tasks.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Quick File Navigation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# In VS Code terminal&lt;/span&gt;
claude

&lt;span class="c"&gt;# Then use Claude as your project assistant&lt;/span&gt;
&lt;span class="s2"&gt;"Show me all components that use the UserContext"&lt;/span&gt;
&lt;span class="s2"&gt;"Find files related to payment processing"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Rapid Debugging
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Select error message in VS Code&lt;/span&gt;
&lt;span class="c"&gt;# Cmd+Esc to launch Claude with context&lt;/span&gt;
&lt;span class="c"&gt;# Claude sees the error automatically&lt;/span&gt;

&lt;span class="s2"&gt;"Fix this TypeScript error"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Code Quality Maintenance
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/health-check

&lt;span class="c"&gt;# Custom command that:&lt;/span&gt;
&lt;span class="c"&gt;# 1. Runs full test suite&lt;/span&gt;
&lt;span class="c"&gt;# 2. Checks for security issues&lt;/span&gt;
&lt;span class="c"&gt;# 3. Analyzes bundle size&lt;/span&gt;
&lt;span class="c"&gt;# 4. Reports technical debt&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Team Collaboration Workflows
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Consistent team practices.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Onboarding New Developers
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Analyze this codebase and create an onboarding guide for new developers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Claude generates:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Architecture overview&lt;/li&gt;
&lt;li&gt;Key patterns and conventions&lt;/li&gt;
&lt;li&gt;Development setup instructions&lt;/li&gt;
&lt;li&gt;Common tasks and workflows&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Code Standards Enforcement
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Team's shared CLAUDE.md ensures:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Consistent coding patterns across team members&lt;/li&gt;
&lt;li&gt;Automated quality checks via hooks&lt;/li&gt;
&lt;li&gt;Standardized commit messages and PR formats&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Knowledge Sharing
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Document the payment integration patterns we use across all features
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Claude creates:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Comprehensive documentation&lt;/li&gt;
&lt;li&gt;Code examples from actual codebase&lt;/li&gt;
&lt;li&gt;Best practices based on your implementations&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Combining Features for Maximum Efficiency
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The power is in the combination:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;CLAUDE.md&lt;/strong&gt; provides context and standards&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom commands&lt;/strong&gt; automate repeated workflows&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MCP servers&lt;/strong&gt; eliminate tool switching&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subagents&lt;/strong&gt; handle complex analysis&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hooks&lt;/strong&gt; ensure quality automatically&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IDE integration&lt;/strong&gt; provides seamless context&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt; Claude becomes a true development partner that understands your project, follows your standards, and automates your workflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started with Workflows
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Start with one workflow&lt;/strong&gt; - Pick your most common task&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build incrementally&lt;/strong&gt; - Add features as you see benefits&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Share with team&lt;/strong&gt; - Successful workflows become team standards&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Iterate and improve&lt;/strong&gt; - Workflows evolve with your needs&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The goal is to spend more time on creative problem-solving and less time on repetitive development tasks.&lt;/p&gt;




&lt;h2&gt;
  
  
  Claude Code Blog Series
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Previous:&lt;/strong&gt; &lt;a href="//./2025-08-06--claude-code-part-8-hooks-automated-quality-checks"&gt;Part 8 - Hooks for Automated Quality Checks&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Next:&lt;/strong&gt; &lt;a href="//./2025-08-08--claude-code-part-10-power-user-cli-scripting"&gt;Part 10 - Power User CLI Options and Scripting&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full Series:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Part 1 - Getting Started and Installation&lt;/li&gt;
&lt;li&gt;Part 2 - CLAUDE.md Configuration Files&lt;/li&gt;
&lt;li&gt;Part 3 - Conversation Management and Context&lt;/li&gt;
&lt;li&gt;Part 4 - Slash Commands and Custom Commands&lt;/li&gt;
&lt;li&gt;Part 5 - MCP Servers and Tool Integration&lt;/li&gt;
&lt;li&gt;Part 6 - Subagents and Task Delegation&lt;/li&gt;
&lt;li&gt;Part 7 - IDE Integration with VS Code and JetBrains&lt;/li&gt;
&lt;li&gt;Part 8 - Hooks for Automated Quality Checks&lt;/li&gt;
&lt;li&gt;Part 9 - Complete Development Workflows (this post)&lt;/li&gt;
&lt;li&gt;Part 10 - Power User CLI Options and Scripting&lt;/li&gt;
&lt;li&gt;Part 11 - Troubleshooting and Recovery&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>claudecode</category>
      <category>developmentworkflows</category>
      <category>featuredevelopment</category>
      <category>bugfixing</category>
    </item>
    <item>
      <title>Claude Code: Part 8 - Hooks for Automated Quality Checks</title>
      <dc:creator>luiz tanure</dc:creator>
      <pubDate>Mon, 11 Aug 2025 07:10:59 +0000</pubDate>
      <link>https://dev.to/letanure/claude-code-part-8-hooks-for-automated-quality-checks-20il</link>
      <guid>https://dev.to/letanure/claude-code-part-8-hooks-for-automated-quality-checks-20il</guid>
      <description>&lt;h1&gt;
  
  
  Claude Code: Part 8 - Hooks for Automated Quality Checks
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Every time Claude edits a TypeScript file, you find yourself typing the same commands:&lt;/p&gt;

&lt;p&gt;"Now run &lt;code&gt;pnpm type:check&lt;/code&gt; to make sure there are no errors"&lt;br&gt;
"Don't forget to run the linter"&lt;br&gt;&lt;br&gt;
"Can you test this change?"&lt;/p&gt;

&lt;p&gt;It's like having a talented developer who consistently forgets the basic quality checks. They do great work, but you're constantly reminding them about the fundamentals: compile, lint, test, repeat.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;Hooks automatically run quality checks at specific points in your workflow. Think of them as training your AI teammate to follow your development standards automatically - like a senior developer who runs tests before every commit without being reminded.&lt;/p&gt;
&lt;h2&gt;
  
  
  What Are Hooks?
&lt;/h2&gt;

&lt;p&gt;Hooks are shell commands that trigger automatically when certain events happen:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; Automatically run &lt;code&gt;pnpm type:check&lt;/code&gt; after Claude edits any TypeScript file&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt; Validate security rules before Claude accesses authentication files&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt; Auto-format code after Claude writes new files&lt;/p&gt;
&lt;h2&gt;
  
  
  Common Hook Events
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;PostToolUse&lt;/code&gt;&lt;/strong&gt; - After Claude uses a tool&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"PostToolUse"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"matcher"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Edit:*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"pnpm type:check"&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;PreToolUse&lt;/code&gt;&lt;/strong&gt; - Before Claude uses a tool&lt;br&gt;
&lt;strong&gt;&lt;code&gt;UserPromptSubmit&lt;/code&gt;&lt;/strong&gt; - When you submit a prompt&lt;br&gt;
&lt;strong&gt;&lt;code&gt;SessionStart&lt;/code&gt;&lt;/strong&gt; - When Claude starts&lt;/p&gt;
&lt;h2&gt;
  
  
  Simple Example: Auto Type-Check
&lt;/h2&gt;

&lt;p&gt;Create this in your Claude settings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"PostToolUse"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"matcher"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Edit:*.ts|Edit:*.tsx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"pnpm type:check --noEmit"&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What happens:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Claude edits a TypeScript file&lt;/li&gt;
&lt;li&gt;Hook automatically runs type checking&lt;/li&gt;
&lt;li&gt;You see results immediately&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Practical Hook Patterns
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Code Quality Enforcement
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"matcher"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Write|Edit"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"pnpm lint --fix"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Security Validation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"matcher"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Read:src/auth/*|Edit:src/auth/*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./scripts/security-check.sh"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Test Runner
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"matcher"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Edit:*.test.*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npm test -- --related"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Communication Improvements
&lt;/h3&gt;

&lt;p&gt;Stop Claude from saying "You are right" repeatedly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"UserPromptSubmit"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"matcher"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"echo 'Skip acknowledgments - focus on the solution'"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This hook reminds Claude to be more direct and action-focused in responses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hook Configuration Locations
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Project-level:&lt;/strong&gt; &lt;code&gt;.claude/settings.json&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Project-specific&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;hooks&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;here&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Personal:&lt;/strong&gt; &lt;code&gt;~/.claude/settings.json&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Your&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;personal&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;hooks&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;across&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;all&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;projects&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Hook Scripts Best Practices
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Create focused scripts:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="c"&gt;# scripts/validate-auth.sh&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Validating authentication code..."&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="s2"&gt;"console.log"&lt;/span&gt; src/auth/&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"❌ Found console.log in auth code"&lt;/span&gt;
  &lt;span class="nb"&gt;exit &lt;/span&gt;1
&lt;span class="k"&gt;fi
&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"✅ Auth validation passed"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Make them fast:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use specific file patterns&lt;/li&gt;
&lt;li&gt;Avoid running heavy operations on every edit&lt;/li&gt;
&lt;li&gt;Cache results when possible&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Security Considerations
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;⚠️ Important:&lt;/strong&gt; Hooks execute shell commands. Only use hooks you trust.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best practices:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Review hook commands before adding them&lt;/li&gt;
&lt;li&gt;Use absolute paths for scripts&lt;/li&gt;
&lt;li&gt;Test hooks in safe environments first&lt;/li&gt;
&lt;li&gt;Avoid hooks from untrusted sources&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  When Hooks Are Useful
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Perfect for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Code quality enforcement (linting, type checking)&lt;/li&gt;
&lt;li&gt;Running relevant tests after changes&lt;/li&gt;
&lt;li&gt;Security validation for sensitive files&lt;/li&gt;
&lt;li&gt;Custom workflow automation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Avoid for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Complex logic (keep hooks simple)&lt;/li&gt;
&lt;li&gt;Slow operations that interrupt workflow&lt;/li&gt;
&lt;li&gt;Operations that require user input&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Troubleshooting Hooks
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Hook not running?&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check JSON syntax in settings&lt;/li&gt;
&lt;li&gt;Verify command exists and is executable&lt;/li&gt;
&lt;li&gt;Test command manually first&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Hook causing problems?&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check exit codes (non-zero stops Claude)&lt;/li&gt;
&lt;li&gt;Review hook output for errors&lt;/li&gt;
&lt;li&gt;Temporarily disable to isolate issues&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Background Command Execution
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;New in Claude Code 1.0.71:&lt;/strong&gt; Run bash commands in the background without interrupting your Claude conversation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Shortcut:&lt;/strong&gt; &lt;code&gt;Ctrl+b&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Press &lt;code&gt;Ctrl+b&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Type: &lt;code&gt;npm run build&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Command runs in background&lt;/li&gt;
&lt;li&gt;Continue working with Claude while build runs&lt;/li&gt;
&lt;li&gt;See results when complete&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Perfect for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Long-running builds or tests&lt;/li&gt;
&lt;li&gt;File watching processes&lt;/li&gt;
&lt;li&gt;Background monitoring tasks&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Start simple&lt;/strong&gt; - One hook for type checking&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test thoroughly&lt;/strong&gt; - Run commands manually first&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add gradually&lt;/strong&gt; - Don't overwhelm your workflow&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitor impact&lt;/strong&gt; - Ensure hooks help, don't hinder&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Example starter hook:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"PostToolUse"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"matcher"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Edit:*.ts|Edit:*.tsx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"echo 'TypeScript file edited'"&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hooks turn Claude into a more integrated part of your development environment, automatically handling the routine tasks you'd normally do manually.&lt;/p&gt;




&lt;h2&gt;
  
  
  Claude Code Blog Series
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Previous:&lt;/strong&gt; &lt;a href="//./2025-08-05--claude-code-part-7-ide-integration-vscode-jetbrains"&gt;Part 7 - IDE Integration with VS Code and JetBrains&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Next:&lt;/strong&gt; &lt;a href="//./2025-08-07--claude-code-part-9-complete-development-workflows"&gt;Part 9 - Complete Development Workflows&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full Series:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Part 1 - Getting Started and Installation&lt;/li&gt;
&lt;li&gt;Part 2 - CLAUDE.md Configuration Files&lt;/li&gt;
&lt;li&gt;Part 3 - Conversation Management and Context&lt;/li&gt;
&lt;li&gt;Part 4 - Slash Commands and Custom Commands&lt;/li&gt;
&lt;li&gt;Part 5 - MCP Servers and Tool Integration&lt;/li&gt;
&lt;li&gt;Part 6 - Subagents and Task Delegation&lt;/li&gt;
&lt;li&gt;Part 7 - IDE Integration with VS Code and JetBrains&lt;/li&gt;
&lt;li&gt;Part 8 - Hooks for Automated Quality Checks (this post)&lt;/li&gt;
&lt;li&gt;Part 9 - Complete Development Workflows&lt;/li&gt;
&lt;li&gt;Part 10 - Power User CLI Options and Scripting&lt;/li&gt;
&lt;li&gt;Part 11 - Troubleshooting and Recovery&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>claudecode</category>
      <category>hooks</category>
      <category>automation</category>
      <category>qualityassurance</category>
    </item>
    <item>
      <title>Claude Code: Part 7 - IDE Integration with VS Code and JetBrains</title>
      <dc:creator>luiz tanure</dc:creator>
      <pubDate>Mon, 11 Aug 2025 07:10:28 +0000</pubDate>
      <link>https://dev.to/letanure/claude-code-part-7-ide-integration-with-vs-code-and-jetbrains-6k1</link>
      <guid>https://dev.to/letanure/claude-code-part-7-ide-integration-with-vs-code-and-jetbrains-6k1</guid>
      <description>&lt;h1&gt;
  
  
  Claude Code: Part 7 - IDE Integration with VS Code and JetBrains
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;You're deep in debugging mode in VS Code. You've got the perfect file open, the exact line selected, and error messages staring at you from the Problems panel. But to get Claude's help, you have to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open a separate terminal&lt;/li&gt;
&lt;li&gt;Launch Claude&lt;/li&gt;
&lt;li&gt;Manually describe the file you're in&lt;/li&gt;
&lt;li&gt;Copy-paste the error message&lt;/li&gt;
&lt;li&gt;Explain the context Claude can't see&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By the time Claude understands the situation, you've lost your debugging flow. It's like having a brilliant pair-programming partner who can't see your screen - constantly having to narrate everything breaks your concentration.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;IDE integration lets Claude see exactly what you're working on without manual context sharing. Think of it as giving your AI teammate a second monitor that mirrors yours - they can see your current file, selected code, and error messages automatically.&lt;/p&gt;

&lt;h2&gt;
  
  
  VS Code Integration
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Quick Setup
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install Claude Code&lt;/strong&gt; (if not already done)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open VS Code&lt;/strong&gt; in your project&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open terminal&lt;/strong&gt; in VS Code (&lt;code&gt;Ctrl+`&lt;/code&gt; or &lt;code&gt;Cmd+`&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run Claude&lt;/strong&gt;: &lt;code&gt;claude&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extension auto-installs&lt;/strong&gt; when first run from VS Code&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Quick Launch Shortcut
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mac:&lt;/strong&gt; &lt;code&gt;Cmd+Esc&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows/Linux:&lt;/strong&gt; &lt;code&gt;Ctrl+Esc&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Opens Claude with current context:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Selected text (if any)&lt;/li&gt;
&lt;li&gt;Current file path&lt;/li&gt;
&lt;li&gt;Recent error messages from Problems panel&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Simple example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Select a function in VS Code
2. Press Cmd+Esc (Mac) or Ctrl+Esc (Windows/Linux)
3. Claude opens with: "Looking at the selected code in src/utils/helpers.js..."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Context Sharing Features
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What Claude sees automatically:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Current file you're editing&lt;/li&gt;
&lt;li&gt;Text selection&lt;/li&gt;
&lt;li&gt;Error messages from VS Code Problems panel&lt;/li&gt;
&lt;li&gt;Workspace file structure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What you don't need to do:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Copy-paste code snippets&lt;/li&gt;
&lt;li&gt;Explain file locations&lt;/li&gt;
&lt;li&gt;Describe error messages manually&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  JetBrains Integration
&lt;/h2&gt;

&lt;p&gt;Claude Code supports JetBrains IDEs (IntelliJ IDEA, WebStorm, PyCharm, etc.) through terminal integration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setup:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open terminal in your JetBrains IDE&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;claude&lt;/code&gt; in the terminal&lt;/li&gt;
&lt;li&gt;Context sharing works similar to VS Code&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Full plugin integration may vary by IDE - check Claude Code documentation for specific IDE support.&lt;/p&gt;

&lt;h2&gt;
  
  
  Error Diagnostics Integration
&lt;/h2&gt;

&lt;p&gt;When you have TypeScript errors, ESLint warnings, or other diagnostics:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Errors appear in VS Code Problems panel&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Launch Claude&lt;/strong&gt; with quick shortcut&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Claude sees the errors automatically&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ask:&lt;/strong&gt; "Fix these TypeScript errors"&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No need to copy-paste error messages - Claude reads them from your IDE.&lt;/p&gt;

&lt;h2&gt;
  
  
  Multi-IDE Workflows
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Best practices:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One Claude session per project&lt;/strong&gt; - works across different IDEs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context switches automatically&lt;/strong&gt; - based on which IDE you launch from&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use &lt;code&gt;/clear&lt;/code&gt;&lt;/strong&gt; when switching between major tasks&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Advanced Integration Features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  IDE Command
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude /ide
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Connects Claude to IDE for enhanced integration (when available).&lt;/p&gt;

&lt;h3&gt;
  
  
  File References
&lt;/h3&gt;

&lt;p&gt;Claude understands your IDE's file structure and can reference files directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Update the handleSubmit function in the current file"
"Check the imports in UserList.tsx"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Limitations and Notes
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Current limitations:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Full integration varies by IDE&lt;/li&gt;
&lt;li&gt;Some features work best with VS Code&lt;/li&gt;
&lt;li&gt;Terminal-based integration for most IDEs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;For latest IDE support:&lt;/strong&gt; Check the &lt;a href="https://docs.anthropic.com/en/docs/claude-code/ide-integrations" rel="noopener noreferrer"&gt;Claude Code documentation&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Start with VS Code&lt;/strong&gt; (best supported)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use quick launch shortcuts&lt;/strong&gt; (Cmd+Esc/Ctrl+Esc)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test context sharing&lt;/strong&gt; - select code and launch Claude&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gradually explore&lt;/strong&gt; other IDE integrations&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The goal is seamless development where Claude understands exactly what you're working on without manual context switching.&lt;/p&gt;




&lt;h2&gt;
  
  
  Claude Code Blog Series
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Previous:&lt;/strong&gt; &lt;a href="//./2025-08-04--claude-code-part-6-subagents-task-delegation"&gt;Part 6 - Subagents and Task Delegation&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Next:&lt;/strong&gt; &lt;a href="//./2025-08-06--claude-code-part-8-hooks-automated-quality-checks"&gt;Part 8 - Hooks for Automated Quality Checks&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full Series:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Part 1 - Getting Started and Installation&lt;/li&gt;
&lt;li&gt;Part 2 - CLAUDE.md Configuration Files&lt;/li&gt;
&lt;li&gt;Part 3 - Conversation Management and Context&lt;/li&gt;
&lt;li&gt;Part 4 - Slash Commands and Custom Commands&lt;/li&gt;
&lt;li&gt;Part 5 - MCP Servers and Tool Integration&lt;/li&gt;
&lt;li&gt;Part 6 - Subagents and Task Delegation&lt;/li&gt;
&lt;li&gt;Part 7 - IDE Integration with VS Code and JetBrains (this post)&lt;/li&gt;
&lt;li&gt;Part 8 - Hooks for Automated Quality Checks&lt;/li&gt;
&lt;li&gt;Part 9 - Complete Development Workflows&lt;/li&gt;
&lt;li&gt;Part 10 - Power User CLI Options and Scripting&lt;/li&gt;
&lt;li&gt;Part 11 - Troubleshooting and Recovery&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>claudecode</category>
      <category>ideintegration</category>
      <category>vscode</category>
      <category>jetbrains</category>
    </item>
    <item>
      <title>Claude Code: Part 6 - Subagents and Task Delegation</title>
      <dc:creator>luiz tanure</dc:creator>
      <pubDate>Mon, 11 Aug 2025 07:09:56 +0000</pubDate>
      <link>https://dev.to/letanure/claude-code-part-6-subagents-and-task-delegation-k6f</link>
      <guid>https://dev.to/letanure/claude-code-part-6-subagents-and-task-delegation-k6f</guid>
      <description>&lt;h1&gt;
  
  
  Claude Code: Part 6 - Subagents and Task Delegation
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;You're facing a complex development challenge that requires deep, systematic analysis:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Refactoring a large legacy system with many interdependencies&lt;/li&gt;
&lt;li&gt;Planning a major feature that touches multiple parts of your application&lt;/li&gt;
&lt;li&gt;Investigating a performance issue that could have various root causes&lt;/li&gt;
&lt;li&gt;Migrating to a new framework while maintaining functionality&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These tasks require hours of careful analysis, reading through dozens of files, understanding complex relationships, and maintaining context across multiple steps. It's exhausting to guide Claude through every single step, and you lose focus on the bigger picture while managing the details.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;Subagents are specialized AI assistants that operate in separate contexts with focused expertise. They handle complex tasks autonomously while you focus on high-level decisions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Learn more:&lt;/strong&gt; &lt;a href="https://docs.anthropic.com/en/docs/claude-code/sub-agents" rel="noopener noreferrer"&gt;Subagents Documentation&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How Subagents Work
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Creation:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/agents  &lt;span class="c"&gt;# Interactive interface (recommended)&lt;/span&gt;
&lt;span class="c"&gt;# Or create files in .claude/agents/ or ~/.claude/agents/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Use an agent to analyze the authentication system
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What happens:&lt;/strong&gt; ⏺ indicator shows subagent is working autonomously&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Separate contexts&lt;/strong&gt; - Don't consume main conversation tokens&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Specialized expertise&lt;/strong&gt; - Custom system prompts for specific tasks
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool access control&lt;/strong&gt; - Limited permissions for security&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automatic selection&lt;/strong&gt; - Claude picks appropriate agent for task&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Agent Types
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Code Reviewer:&lt;/strong&gt; Proactively reviews code quality and security&lt;br&gt;
&lt;strong&gt;Debugger:&lt;/strong&gt; Specializes in root cause analysis&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Data Scientist:&lt;/strong&gt; Focuses on SQL queries and data analysis&lt;/p&gt;

&lt;h2&gt;
  
  
  When to Use
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Complex codebase analysis&lt;/li&gt;
&lt;li&gt;Multi-step refactoring plans&lt;/li&gt;
&lt;li&gt;Performance investigations&lt;/li&gt;
&lt;li&gt;Architecture planning&lt;/li&gt;
&lt;li&gt;Systematic code reviews&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Best Practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Single responsibility&lt;/strong&gt; - One focused purpose per agent&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clear system prompts&lt;/strong&gt; - Detailed instructions for agent behavior
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Limited tool access&lt;/strong&gt; - Only necessary permissions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Version control&lt;/strong&gt; - Track project-level agents in git&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Example Usage
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Use an agent to analyze the user onboarding flow"
"Use an agent to plan Redux to Zustand migration"  
"Use an agent to review payment processing security"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Working with Results
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Review outputs&lt;/strong&gt; - Subagent results may need refinement&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Break down plans&lt;/strong&gt; - Convert analysis into actionable steps&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chain agents&lt;/strong&gt; - Use results for follow-up analysis&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Task Definition Tips
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❌ "Use an agent to look at the code"
✅ "Use an agent to analyze authentication security and create modernization plan"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Be specific:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Define scope and constraints&lt;/li&gt;
&lt;li&gt;Set success criteria&lt;/li&gt;
&lt;li&gt;Request actionable output&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Performance Benefits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Context preservation&lt;/strong&gt; - Don't consume main conversation tokens&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Specialized analysis&lt;/strong&gt; - Custom expertise for specific tasks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Autonomous work&lt;/strong&gt; - No need for step-by-step guidance&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chain workflows&lt;/strong&gt; - Connect multiple agents for complex tasks&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  When NOT to Use
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Simple questions&lt;/li&gt;
&lt;li&gt;Interactive debugging&lt;/li&gt;
&lt;li&gt;Small changes&lt;/li&gt;
&lt;li&gt;Tasks needing frequent input&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Use &lt;code&gt;/agents&lt;/code&gt; to create specialized agents&lt;/li&gt;
&lt;li&gt;Start with analysis tasks&lt;/li&gt;
&lt;li&gt;Be specific about scope and goals&lt;/li&gt;
&lt;li&gt;Review and iterate on results&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Subagents transform Claude into specialized AI analysts handling complex work autonomously.&lt;/p&gt;




&lt;h2&gt;
  
  
  Claude Code Blog Series
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Previous:&lt;/strong&gt; &lt;a href="//./2025-08-03--claude-code-part-5-mcp-servers-tool-integration"&gt;Part 5 - MCP Servers and Tool Integration&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Next:&lt;/strong&gt; &lt;a href="//./2025-08-05--claude-code-part-7-ide-integration-vscode-jetbrains"&gt;Part 7 - IDE Integration with VS Code and JetBrains&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full Series:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Part 1 - Getting Started and Installation&lt;/li&gt;
&lt;li&gt;Part 2 - CLAUDE.md Configuration Files&lt;/li&gt;
&lt;li&gt;Part 3 - Conversation Management and Context&lt;/li&gt;
&lt;li&gt;Part 4 - Slash Commands and Custom Commands&lt;/li&gt;
&lt;li&gt;Part 5 - MCP Servers and Tool Integration&lt;/li&gt;
&lt;li&gt;Part 6 - Subagents and Task Delegation (this post)&lt;/li&gt;
&lt;li&gt;Part 7 - IDE Integration with VS Code and JetBrains&lt;/li&gt;
&lt;li&gt;Part 8 - Hooks for Automated Quality Checks&lt;/li&gt;
&lt;li&gt;Part 9 - Complete Development Workflows&lt;/li&gt;
&lt;li&gt;Part 10 - Power User CLI Options and Scripting&lt;/li&gt;
&lt;li&gt;Part 11 - Troubleshooting and Recovery&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>claudecode</category>
      <category>subagents</category>
      <category>taskdelegation</category>
      <category>autonomousanalysis</category>
    </item>
    <item>
      <title>Claude Code: Part 5 - MCP Servers and Tool Integration</title>
      <dc:creator>luiz tanure</dc:creator>
      <pubDate>Mon, 11 Aug 2025 07:09:24 +0000</pubDate>
      <link>https://dev.to/letanure/claude-code-part-5-mcp-servers-and-tool-integration-41pf</link>
      <guid>https://dev.to/letanure/claude-code-part-5-mcp-servers-and-tool-integration-41pf</guid>
      <description>&lt;h1&gt;
  
  
  Claude Code: Part 5 - MCP Servers and Tool Integration
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Your development workflow involves constant tool switching:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Claude Code for development assistance&lt;/li&gt;
&lt;li&gt;GitHub web interface for issues and PRs&lt;/li&gt;
&lt;li&gt;Sentry dashboard for error monitoring&lt;/li&gt;
&lt;li&gt;Database tools for query analysis&lt;/li&gt;
&lt;li&gt;Slack for team communication&lt;/li&gt;
&lt;li&gt;Linear/Jira for project management&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each context switch breaks your flow. You're helping Claude understand an issue, then jumping to Sentry to grab error details, back to Claude to explain the context, then to GitHub to check related issues. By the time you've gathered all the information, you've lost your problem-solving momentum.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;MCP (Model Context Protocol) servers connect your external tools directly to Claude Code. Think of it as giving Claude direct access to your development toolchain - it can read GitHub issues, analyze Sentry errors, and query databases without you having to switch contexts manually.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is MCP?
&lt;/h2&gt;

&lt;p&gt;MCP (Model Context Protocol) is an open-source standard that connects Claude Code to external tools and services. Instead of manual copy-pasting, Claude accesses tools directly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Learn more:&lt;/strong&gt; &lt;a href="https://docs.anthropic.com/en/docs/claude-code/mcp" rel="noopener noreferrer"&gt;MCP Documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You: "Analyze Sentry errors for authentication"
Claude: [Queries Sentry directly, analyzes data, provides insights]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Essential MCP Servers
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Installation Methods
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Add local server&lt;/span&gt;
claude mcp add server-name /path/to/server

&lt;span class="c"&gt;# Add remote SSE server (real-time)&lt;/span&gt;
claude mcp add &lt;span class="nt"&gt;--transport&lt;/span&gt; sse name https://server-url/sse

&lt;span class="c"&gt;# Add remote HTTP server&lt;/span&gt;
claude mcp add &lt;span class="nt"&gt;--transport&lt;/span&gt; http name https://server-url/mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  GitHub Server
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Read issues, PRs, and discussions&lt;/li&gt;
&lt;li&gt;Create issues and PRs&lt;/li&gt;
&lt;li&gt;Analyze commits and code changes&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Sentry Server
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Analyze error trends and stack traces&lt;/li&gt;
&lt;li&gt;Correlate errors with code changes&lt;/li&gt;
&lt;li&gt;Suggest fixes based on context&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Other Popular Servers
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Linear/Asana&lt;/strong&gt; - Project management
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Notion&lt;/strong&gt; - Documentation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stripe&lt;/strong&gt; - Payment processing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Figma&lt;/strong&gt; - Design integration&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Airtable&lt;/strong&gt; - Database/spreadsheets&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SQLite/PostgreSQL&lt;/strong&gt; - Database querying&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Authentication
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;OAuth 2.0 support&lt;/strong&gt; - Secure authentication&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use &lt;code&gt;/mcp&lt;/code&gt; to authenticate&lt;/strong&gt; - Follow prompts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tokens refresh automatically&lt;/strong&gt; - No manual renewal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;⚠️ &lt;strong&gt;Security Note:&lt;/strong&gt; Use third-party MCP servers at your own risk. Verify trustworthiness before installing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Managing Connections
&lt;/h2&gt;

&lt;p&gt;Use &lt;code&gt;/mcp&lt;/code&gt; to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;View connected servers&lt;/li&gt;
&lt;li&gt;Check authentication status
&lt;/li&gt;
&lt;li&gt;Reconnect or configure servers&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Example Workflows
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Bug investigation:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Check Sentry for login errors, correlate with recent GitHub commits"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;PR review:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Review PR #123, check for related Sentry errors and security issues"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Release prep:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"List GitHub issues for v2.1.0, check critical Sentry errors"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Network Security
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Firewall considerations&lt;/strong&gt; - MCP servers make external API calls&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Corporate networks&lt;/strong&gt; - May need proxy configuration&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rate limiting&lt;/strong&gt; - Respect service API limits&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Troubleshooting MCP Issues
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Connection Problems
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check server status&lt;/span&gt;
/mcp

&lt;span class="c"&gt;# Verify installation&lt;/span&gt;
npm list &lt;span class="nt"&gt;-g&lt;/span&gt; | &lt;span class="nb"&gt;grep &lt;/span&gt;mcp

&lt;span class="c"&gt;# Test authentication&lt;/span&gt;
&lt;span class="c"&gt;# Use service-specific test commands&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Authentication Failures
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Verify tokens&lt;/strong&gt; are valid and not expired&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check permissions&lt;/strong&gt; - ensure tokens have necessary scopes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review network&lt;/strong&gt; - firewalls might block connections&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Restart Claude&lt;/strong&gt; to reload MCP configurations&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Performance Considerations
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;MCP calls take time&lt;/strong&gt; - External API requests add latency&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batch requests&lt;/strong&gt; when possible - ask for related data together&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cache awareness&lt;/strong&gt; - Some data might be cached by MCP servers&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Getting Started with MCP
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Start with GitHub&lt;/strong&gt; - Most immediately useful for developers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add error monitoring&lt;/strong&gt; - Sentry integration saves significant context switching&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Include security scanning&lt;/strong&gt; - Socket.dev prevents supply chain issues&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Explore gradually&lt;/strong&gt; - Add servers as you identify workflow gaps&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Simple first test:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Check our GitHub repository for any open issues tagged as 'bug'"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;MCP transforms Claude Code from an isolated assistant into a fully connected development partner that can access and analyze data from your entire toolchain.&lt;/p&gt;




&lt;h2&gt;
  
  
  Claude Code Blog Series
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Previous:&lt;/strong&gt; &lt;a href="//./2025-08-02--claude-code-part-4-slash-commands-custom-commands"&gt;Part 4 - Slash Commands and Custom Commands&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Next:&lt;/strong&gt; &lt;a href="//./2025-08-04--claude-code-part-6-subagents-task-delegation"&gt;Part 6 - Subagents and Task Delegation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full Series:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Part 1 - Getting Started and Installation&lt;/li&gt;
&lt;li&gt;Part 2 - CLAUDE.md Configuration Files&lt;/li&gt;
&lt;li&gt;Part 3 - Conversation Management and Context&lt;/li&gt;
&lt;li&gt;Part 4 - Slash Commands and Custom Commands&lt;/li&gt;
&lt;li&gt;Part 5 - MCP Servers and Tool Integration (this post)&lt;/li&gt;
&lt;li&gt;Part 6 - Subagents and Task Delegation&lt;/li&gt;
&lt;li&gt;Part 7 - IDE Integration with VS Code and JetBrains&lt;/li&gt;
&lt;li&gt;Part 8 - Hooks for Automated Quality Checks&lt;/li&gt;
&lt;li&gt;Part 9 - Complete Development Workflows&lt;/li&gt;
&lt;li&gt;Part 10 - Power User CLI Options and Scripting&lt;/li&gt;
&lt;li&gt;Part 11 - Troubleshooting and Recovery&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>claudecode</category>
      <category>mcp</category>
      <category>modelcontextprotocol</category>
      <category>githubintegration</category>
    </item>
    <item>
      <title>Claude Code: Part 4 - Slash Commands and Custom Commands</title>
      <dc:creator>luiz tanure</dc:creator>
      <pubDate>Mon, 11 Aug 2025 07:08:53 +0000</pubDate>
      <link>https://dev.to/letanure/claude-code-part-4-slash-commands-and-custom-commands-4fkf</link>
      <guid>https://dev.to/letanure/claude-code-part-4-slash-commands-and-custom-commands-4fkf</guid>
      <description>&lt;h1&gt;
  
  
  Claude Code: Part 4 - Slash Commands and Custom Commands
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;You type the same instructions to Claude every day: "Run tests", "Check TypeScript errors", "Review changes". Repetitive and wasteful.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;Slash commands turn repeated instructions into shortcuts. &lt;code&gt;/test&lt;/code&gt; replaces paragraphs of testing instructions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Built-in Commands
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/clear      &lt;span class="c"&gt;# Fresh start&lt;/span&gt;
/compact    &lt;span class="c"&gt;# Compress history&lt;/span&gt;
/help       &lt;span class="c"&gt;# Show commands&lt;/span&gt;
/mcp        &lt;span class="c"&gt;# MCP servers&lt;/span&gt;
/ide        &lt;span class="c"&gt;# IDE integration&lt;/span&gt;
/exit       &lt;span class="c"&gt;# End session&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Custom Commands
&lt;/h2&gt;

&lt;p&gt;Create &lt;code&gt;.claude/commands/test-all.md&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="p"&gt;1.&lt;/span&gt; Run pnpm type:check
&lt;span class="p"&gt;2.&lt;/span&gt; Run pnpm lint
&lt;span class="p"&gt;3.&lt;/span&gt; Run pnpm test
&lt;span class="p"&gt;4.&lt;/span&gt; Report issues
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now &lt;code&gt;/test-all&lt;/code&gt; runs everything.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example Commands
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;.claude/commands/morning.md&lt;/code&gt;: Daily setup (git pull, tests, status)&lt;br&gt;
&lt;code&gt;.claude/commands/ready.md&lt;/code&gt;: Pre-commit checks&lt;br&gt;
&lt;code&gt;.claude/commands/review.md&lt;/code&gt;: PR preparation&lt;/p&gt;

&lt;h2&gt;
  
  
  Organization
&lt;/h2&gt;

&lt;p&gt;Group commands by phase (planning/, development/, deployment/) or domain (frontend/, backend/, testing/).&lt;/p&gt;

&lt;h2&gt;
  
  
  Best Practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Be specific: "Check TypeScript errors in src/" not "Check code"&lt;/li&gt;
&lt;li&gt;Include success criteria: "0 test failures, 80% coverage"&lt;/li&gt;
&lt;li&gt;Keep commands under 10 steps&lt;/li&gt;
&lt;li&gt;Use numbered lists for clarity&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sharing Commands
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Team:&lt;/strong&gt; Commit &lt;code&gt;.claude/commands/&lt;/code&gt; to git&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Personal:&lt;/strong&gt; Use &lt;code&gt;~/.claude/commands/&lt;/code&gt; globally&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Advanced Features
&lt;/h2&gt;

&lt;p&gt;Commands can include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parameters: "Ask for feature name, create feature/[name]"&lt;/li&gt;
&lt;li&gt;Conditionals: "If production, run security scan"&lt;/li&gt;
&lt;li&gt;Context awareness: "Analyze current file"&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Identify what you repeat daily&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;.claude/commands/[name].md&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Keep instructions under 10 steps&lt;/li&gt;
&lt;li&gt;Test and refine&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Slash commands eliminate repetitive instructions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Claude Code Blog Series
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Previous:&lt;/strong&gt; &lt;a href="//./2025-08-01--claude-code-part-3-conversation-management-context"&gt;Part 3 - Conversation Management and Context&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Next:&lt;/strong&gt; &lt;a href="//./2025-08-03--claude-code-part-5-mcp-servers-tool-integration"&gt;Part 5 - MCP Servers and Tool Integration&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full Series:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Part 1 - Getting Started and Installation&lt;/li&gt;
&lt;li&gt;Part 2 - CLAUDE.md Configuration Files&lt;/li&gt;
&lt;li&gt;Part 3 - Conversation Management and Context&lt;/li&gt;
&lt;li&gt;Part 4 - Slash Commands and Custom Commands (this post)&lt;/li&gt;
&lt;li&gt;Part 5 - MCP Servers and Tool Integration&lt;/li&gt;
&lt;li&gt;Part 6 - Subagents and Task Delegation&lt;/li&gt;
&lt;li&gt;Part 7 - IDE Integration with VS Code and JetBrains&lt;/li&gt;
&lt;li&gt;Part 8 - Hooks for Automated Quality Checks&lt;/li&gt;
&lt;li&gt;Part 9 - Complete Development Workflows&lt;/li&gt;
&lt;li&gt;Part 10 - Power User CLI Options and Scripting&lt;/li&gt;
&lt;li&gt;Part 11 - Troubleshooting and Recovery&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>claudecode</category>
      <category>slashcommands</category>
      <category>automation</category>
      <category>customcommands</category>
    </item>
    <item>
      <title>Claude Code: Part 3 - Conversation Management and Context</title>
      <dc:creator>luiz tanure</dc:creator>
      <pubDate>Mon, 11 Aug 2025 07:08:21 +0000</pubDate>
      <link>https://dev.to/letanure/claude-code-part-3-conversation-management-and-context-3l28</link>
      <guid>https://dev.to/letanure/claude-code-part-3-conversation-management-and-context-3l28</guid>
      <description>&lt;h1&gt;
  
  
  Claude Code: Part 3 - Conversation Management and Context
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;You've been using Claude Code for a few weeks now. The basic workflow is comfortable - ask questions, get code, make changes. But you're starting to feel limited by treating Claude like a simple question-and-answer tool.&lt;/p&gt;

&lt;p&gt;You have bigger ambitions: complex refactoring projects, multi-step feature implementations, and sophisticated analysis tasks. You want to move beyond "Hey Claude, fix this function" to "Claude, help me architect and implement this entire feature from scratch."&lt;/p&gt;

&lt;p&gt;The question is: how do you unlock Claude's advanced capabilities for complex, multi-step development work?&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;Advanced Claude Code features let you handle sophisticated development tasks through multi-step workflows, conversation management, and intelligent context handling. Think of it as the difference between using Claude as a coding helper versus a true development partner.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conversation Management
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The &lt;code&gt;/clear&lt;/code&gt; Command
&lt;/h3&gt;

&lt;p&gt;Start fresh when switching contexts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/clear
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;When to use:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Switching between different features&lt;/li&gt;
&lt;li&gt;Moving from debugging to new development&lt;/li&gt;
&lt;li&gt;When conversation gets too long and unfocused&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The &lt;code&gt;/compact&lt;/code&gt; Command
&lt;/h3&gt;

&lt;p&gt;Summarize long conversations while preserving context:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/compact
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What it does:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Compresses conversation history&lt;/li&gt;
&lt;li&gt;Keeps key decisions and context&lt;/li&gt;
&lt;li&gt;Reduces token usage without losing information&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Before: 50 messages about implementing user authentication
After: Compact summary + recent conversation about email verification
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Resume Previous Sessions
&lt;/h3&gt;

&lt;p&gt;Continue where you left off:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude &lt;span class="nt"&gt;--resume&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Multi-Step Workflows
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Planning Complex Features
&lt;/h3&gt;

&lt;p&gt;Instead of diving into code, start with comprehensive planning:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I need to implement a real-time notification system for this React app.
Before writing any code, help me plan:

1. Architecture design considerations
2. Technology choices (WebSocket vs Server-Sent Events vs polling)
3. Database schema requirements
4. Component structure and data flow
5. Testing strategy
6. Performance and scalability considerations

Break this down systematically.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Claude will provide structured analysis before any implementation begins.&lt;/p&gt;

&lt;h3&gt;
  
  
  Iterative Development Approach
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Let's build this notification system step by step:

Phase 1: Create the basic WebSocket connection and message handling
Phase 2: Implement the UI components for displaying notifications
Phase 3: Add persistence and notification history
Phase 4: Implement real-time updates and optimistic UI
Phase 5: Add comprehensive testing

Start with Phase 1. After each phase, I'll review and approve before moving forward.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Complex Refactoring Projects
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I need to refactor this legacy authentication system. Here's my approach:

1. First, analyze the current system and identify all dependencies
2. Create a migration plan that maintains backward compatibility
3. Implement the new system alongside the old one
4. Create a feature flag to switch between systems
5. Gradually migrate users and test thoroughly
6. Remove the old system once migration is complete

Start with step 1 - comprehensive analysis of the current system.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Context Management Techniques
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Focused Sessions
&lt;/h3&gt;

&lt;p&gt;Keep conversations targeted to specific domains:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Authentication Session
"I'm working solely on authentication features today.
Only suggest changes related to auth, login, registration, and user management."

# Performance Session
"This session is focused on performance optimization.
Analyze bundle size, loading times, and runtime performance only."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Reference Management
&lt;/h3&gt;

&lt;p&gt;Help Claude understand large codebases:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"The main authentication flow happens in these files:
- src/auth/AuthProvider.tsx (context setup)
- src/auth/hooks/useAuth.ts (auth logic)
- src/pages/login.tsx (login UI)
- api/auth/login.ts (backend logic)

Reference these files when working on auth-related tasks."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Incremental Context Building
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Let me give you context about our e-commerce platform:

1. We use Next.js with TypeScript
2. State management with Zustand
3. UI components with Radix + Tailwind
4. Database with Prisma + PostgreSQL
5. Payment processing with Stripe

I'll be asking you to work on various features within this context."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Advanced Analysis Capabilities
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Codebase Architecture Analysis
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Analyze the overall architecture of this React application:

1. Component organization and hierarchy
2. State management patterns used
3. Data flow and communication patterns
4. Third-party integrations and dependencies
5. Testing strategy and coverage
6. Build and deployment setup
7. Potential architectural issues or technical debt

Provide a comprehensive architectural overview."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Performance Analysis
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Conduct a performance analysis of this application:

1. Bundle size analysis and recommendations
2. Runtime performance bottlenecks
3. Database query optimization opportunities
4. API endpoint performance issues
5. Frontend rendering optimizations
6. Caching strategy improvements

Focus on actionable performance improvements."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Security Assessment
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Review this application for security vulnerabilities:

1. Authentication and authorization implementation
2. Input validation and sanitization
3. API endpoint security
4. Database query security (SQL injection prevention)
5. XSS and CSRF protection
6. Sensitive data handling

Identify specific security improvements needed."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Preview Mode
&lt;/h2&gt;

&lt;p&gt;See what Claude will do before making changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Show me exactly what changes you would make to implement user roles,
but don't make any changes yet. I want to review your plan first."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Claude will outline:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Files that need to be modified&lt;/li&gt;
&lt;li&gt;New files that need to be created&lt;/li&gt;
&lt;li&gt;Specific changes to existing code&lt;/li&gt;
&lt;li&gt;Testing requirements&lt;/li&gt;
&lt;li&gt;Potential breaking changes&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Advanced Problem-Solving Patterns
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Root Cause Analysis
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"This React component is causing memory leaks. Don't just fix the symptom -
investigate the root cause:

1. Analyze the component lifecycle and cleanup
2. Check for subscription leaks and event listeners
3. Examine state management and data flow
4. Look for circular references or closures
5. Identify the fundamental issue causing the leak

Provide both the analysis and the fix."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  System Integration
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Help me integrate Stripe payments into this e-commerce app.
Consider the full integration:

1. Frontend payment component with proper UX
2. Backend webhook handling and security
3. Database schema for orders and payment tracking
4. Error handling and retry logic
5. Testing strategy for payment flows
6. Compliance and security requirements

Design the complete integration, not just the payment form."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Scalability Planning
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"This app currently handles 1,000 users. Help me prepare it for 100,000 users:

1. Database optimization and indexing
2. API rate limiting and caching
3. Frontend performance optimization
4. Infrastructure scaling considerations
5. Monitoring and alerting setup

Create a scalability roadmap with specific implementation steps."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Efficient Context Switching
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Project Templates
&lt;/h3&gt;

&lt;p&gt;Create reusable project contexts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Save this as my 'React + TypeScript Web App' context:
- Next.js 13+ with TypeScript
- Tailwind CSS for styling
- Prisma for database
- NextAuth for authentication
- React Query for API calls
- Jest + React Testing Library for tests

Use this context for all similar projects unless I specify otherwise."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Domain-Specific Sessions
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Database session&lt;/span&gt;
claude &lt;span class="nt"&gt;--session&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;database
&lt;span class="s2"&gt;"Focus only on database schema, queries, and data modeling"&lt;/span&gt;

&lt;span class="c"&gt;# Frontend session&lt;/span&gt;
claude &lt;span class="nt"&gt;--session&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;frontend
&lt;span class="s2"&gt;"Work only on React components, styling, and user interface"&lt;/span&gt;

&lt;span class="c"&gt;# API session&lt;/span&gt;
claude &lt;span class="nt"&gt;--session&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;api
&lt;span class="s2"&gt;"Handle only backend logic, API endpoints, and server-side code"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Advanced Debugging Workflows
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Systematic Bug Investigation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"This user registration is failing intermittently. Let's debug systematically:

1. Reproduce the issue in development
2. Add comprehensive logging to track the flow
3. Analyze potential race conditions
4. Check database constraints and validation
5. Review error handling and edge cases
6. Create a test that reproduces the bug
7. Fix the root cause
8. Verify the fix prevents regression

Start with step 1 - let's reproduce this issue."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Getting Started with Advanced Features
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Plan before coding&lt;/strong&gt; - Use Claude for architectural planning&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Break down complex tasks&lt;/strong&gt; - Multi-phase implementation approach&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Manage conversation context&lt;/strong&gt; - Use &lt;code&gt;/clear&lt;/code&gt; and &lt;code&gt;/compact&lt;/code&gt; strategically&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Preview changes&lt;/strong&gt; - Review plans before implementation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Focus sessions&lt;/strong&gt; - One domain per conversation when possible&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Advanced Claude Code usage transforms development from individual task assistance to comprehensive project partnership.&lt;/p&gt;




&lt;h2&gt;
  
  
  Claude Code Blog Series
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Previous:&lt;/strong&gt; &lt;a href="//./2025-07-31--claude-code-part-2-claude-md-configuration"&gt;Part 2 - CLAUDE.md Configuration Files&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Next:&lt;/strong&gt; &lt;a href="//./2025-08-02--claude-code-part-4-slash-commands-custom-commands"&gt;Part 4 - Slash Commands and Custom Commands&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full Series:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Part 1 - Getting Started and Installation&lt;/li&gt;
&lt;li&gt;Part 2 - CLAUDE.md Configuration Files&lt;/li&gt;
&lt;li&gt;Part 3 - Conversation Management and Context (this post)&lt;/li&gt;
&lt;li&gt;Part 4 - Slash Commands and Custom Commands&lt;/li&gt;
&lt;li&gt;Part 5 - MCP Servers and Tool Integration&lt;/li&gt;
&lt;li&gt;Part 6 - Subagents and Task Delegation&lt;/li&gt;
&lt;li&gt;Part 7 - IDE Integration with VS Code and JetBrains&lt;/li&gt;
&lt;li&gt;Part 8 - Hooks for Automated Quality Checks&lt;/li&gt;
&lt;li&gt;Part 9 - Complete Development Workflows&lt;/li&gt;
&lt;li&gt;Part 10 - Power User CLI Options and Scripting&lt;/li&gt;
&lt;li&gt;Part 11 - Troubleshooting and Recovery&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>claudecode</category>
      <category>advancedfeatures</category>
      <category>productivity</category>
      <category>contextmanagement</category>
    </item>
    <item>
      <title>Claude Code: Part 2 - CLAUDE.md Configuration Files</title>
      <dc:creator>luiz tanure</dc:creator>
      <pubDate>Mon, 11 Aug 2025 07:07:49 +0000</pubDate>
      <link>https://dev.to/letanure/claude-code-part-2-claudemd-configuration-files-blo</link>
      <guid>https://dev.to/letanure/claude-code-part-2-claudemd-configuration-files-blo</guid>
      <description>&lt;h1&gt;
  
  
  Claude Code: Part 2 - CLAUDE.md Configuration Files
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;You've started using Claude Code, and it's incredibly capable. Too capable. It suggests complex architectural changes when you wanted a simple bug fix. It writes elaborate documentation when you needed a quick comment. It refactors your entire component when you asked it to fix one function.&lt;/p&gt;

&lt;p&gt;Claude is like an enthusiastic new team member who doesn't yet understand your project's constraints, coding standards, or the difference between "quick fix" and "complete rewrite."&lt;/p&gt;

&lt;p&gt;You need a way to teach Claude about your project's specific context, rules, and boundaries.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;CLAUDE.md files act as a persistent memory system and rule book for your project. Think of it as onboarding documentation that teaches Claude about your project's specific needs, just like you'd brief a new human developer.&lt;/p&gt;

&lt;h2&gt;
  
  
  How CLAUDE.md Works
&lt;/h2&gt;

&lt;p&gt;Place a &lt;code&gt;CLAUDE.md&lt;/code&gt; file in your project root with rules and context:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# Project: E-commerce Platform&lt;/span&gt;

&lt;span class="gu"&gt;## Tech Stack&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Next.js, TypeScript, Tailwind, Prisma

&lt;span class="gu"&gt;## Rules&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Use TypeScript strict mode
&lt;span class="p"&gt;-&lt;/span&gt; Follow patterns in src/components/
&lt;span class="p"&gt;-&lt;/span&gt; Functional components only
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Claude now follows your project-specific rules automatically.&lt;/p&gt;

&lt;h2&gt;
  
  
  Memory Hierarchy
&lt;/h2&gt;

&lt;p&gt;Claude Code respects a hierarchy of configuration files, with more specific files overriding general ones:&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuration Hierarchy
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Personal:&lt;/strong&gt; &lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt; - Your preferences across all projects&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Project:&lt;/strong&gt; &lt;code&gt;./CLAUDE.md&lt;/code&gt; - Team rules for this project&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local:&lt;/strong&gt; &lt;code&gt;./CLAUDE.local.md&lt;/code&gt; - Personal overrides (gitignored)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Folder:&lt;/strong&gt; &lt;code&gt;./src/auth/CLAUDE.md&lt;/code&gt; - Module-specific rules&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;More specific files override general ones.&lt;/p&gt;

&lt;h2&gt;
  
  
  Multi-AI Tool Sharing
&lt;/h2&gt;

&lt;p&gt;Want to use Claude Code alongside other AI tools? The CLAUDE.md approach works for now, but there's an initiative to create a universal standard called AGENT.md. Learn more at &lt;a href="https://ampcode.com/AGENT.md" rel="noopener noreferrer"&gt;ampcode.com/AGENT.md&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For now, you can create a symlink to share the same configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Create shared memory file&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; ~/.ai-tools
&lt;span class="nb"&gt;touch&lt;/span&gt; ~/.ai-tools/shared-memory.md

&lt;span class="c"&gt;# Link it as CLAUDE.md&lt;/span&gt;
&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; ~/.ai-tools/shared-memory.md ./CLAUDE.md

&lt;span class="c"&gt;# Link for other AI tools&lt;/span&gt;
&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; ~/.ai-tools/shared-memory.md ./AI-CONTEXT.md
&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; ~/.ai-tools/shared-memory.md ./CURSOR-RULES.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One source of truth for project context&lt;/li&gt;
&lt;li&gt;Consistent behavior across AI tools&lt;/li&gt;
&lt;li&gt;Easy maintenance and updates&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Writing Effective Rules
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Be specific and concise:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;❌ "Use good coding practices"
✅ "Functional components, TypeScript, max 200 lines"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Set clear boundaries:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Never modify payment code without review&lt;/li&gt;
&lt;li&gt;No new packages without approval&lt;/li&gt;
&lt;li&gt;No breaking API changes&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Token Consumption Warning
&lt;/h2&gt;

&lt;p&gt;⚠️ &lt;strong&gt;Keep CLAUDE.md files under 100 lines!&lt;/strong&gt; They're included in every interaction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Write concisely:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;❌ "Always ensure components use hooks rather than classes"
✅ "Functional components only"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Best Practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Start with 5-10 essential rules&lt;/li&gt;
&lt;li&gt;Remove outdated rules regularly
&lt;/li&gt;
&lt;li&gt;Test rules work: "Create a component following our patterns"&lt;/li&gt;
&lt;li&gt;Review monthly, prune verbosity&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;CLAUDE.md&lt;/code&gt; with 5-10 essential rules&lt;/li&gt;
&lt;li&gt;Test it works&lt;/li&gt;
&lt;li&gt;Keep it under 100 lines&lt;/li&gt;
&lt;li&gt;Update monthly&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;CLAUDE.md transforms Claude into a project-aware teammate.&lt;/p&gt;




&lt;h2&gt;
  
  
  Claude Code Blog Series
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Previous:&lt;/strong&gt; &lt;a href="//./2025-07-30--claude-code-part-1-getting-started-installation"&gt;Part 1 - Getting Started and Installation&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Next:&lt;/strong&gt; &lt;a href="//./2025-08-01--claude-code-part-3-conversation-management-context"&gt;Part 3 - Conversation Management and Context&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full Series:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Part 1 - Getting Started and Installation&lt;/li&gt;
&lt;li&gt;Part 2 - CLAUDE.md Configuration Files (this post)&lt;/li&gt;
&lt;li&gt;Part 3 - Conversation Management and Context&lt;/li&gt;
&lt;li&gt;Part 4 - Slash Commands and Custom Commands&lt;/li&gt;
&lt;li&gt;Part 5 - MCP Servers and Tool Integration&lt;/li&gt;
&lt;li&gt;Part 6 - Subagents and Task Delegation&lt;/li&gt;
&lt;li&gt;Part 7 - IDE Integration with VS Code and JetBrains&lt;/li&gt;
&lt;li&gt;Part 8 - Hooks for Automated Quality Checks&lt;/li&gt;
&lt;li&gt;Part 9 - Complete Development Workflows&lt;/li&gt;
&lt;li&gt;Part 10 - Power User CLI Options and Scripting&lt;/li&gt;
&lt;li&gt;Part 11 - Troubleshooting and Recovery&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>claudecode</category>
      <category>configuration</category>
      <category>claudemd</category>
      <category>projectmanagement</category>
    </item>
    <item>
      <title>Claude Code: Part 1 - Getting Started and Installation</title>
      <dc:creator>luiz tanure</dc:creator>
      <pubDate>Mon, 11 Aug 2025 07:07:17 +0000</pubDate>
      <link>https://dev.to/letanure/claude-code-part-1-getting-started-and-installation-42g2</link>
      <guid>https://dev.to/letanure/claude-code-part-1-getting-started-and-installation-42g2</guid>
      <description>&lt;h1&gt;
  
  
  Claude Code: Part 1 - Getting Started and Installation
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;You've heard about AI coding assistants, but every one you've tried feels like a disconnected chatbot. They can generate code snippets, but they don't understand your project, follow your patterns, or integrate with your actual development workflow.&lt;/p&gt;

&lt;p&gt;You need an AI teammate that works &lt;em&gt;with&lt;/em&gt; you, not just for you - one that understands your codebase, follows your coding standards, and becomes a true development partner rather than just another code completion tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  Meet Your New Teammate
&lt;/h2&gt;

&lt;p&gt;Claude Code is like having a genius junior developer who took too many Red Bulls. Brilliant, capable of incredible work, but needs guidance on your specific project and coding patterns. The difference is that this teammate learns your project inside and out and never gets tired.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What makes Claude Code different:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Full codebase understanding&lt;/strong&gt; - Reads and comprehends your entire project&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Project-aware&lt;/strong&gt; - Follows your existing patterns and conventions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool integration&lt;/strong&gt; - Works with your development tools and services&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contextual memory&lt;/strong&gt; - Remembers project-specific rules and preferences&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node.js (version 18 or higher)&lt;/li&gt;
&lt;li&gt;npm or yarn package manager&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Install globally:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @anthropic-ai/claude-code
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Verify installation:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Start Claude Code:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# In your project directory&lt;/span&gt;
&lt;span class="nb"&gt;cd &lt;/span&gt;your-project
claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  First Session Setup
&lt;/h2&gt;

&lt;p&gt;When you first run Claude Code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Authentication&lt;/strong&gt; - Follow the prompts to sign in&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Project detection&lt;/strong&gt; - Claude analyzes your current directory&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Initial conversation&lt;/strong&gt; - Start with a simple task to test everything works&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Example first interaction:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You: "Analyze this project and tell me what kind of application this is"
Claude: [Examines your files and provides project overview]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Key Features Overview
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Codebase Analysis
&lt;/h3&gt;

&lt;p&gt;Claude can read and understand your entire project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Architecture patterns&lt;/strong&gt; - Identifies frameworks and structures&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Coding conventions&lt;/strong&gt; - Learns your style preferences&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dependencies&lt;/strong&gt; - Understands your tech stack&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Project context&lt;/strong&gt; - Knows what your application does&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Intelligent Code Generation
&lt;/h3&gt;

&lt;p&gt;Goes beyond simple snippets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pattern matching&lt;/strong&gt; - Follows your existing code patterns&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context-aware&lt;/strong&gt; - Considers surrounding code and architecture&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration-focused&lt;/strong&gt; - Creates code that fits your project&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Development Workflow Integration
&lt;/h3&gt;

&lt;p&gt;Works with your existing tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Git integration&lt;/strong&gt; - Understands version control context&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;File operations&lt;/strong&gt; - Reads, writes, and modifies files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build tools&lt;/strong&gt; - Runs tests, builds, and other project commands&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IDE compatibility&lt;/strong&gt; - Works alongside your favorite editor&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Your First Productive Session
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Start with exploration:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Walk me through the main components of this React application"
"Show me how authentication is currently handled"
"What testing patterns are used in this project?"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Move to practical tasks:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Add error handling to the user registration form"
"Create a new component for displaying user notifications"
"Fix the TypeScript errors in the payment module"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Collaborate on bigger features:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Help me plan and implement a user dashboard feature"
"Review and refactor the API service layer"
"Add comprehensive logging to the authentication flow"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Best Practices for New Users
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Start Small
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Begin with simple, isolated tasks&lt;/li&gt;
&lt;li&gt;Test Claude's understanding with questions&lt;/li&gt;
&lt;li&gt;Gradually increase task complexity&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Provide Context
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Explain your project's purpose and users&lt;/li&gt;
&lt;li&gt;Share relevant business requirements&lt;/li&gt;
&lt;li&gt;Mention any constraints or preferences&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Review Everything
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Always review generated code before using it&lt;/li&gt;
&lt;li&gt;Test changes in development environment&lt;/li&gt;
&lt;li&gt;Understand what Claude built, don't just copy-paste&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Iterate and Improve
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Ask follow-up questions for clarification&lt;/li&gt;
&lt;li&gt;Request modifications when something isn't quite right&lt;/li&gt;
&lt;li&gt;Build on previous work in the same conversation&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Common Beginner Questions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Q: How much of my code can Claude see?&lt;/strong&gt;&lt;br&gt;
A: Claude can read any files in your project directory when needed, but only accesses files relevant to your current task.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q: Will Claude make changes without asking?&lt;/strong&gt;&lt;br&gt;
A: Claude asks for permission before modifying files and shows you exactly what changes it will make.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q: Can Claude learn my project's specific patterns?&lt;/strong&gt;&lt;br&gt;
A: Yes! Claude learns your coding style, architecture patterns, and project conventions through analysis and your feedback.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q: Is my code sent to external servers?&lt;/strong&gt;&lt;br&gt;
A: Claude Code follows Anthropic's privacy policies. Check the latest privacy documentation for specifics about data handling.&lt;/p&gt;
&lt;h2&gt;
  
  
  Troubleshooting Common Issues
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;"Command not found" error:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Try using npx instead&lt;/span&gt;
npx @anthropic-ai/claude-code

&lt;span class="c"&gt;# Or check your PATH&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$PATH&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Claude seems confused about my project:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Make sure you're in the correct directory&lt;/li&gt;
&lt;li&gt;Try asking specific questions about visible files&lt;/li&gt;
&lt;li&gt;Provide more context about your project structure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Authentication issues:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check your internet connection&lt;/li&gt;
&lt;li&gt;Try logging out and back in: &lt;code&gt;claude logout&lt;/code&gt; then &lt;code&gt;claude login&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;Now that you have Claude Code running, you're ready to explore deeper features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Project Configuration&lt;/strong&gt; - Learn how to customize Claude for your specific project&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Advanced Commands&lt;/strong&gt; - Discover powerful built-in commands&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Workflow Integration&lt;/strong&gt; - Connect Claude with your development tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is to move from "Claude as a tool" to "Claude as a teammate" - an AI partner that understands your project deeply and helps you build better software faster.&lt;/p&gt;




&lt;h2&gt;
  
  
  Claude Code Blog Series
&lt;/h2&gt;

&lt;p&gt;This is Part 1 of our comprehensive Claude Code guide series. Each post builds on the previous ones, taking you from beginner to power user.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next:&lt;/strong&gt; &lt;a href="//./2025-07-31--claude-code-part-2-claude-md-configuration"&gt;Part 2 - CLAUDE.md Configuration Files&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full Series:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Part 1 - Getting Started and Installation (this post)&lt;/li&gt;
&lt;li&gt;Part 2 - CLAUDE.md Configuration Files&lt;/li&gt;
&lt;li&gt;Part 3 - Conversation Management and Context&lt;/li&gt;
&lt;li&gt;Part 4 - Slash Commands and Custom Commands&lt;/li&gt;
&lt;li&gt;Part 5 - MCP Servers and Tool Integration&lt;/li&gt;
&lt;li&gt;Part 6 - Subagents and Task Delegation&lt;/li&gt;
&lt;li&gt;Part 7 - IDE Integration with VS Code and JetBrains&lt;/li&gt;
&lt;li&gt;Part 8 - Hooks for Automated Quality Checks&lt;/li&gt;
&lt;li&gt;Part 9 - Complete Development Workflows&lt;/li&gt;
&lt;li&gt;Part 10 - Power User CLI Options and Scripting&lt;/li&gt;
&lt;li&gt;Part 11 - Troubleshooting and Recovery&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>claudecode</category>
      <category>aidevelopment</category>
      <category>gettingstarted</category>
      <category>developmenttools</category>
    </item>
    <item>
      <title>Understand the Acronym Spaghetti: Part 5 - Advanced Principles</title>
      <dc:creator>luiz tanure</dc:creator>
      <pubDate>Fri, 18 Jul 2025 20:04:50 +0000</pubDate>
      <link>https://dev.to/letanure/understand-the-acronym-spaghetti-part-5-advanced-principles-1672</link>
      <guid>https://dev.to/letanure/understand-the-acronym-spaghetti-part-5-advanced-principles-1672</guid>
      <description>&lt;h1&gt;
  
  
  Understand the Acronym Spaghetti: Part 5 - Advanced Principles
&lt;/h1&gt;

&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Law of Demeter&lt;/strong&gt;: Avoid deep object chaining&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Composition over Inheritance&lt;/strong&gt;: Combine small parts instead of extending classes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tell Don't Ask&lt;/strong&gt;: Let objects manage their own state&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Convention over Configuration&lt;/strong&gt;: Smart defaults over explicit setup&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Principle of Least Astonishment&lt;/strong&gt;: Behave as users expect&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;We've covered &lt;strong&gt;The Foundation&lt;/strong&gt; in &lt;a href="//./understand-acronym-spaghetti-wtf-to-solid-code"&gt;Part 1&lt;/a&gt;, &lt;strong&gt;Code Quality &amp;amp; Safety&lt;/strong&gt; in &lt;a href="//./understand-acronym-spaghetti-part-2-quality-principles"&gt;Part 2&lt;/a&gt;, &lt;strong&gt;SOLID Architecture&lt;/strong&gt; in &lt;a href="//./understand-acronym-spaghetti-part-3-solid-principles"&gt;Part 3&lt;/a&gt;, and &lt;strong&gt;System Architecture&lt;/strong&gt; in &lt;a href="//./understand-acronym-spaghetti-part-4-cqrs-and-hexagonal"&gt;Part 4&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advanced Principles&lt;/strong&gt; are the subtle patterns that separate good developers from great ones. These make code truly elegant and maintainable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advanced Principles
&lt;/h2&gt;

&lt;p&gt;These principles help you write code that's not just functional, but intuitive and pleasant to work with.&lt;/p&gt;

&lt;h3&gt;
  
  
  Law of Demeter (Don't Talk to Strangers)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Definition:&lt;/strong&gt; A function should only talk to its immediate friends - don't reach through objects to talk to their friends.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simple explanation:&lt;/strong&gt; Avoid chaining calls like &lt;code&gt;user.profile.settings.theme.color&lt;/code&gt;. Each object should only know about its direct dependencies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Reduces coupling, makes code less fragile to changes, and prevents the "breaking chain" problem where changes deep in the structure break code far away.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to use:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Complex object hierarchies&lt;/li&gt;
&lt;li&gt;API design where you want to prevent tight coupling&lt;/li&gt;
&lt;li&gt;Component props design to avoid props drilling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;When NOT to use:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simple utility functions or data transformations&lt;/li&gt;
&lt;li&gt;Well-established patterns like &lt;code&gt;array.map().filter()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Configuration objects where chaining is expected
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ❌ Violates Law of Demeter - too much chaining&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;UserProfile&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;profile&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;settings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="na"&gt;Posts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;profile&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ✅ Follows Law of Demeter - service handles deep access&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getUserDisplayData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getName&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="na"&gt;textColor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getThemeColor&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="na"&gt;postCount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getPostCount&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;UserProfile&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;textColor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;postCount&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getUserDisplayData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;textColor&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="na"&gt;Posts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;postCount&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Maintainability&lt;/strong&gt;: Changes to deep objects don't break surface code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Testability&lt;/strong&gt;: Easier to mock and test components&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Common Pitfall:&lt;/strong&gt; Creating unnecessary wrapper functions for simple property access.&lt;/p&gt;




&lt;h3&gt;
  
  
  Composition over Inheritance
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Definition:&lt;/strong&gt; Build complex functionality by combining simple components rather than creating complex inheritance hierarchies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simple explanation:&lt;/strong&gt; Instead of creating a "BaseComponent" that others extend, create small, focused components that can be combined in different ways.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; More flexible, easier to test, and avoids the "fragile base class" problem where changes to parent classes break child classes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to use:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React component design patterns&lt;/li&gt;
&lt;li&gt;Building reusable UI components&lt;/li&gt;
&lt;li&gt;Creating flexible API interfaces&lt;/li&gt;
&lt;li&gt;When you need multiple behaviors that can be mixed and matched&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;When NOT to use:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simple cases where inheritance is clearer&lt;/li&gt;
&lt;li&gt;Well-established patterns (like extending Error classes)&lt;/li&gt;
&lt;li&gt;When you need polymorphism with shared behavior
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ❌ Inheritance-heavy approach&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;BaseButton&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
  &lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`&amp;lt;button&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;/button&amp;gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;PrimaryButton&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;BaseButton&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`&amp;lt;button class="primary"&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;/button&amp;gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;LoadingButton&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;BaseButton&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nx"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`&amp;lt;button disabled="&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;loading&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Loading...&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;/button&amp;gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// ❌ What if we need LoadingPrimaryButton? Multiple inheritance problem!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ✅ Composition approach&lt;/span&gt;
&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;ButtonProps&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;variant&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;primary&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;secondary&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="nx"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;variant&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;secondary&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;onClick&lt;/span&gt; &lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="nx"&gt;ButtonProps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; 
      &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;`button &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;variant&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="nx"&gt;disabled&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;loading&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Loading...&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// ✅ Easy to combine behaviors&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;PrimaryButton&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Omit&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ButtonProps&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;variant&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="p"&gt;{...&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;variant&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;primary&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;LoadingPrimaryButton&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Omit&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ButtonProps&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;variant&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;loading&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="p"&gt;{...&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;variant&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;primary&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;loading&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Flexibility&lt;/strong&gt;: Mix and match behaviors as needed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Testability&lt;/strong&gt;: Easy to test individual behaviors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Common Pitfall:&lt;/strong&gt; Creating too many small components when a simple solution would work better.&lt;/p&gt;




&lt;h3&gt;
  
  
  Tell, Don't Ask
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Definition:&lt;/strong&gt; Objects should tell other objects what to do, not ask them for data and make decisions for them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simple explanation:&lt;/strong&gt; Instead of asking an object for its data and then deciding what to do, tell the object what you want done and let it handle the details.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Encapsulates logic where it belongs, reduces coupling, and makes code more maintainable by keeping related logic together.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to use:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;State management where logic belongs with the data&lt;/li&gt;
&lt;li&gt;API design where you want to encapsulate business rules&lt;/li&gt;
&lt;li&gt;React components that should manage their own state&lt;/li&gt;
&lt;li&gt;Reducing prop drilling and state management complexity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;When NOT to use:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simple data structures without behavior&lt;/li&gt;
&lt;li&gt;When you genuinely need raw data for multiple purposes&lt;/li&gt;
&lt;li&gt;Pure calculation functions that transform data
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ❌ Asking for data and making decisions externally&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ShoppingCart&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;cart&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setCart&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt; &lt;span class="na"&gt;discount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleCheckout&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Asking for data and calculating externally&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;total&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;cart&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;total&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;price&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="nf"&gt;checkout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;total&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleCheckout&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Checkout&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;;
&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ✅ Tell objects what to do&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ShoppingCartModel&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;CartItem&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;

  &lt;span class="nf"&gt;calculateTotal&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; 
      &lt;span class="nx"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;price&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nf"&gt;checkout&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nx"&gt;CheckoutData&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;total&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;calculateTotal&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// ✅ React component tells the cart what to do&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ShoppingCart&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;cart&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ShoppingCartModel&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleCheckout&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;checkoutData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;cart&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;checkout&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Tell the cart to checkout&lt;/span&gt;
    &lt;span class="nf"&gt;processCheckout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;checkoutData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleCheckout&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Checkout&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;;
&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Encapsulation&lt;/strong&gt;: Business logic stays with the data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maintainability&lt;/strong&gt;: Changes to rules happen in one place&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Common Pitfall:&lt;/strong&gt; Creating overly complex objects when simple data structures would suffice.&lt;/p&gt;




&lt;h3&gt;
  
  
  Convention over Configuration
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Definition:&lt;/strong&gt; Provide sensible defaults and follow established patterns so developers don't have to configure everything explicitly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simple explanation:&lt;/strong&gt; Make the common case easy by having smart defaults. Only require configuration for the uncommon cases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Reduces boilerplate, speeds up development, and makes codebases more predictable by following established patterns.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to use:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Folder structure organization&lt;/li&gt;
&lt;li&gt;API endpoint naming&lt;/li&gt;
&lt;li&gt;Component file naming and organization&lt;/li&gt;
&lt;li&gt;State management patterns&lt;/li&gt;
&lt;li&gt;Default configurations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;When NOT to use:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When your needs genuinely differ from conventions&lt;/li&gt;
&lt;li&gt;When conventions would confuse your team&lt;/li&gt;
&lt;li&gt;When explicit configuration improves clarity
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ❌ Everything requires explicit configuration&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;routes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;users&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;list&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api/users&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;UserController.list&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;create&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api/users&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;UserController.create&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api/users/:id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;UserController.get&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// ❌ Manual API client configuration&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;apiClient&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ApiClient&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;baseURL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.example.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;timeout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;errorHandler&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; 
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ✅ Convention-based routing&lt;/span&gt;
&lt;span class="c1"&gt;// File: routes/users.ts - framework maps methods to RESTful routes&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;index&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;show&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// ✅ API client with smart defaults&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;apiClient&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createApiClient&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Works out of the box&lt;/span&gt;

&lt;span class="c1"&gt;// Only configure what's different&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;customApiClient&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createApiClient&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;baseURL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;API_URL&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Productivity&lt;/strong&gt;: Less boilerplate, faster development&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consistency&lt;/strong&gt;: Everyone follows the same patterns&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Discoverability&lt;/strong&gt;: Easy to find things in predictable locations&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Onboarding&lt;/strong&gt;: New developers understand the structure quickly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Common Pitfall:&lt;/strong&gt; Following conventions blindly when they don't fit your use case.&lt;/p&gt;




&lt;h3&gt;
  
  
  Principle of Least Astonishment
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Definition:&lt;/strong&gt; Software should behave in a way that least surprises users and developers. The behavior should match expectations based on common patterns and naming.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simple explanation:&lt;/strong&gt; If most developers would expect something to work a certain way, it should work that way. Don't be clever at the expense of being predictable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This is similar to "Principle of Least Surprise" from Part 2, but focuses more on API design and system behavior rather than code readability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt; Reduces cognitive load, prevents bugs from misunderstood behavior, and makes systems easier to learn and use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to use:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API response formats&lt;/li&gt;
&lt;li&gt;Error handling patterns&lt;/li&gt;
&lt;li&gt;State management behavior&lt;/li&gt;
&lt;li&gt;Component lifecycle and side effects&lt;/li&gt;
&lt;li&gt;Function naming and behavior&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;When NOT to use:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When breaking expectations provides significant value&lt;/li&gt;
&lt;li&gt;When following patterns would compromise security&lt;/li&gt;
&lt;li&gt;When domain requirements genuinely differ from common patterns
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ❌ Astonishing API behavior&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api/users/:id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Surprising: Returns 200 with special format instead of 404&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;NOT_FOUND&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ✅ Predictable API behavior&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api/users/:id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Expected: 404 for not found&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;User not found&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Expected: 200 with user data&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ❌ Function with surprising behavior&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;saveUserData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userData&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Surprising: Function named 'save' also sends emails&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;database&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;save&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;emailService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendWelcome&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ✅ Function with predictable behavior&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;saveUser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userData&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;UserData&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;User&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Function only saves, as the name suggests&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;database&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;save&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;createUser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userData&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;UserData&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;User&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Separate function for the full creation flow&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;saveUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;emailService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendWelcome&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Always returns the same type&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Reduced Errors&lt;/strong&gt;: Developers make fewer mistakes when behavior matches expectations&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Faster Development&lt;/strong&gt;: Less time spent understanding quirks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Common Pitfall:&lt;/strong&gt; Being too clever or trying to "improve" on established patterns without clear benefit.&lt;/p&gt;




&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;These &lt;strong&gt;Advanced Principles&lt;/strong&gt; help you write code that's not just functional, but elegant and maintainable. They're the difference between code that works and code that's a joy to work with.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advanced principles covered:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Law of Demeter&lt;/strong&gt;: Don't reach through objects - keep interactions local&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Composition over Inheritance&lt;/strong&gt;: Build complexity from simple, composable parts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tell, Don't Ask&lt;/strong&gt;: Let objects manage their own state and behavior&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Convention over Configuration&lt;/strong&gt;: Smart defaults make the common case easy&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Principle of Least Astonishment&lt;/strong&gt;: Behavior should match expectations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Together with the principles from &lt;a href="//./understand-acronym-spaghetti-wtf-to-solid-code"&gt;Part 1&lt;/a&gt;, &lt;a href="//./understand-acronym-spaghetti-part-2-quality-principles"&gt;Part 2&lt;/a&gt;, &lt;a href="//./understand-acronym-spaghetti-part-3-solid-principles"&gt;Part 3&lt;/a&gt;, and &lt;a href="//./understand-acronym-spaghetti-part-4-cqrs-and-hexagonal"&gt;Part 4&lt;/a&gt;, you now have a complete toolkit for writing clean, maintainable code in React and Node.js.&lt;/p&gt;

&lt;p&gt;Remember: &lt;strong&gt;mastery comes from knowing when to apply these principles and when to break them for the sake of simplicity.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>principles</category>
      <category>cleancode</category>
      <category>react</category>
    </item>
  </channel>
</rss>
