Back to all posts
    Claude Code Advanced Tips: 6 Months of Hardcore Engineering Use [2026]

    Claude Code Advanced Tips: 6 Months of Hardcore Engineering Use [2026]

    Auto-activating skills, dev docs workflows, hooks for error catching, and PM2 integration for serious software engineering.

    January 30, 2026
    Updated July 6, 2026
    22 min read
    104 views
    by Iwo Szapar

    Last Updated: January 2026

    After 300k+ lines of code and 6 months of daily use, here are the systems that actually work for serious software engineering with Claude Code.


    Quick Overview

    This isn't a beginner's guide. This is for engineers who want to:

    • Build auto-activating skills that Claude actually uses
    • Implement hooks that catch errors before they ship
    • Create dev docs workflows that survive context compaction
    • Manage multiple microservices with PM2 integration

    The result: Consistent, production-quality code from an AI that would otherwise produce inconsistent results.


    The Skills Auto-Activation System

    The Problem

    Anthropic releases Skillsβ€”portable, reusable guidelines. You spend hours writing comprehensive best practices. Then... nothing. Claude ignores them. You use exact keywords from skill descriptions. Still nothing.

    The Solution: Hooks That Force Skill Loading

    Build a multi-layered auto-activation architecture:

    Hook 1: UserPromptSubmit (runs BEFORE Claude sees your message)

    // Analyzes your prompt for keywords and intent patterns
    // Checks which skills might be relevant
    // Injects a formatted reminder into Claude's context
    
    // Now when you ask "how does the layout system work?"
    // Claude sees: "🎯 SKILL ACTIVATION CHECK - Use frontend-dev-guidelines skill"
    // BEFORE reading your question
    

    Hook 2: Stop Event (runs AFTER Claude finishes responding)

    // Analyzes which files were edited
    // Checks for risky patterns (try-catch, database operations, async)
    // Displays gentle self-check reminder
    // Non-blocking, just keeps Claude aware
    

    skill-rules.json Configuration

    {
      "backend-dev-guidelines": {
        "type": "domain",
        "enforcement": "suggest",
        "priority": "high",
        "promptTriggers": {
          "keywords": ["backend", "controller", "service", "API"],
          "intentPatterns": [
            "(create|add).*?(route|endpoint|controller)",
            "(how to|best practice).*?(backend|API)"
          ]
        },
        "fileTriggers": {
          "pathPatterns": ["backend/src/**/*.ts"],
          "contentPatterns": ["router\\.", "export.*Controller"]
        }
      }
    }
    

    Results

    Before skills + hooks:

    • Claude uses old patterns even with documented new ones
    • Manual "check BEST_PRACTICES.md" reminders every time
    • Inconsistent code across the codebase

    After skills + hooks:

    • Consistent patterns automatically enforced
    • Claude self-corrects before you see the code
    • Way less time on reviews and fixes

    The Dev Docs System (Context Management)

    The Problem

    Claude is like an extremely confident junior dev with extreme amnesia. Loses track of what it's doing. Goes off on tangents. Forgets the plan.

    The Solution: Three-File System

    For every large task, create:

    /dev/active/[task-name]/
      [task-name]-plan.md      # The approved plan
      [task-name]-context.md   # Key files, decisions, gotchas
      [task-name]-tasks.md     # Checklist of work
    

    The Workflow

    Starting:

    1. Use planning mode to research and create plan
    2. Review plan thoroughly (catch mistakes here)
    3. Run /dev-docs to create the three files
    4. Claude now has persistent task memory

    During Implementation:

    • Remind Claude to update tasks as completed
    • Add relevant context to context.md
    • When low on context: /update-dev-docs then compact

    Continuing After Compaction:

    • Just say "continue"
    • Claude reads all three files
    • Picks up exactly where you left off

    Why This Matters

    Without dev docs:

    • Claude loses the plot after 30 minutes
    • Tangents derail the feature
    • Auto-compaction destroys progress

    With dev docs:

    • Survives any context reset
    • Always knows the plan
    • Implementation stays on track

    The Hooks System (#NoMessLeftBehind)

    Hook #1: File Edit Tracker

    Post-tool-use hook after every Edit/Write/MultiEdit:

    // Logs:
    // - Which files were edited
    // - What repo they belong to
    // - Timestamps
    

    Hook #2: Build Checker

    Stop hook when Claude finishes responding:

    // 1. Reads edit logs to find modified repos
    // 2. Runs build scripts on each affected repo
    // 3. Checks for TypeScript errors
    // 4. If < 5 errors: Shows to Claude
    // 5. If β‰₯ 5 errors: Recommends auto-error-resolver agent
    

    Result: Not a single instance of Claude leaving errors for you to find later.

    Hook #3: Error Handling Reminder

    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    πŸ“‹ ERROR HANDLING SELF-CHECK
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    
    ⚠️  Backend Changes Detected
       2 file(s) edited
    
       ❓ Did you add Sentry.captureException() in catch blocks?
       ❓ Are Prisma operations wrapped in error handling?
    
       πŸ’‘ Backend Best Practice:
          - All errors should be captured to Sentry
          - Controllers should extend BaseController
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    

    Non-blocking awareness. Claude self-assesses.


    PM2 for Backend Services

    The Problem

    Multiple microservices running. Claude can't see logs. You become a human log-fetching service.

    The Solution: PM2

    // ecosystem.config.js
    module.exports = {
      apps: [
        {
          name: 'form-service',
          script: 'npm',
          args: 'start',
          cwd: './form',
          error_file: './form/logs/error.log',
          out_file: './form/logs/out.log',
        },
        // ... more services
      ]
    };
    

    Before PM2:

    You: "The email service is throwing errors"
    You: [Manually finds logs]
    You: [Pastes into chat]
    Claude: "Let me analyze..."
    

    After PM2:

    You: "The email service is throwing errors"
    Claude: [Runs] pm2 logs email --lines 200
    Claude: [Reads logs] "Database connection timeout..."
    Claude: [Runs] pm2 restart email
    Claude: "Restarted, monitoring for errors..."
    

    Night and day. Claude autonomously debugs.


    Specialized Agents

    Build an army:

    Quality Control:

    • code-architecture-reviewer
    • build-error-resolver
    • refactor-planner

    Testing & Debugging:

    • auth-route-tester
    • auth-route-debugger
    • frontend-error-fixer

    Planning & Strategy:

    • strategic-plan-architect
    • plan-reviewer
    • documentation-architect

    Key: Give agents specific roles and clear instructions on what to return. No more "I fixed it!" without knowing what they fixed.


    CLAUDE.md Structure

    Need a starting point? Browse free CLAUDE.md templates for 20+ professions.

    What Moved to Skills

    Previously in BEST_PRACTICES.md (1,400+ lines):

    • TypeScript standards
    • React patterns
    • Backend API patterns
    • Error handling
    • Database patterns

    Now in skills with auto-activation ensuring Claude uses them.

    What Stays in CLAUDE.md (~200 lines)

    • Quick commands (pnpm pm2:start, pnpm build)
    • Service-specific configuration
    • Task management workflow
    • Testing authenticated routes

    Skills handle "how to write code" CLAUDE.md handles "how this project works"


    The Complete Pipeline

    On every Claude response:

    Claude finishes responding
      ↓
    Hook 1: Build checker runs β†’ TypeScript errors caught
      ↓
    Hook 2: Error reminder runs β†’ Gentle self-check
      ↓
    If errors found β†’ Claude sees them and fixes
      ↓
    If too many β†’ Auto-error-resolver agent recommended
      ↓
    Result: Clean, error-free code
    

    Plus UserPromptSubmit hook loads relevant skills BEFORE starting.

    No mess left behind.


    Key Takeaways

    The Essentials:

    1. Plan everything - Planning mode or strategic-plan-architect
    2. Skills + Hooks - Auto-activation is the only way skills work reliably
    3. Dev docs system - Prevents losing the plot
    4. Code reviews - Have Claude review its own work
    5. PM2 for backend - Makes debugging bearable

    The Nice-to-Haves:

    • Specialized agents for common tasks
    • Slash commands for repeated workflows
    • Utility scripts attached to skills
    • Memory MCP for decisions

    Key Statistics

    • 300k+ LOC rewritten in 6 months (solo)
    • 40-60% token efficiency improvement with proper skill structure
    • Zero errors left behind with hook system
    • Survives any context reset with dev docs

    Go Deeper

    The File System Is the Prompt covers the context layer that makes these engineering patterns work. The full case study shows all these systems running a real business. And Context Engineering with MCP covers the integration patterns in production detail.

    Want these systems pre-configured? Check out Second Brain AI β†’