The Claude Code Playbook — 200 Battle-Tested Patterns for Claude Code

Written by Michael Lip · Solo founder of Zovo · $400K+ on Upwork · 100% JSS Join 50+ builders · More at zovo.one

200 battle-tested patterns, curated from 3,000+ articles.

This is not another list of tips. Every pattern in this collection has been tested, scored, and ranked by real-world effectiveness. We reviewed over 3,000 Claude Code articles and distilled them down to the 200 that actually matter.

What you get:


Error Fixes (50)

Stop debugging. Start fixing.

Every error article follows the same structure: the exact error message, the root cause, the fix, and how to prevent it from happening again. No guesswork.

# Error Fix
1 Claude API Error 401 authentication_error Fix Invalid API keys, environment variable setup, SDK authentication
2 Claude Code Error: Unexpected Token in JSON Response Fix JSON parsing failures, debugging techniques, prevention
3 Stream Idle Timeout – Fix Partial Response Error Idle timeout detection code for streaming large inputs
4 Fix: Claude Code Image 400 Error Loop Unrecoverable image processing 400 error workaround
5 Fix: MCP Server Disconnected Error Progress token handling in stdio transport
6 Fix: SDK TypeError: terminated Streaming Intermittent undici failures with large streaming inputs
7 Claude API Error 413 request_too_large Fix Request size limits for Messages, Batch, and Files endpoints
8 Fix Claude API Error 500 Apierror Explained Retry strategies and error handling in Python/TypeScript SDKs
9 Fix: Claude Code Slow Response Latency Diagnose and fix 2+ minute latency and minimal output
10 Fix Claude Code TLS/SSL Errors Behind Proxy TLS connect errors and certificate failures behind proxies
11 Fix ‘command not found: claude’ After Install PATH fixes for macOS, Linux, and Windows
12 Fix Claude Code Install Killed on Linux Swap space fix for low-memory Linux servers and VPS
13 Fix Claude Tool Use Not Working Tool definition validation, tool_choice, strict mode
14 Claude API Error 429 rate_limit_error Fix Retry logic, backoff strategies, rate limit headers
15 Claude API Error 529 overloaded_error Fix Retry strategies, fallback models, and Batch API
16 Fix Docker Build Failures When Using Claude Code Multi-stage build errors, dependencies, layer caching
17 Fix: Claude Code Auth Fails on Headless Linux OAuth token refresh blocked by Cloudflare WAF
18 Fix: Claude Code High Token Usage Context accumulation and token consumption control
19 Fix Claude Code Login – Cannot Paste Auth Code Paste bracket mode, Linux, WSL auth code issues
20 Fix Claude Code NPM Install Eacces Permission npm EACCES permission denied during installs
21 Fix Prisma Migration Failures with Claude Code Drift detection, failed migrations, data loss warnings
22 Fix WebSocket Connection Failures in Claude Code WS handshake failures, proxy issues, CORS errors
23 Fix Claude Opus Prefill Not Supported Error Use structured outputs or system prompts instead
24 Fix Claude Code Econnrefused MCP ECONNREFUSED when connecting to MCP servers
25 Fix ESLint and Prettier Conflicts in Claude Code Projects Configure ESLint and Prettier to work together
26 Fix Claude Extended Thinking Not Working budget_tokens validation, tool_choice conflicts
27 Fix Claude Md Not Being Read By Claude Code CLAUDE.md file loading troubleshooting
28 Fix Claude Prompt Caching Not Working Minimum token thresholds, cache invalidation
29 Fix Claude Code Bun Errors Bun runtime module resolution and compatibility
30 Claude Code Maximum Call Stack Exceeded: Skill Debug Guide Recursive call stack overflow in skills
31 Fix Next.js Hydration Errors Using Claude Code Server/client rendering differences, dynamic content
32 Claude Code Skill Circular Dependency Detected Error Fix Circular dependency resolution in skills
33 Fix TypeScript Strict Mode Errors with Claude Code strictNullChecks, noImplicitAny, strict initialization
34 Claude Code Error: Git Push Rejected During Skill Fix Branch conflicts and skill synchronization
35 Claude Code Keeps Adding Unnecessary Console.log Prevent unwanted console.log injection
36 Fix Skill Invalid YAML Syntax Error How to Debug YAML syntax debugging in Claude skills
37 Claude Skills Directory GitHub: Fix Skill Not Found Skills directory configuration
38 Claude Code Gives Incorrect Imports: How to Fix Import statement fixes for JS, Python, TypeScript
39 Fix: Claude Code PreToolUse Hooks Stop Working Hooks bypassed after background tasks complete
40 Fix Cannot Read Properties of Undefined input_tokens, trim, and OAuth null errors
41 Claude Code Error: npm install Fails in Skill Workflow Dependency issues with pdf, puppeteer skills
42 Claude Says Response Incomplete – How to Fix Context limits, prompt structure, output settings
43 Claude Code Unknown Skill Error: Fix Spawn Issues Spawn failures, child_process path issues
44 Fix: Anthropic SDK toolRunner Drops Headers defaultHeaders dropped on follow-up requests
45 Fix Claude Code Esm Module Not Found Import CommonJS vs ESM configuration conflicts
46 Claude Code Stuck in Loop Repeating Same Output Fix Break repetitive output patterns
47 Fix: Structured Output + Thinking + Tool Use Bugs Missing tool_use blocks, invalid combinations
48 Fix Claude Code Not Working After Update Skill failures, path errors post-update
49 Fix Skills Context Window Exceeded Token budgeting and session management
50 Claude Code Keeps Producing Slightly Different Code Achieve consistent, reproducible output

CLAUDE.md Templates (25)

Copy. Paste. Ship.

Each template is a production-ready CLAUDE.md file for a specific framework. Drop it in your project root and Claude Code immediately follows your team’s conventions, naming patterns, and architecture rules.

Framework-Specific Templates

# Template Use Case
1 CLAUDE.md for Go + Gin + GORM Go 1.23 API – middleware chains, context propagation, error wrapping
2 CLAUDE.md for Next.js + TypeScript Next.js 15 – App Router, Server Components, Server Actions
3 CLAUDE.md for Node.js + Express + Prisma Node.js 22 – Express 5, Prisma 6, middleware patterns
4 CLAUDE.md for Rails + Turbo + Stimulus Rails 8.0 – Hotwire, Turbo Streams, Stimulus controllers
5 CLAUDE.md for Rust + Axum + SQLx Rust 1.83 – Tower middleware, extractors, error handling
6 CLAUDE.md for Django + PostgreSQL Django 5.1 – DRF, Celery, migration safety
7 CLAUDE.md for Elixir + Phoenix + LiveView Elixir 1.17 – LiveView lifecycle, Ecto changesets
8 CLAUDE.md for FastAPI + SQLAlchemy FastAPI 0.115 – async patterns, Pydantic v2, Alembic
9 CLAUDE.md for Flutter + Dart + Riverpod Flutter 3.27 – provider patterns, freezed, go_router
10 CLAUDE.md for iOS + Swift + SwiftUI iOS 18 – @Observable, SwiftData, async/await
11 CLAUDE.md for Laravel + PHP Laravel 11 – Eloquent, Blade, queue workers
12 CLAUDE.md for NestJS + TypeORM NestJS 11 – modules, providers, guards, interceptors
13 CLAUDE.md for React + Vite + TypeScript React 19 – Vite 6, HMR, lazy loading, Tanstack Query
14 CLAUDE.md for Android + Kotlin + Jetpack Compose Kotlin 2.1 – Compose state, ViewModel, Room
15 CLAUDE.md for React Native + Expo React Native 0.76 – Expo SDK 52, EAS Build, Reanimated
21 CLAUDE.md for SvelteKit SvelteKit 2.x – Svelte 5 runes, form actions, Drizzle ORM
22 CLAUDE.md for Nuxt 3 + Vue Nuxt 3.14 – Vue 3 Composition API, Pinia, Nitro server routes
23 CLAUDE.md for Spring Boot + Java Spring Boot 3.4 – Java 21, JPA, Spring Security, virtual threads
24 CLAUDE.md for Astro Astro 5.1 – content collections, islands architecture, MDX
25 CLAUDE.md for .NET + ASP.NET Core ASP.NET Core 9.0 – C# 13, EF Core 9, minimal APIs, MediatR

Pattern-Specific Templates

# Template Use Case
16 CLAUDE.md for Testing Conventions Test structure, coverage requirements, mocking strategies
17 CLAUDE.md for Error Handling Patterns Prevent silent failures, typed errors, recovery
18 CLAUDE.md for API Design Patterns REST endpoints, response envelopes, pagination, versioning
19 CLAUDE.md for Frontend Projects React components, state management, styling, a11y
20 CLAUDE.md for Security Rules Prevent SQL injection, XSS, insecure auth at generation time

Orchestration Configs (15)

Production-ready configs with WHY comments.

These are not toy examples. Each config has been extracted from real production environments. They include failure modes, edge cases, and the reasoning behind every setting.

# Config What It Covers
1 Container Environment Variables in Claude Code Secrets, config injection, Docker Compose env management
2 Claude Code Docker CI/CD Pipeline Integration Docker-based CI/CD pipeline automation
3 Claude Code Docker Compose Development Workflow Local dev, testing, and deployment with Compose
4 Claude Code MCP Server Incident Response Guide MCP server diagnostics, log analysis, recovery
5 Best Claude Skills for DevOps and Deployment Shell scripting, Docker, Terraform, CI/CD, security
6 Claude Code AWS ECS Fargate Setup and Deployment Task definitions, secrets management, CI/CD
7 Claude Code for Azure Arc Kubernetes Arc-enabled cluster management, deployment automation
8 Claude Code for Carvel ytt Templating Advanced Carvel ytt config templating
9 Claude Code GitHub Actions Caching Strategies CI/CD caching for faster pipeline runs
10 Claude Code Vercel Deployment Guide Vercel + Next.js deploys, previews, environment management
11 Jira MCP Server Claude Code Integration Project management automation via MCP
12 MCP Transport Layer Security TLS Configuration TLS for MCP servers with security best practices
13 Slack MCP Server Team Notification Automation CI/CD alerts, deploy notifications, monitoring
14 Telegram MCP Server Bot Automation Message handling, workflow automation, security
15 Claude Code Chaos Engineering Testing Automation Resilience testing with Claude skills

Cost Optimization (10)

Cut your Claude API bill by 50%+.

Every article includes real dollar amounts, verifiable math, and before/after comparisons. No hand-waving. These techniques compound – use them together and the savings stack.

# Pattern Savings
1 Token-Efficient Few-Shot Examples for Claude Compress 2,000 to 400 tokens – save $80 per 10K Opus requests
2 Web Search Costs $10 per 1,000 Searches Understand true cost: $750/month at 1,000 daily searches
3 Claude Caching for Multi-Turn Conversations Save 76% on multi-turn – $0.72 to $0.17 per 8-turn chat
4 Claude Batch API 50% Discount Complete Guide Opus drops from $5/$25 to $2.50/$12.50 per million tokens
5 Prompt Compression Techniques for Claude API Reduce token count by 30-60% – save $75 per 10K Opus requests
6 System Prompt Optimization to Cut Claude Costs Compress 2,000 to 500 tokens – 75% input cost reduction
7 Reduce Claude Code Token Consumption by 60% Five techniques: targeted reads, compact, session splitting
8 Optimizing Tool Schemas to Cut Token Count Trim schemas by 50% – save $50 per 10K Opus requests
9 Claude API Cost Dashboard Setup Guide 2026 Real-time spend tracking – teams save $2,400/month from visibility
10 Chunking Strategies to Cut Claude Context Costs Reduce 500K context to 30K – save $70.50 per 50 requests

Prompts and Skills (100)

100 techniques that work.

Organized by what you actually do: write code, review PRs, debug issues, deploy to production. Each article includes a prompt you can copy, an explanation of why it works, and guidance on adapting it to your codebase.

Skill Creation (8 articles)

Build, share, and optimize custom Claude Code skills.

# Article
1 Claude Skill .md File Format: Full Specification Guide
3 How to Share Claude Skills with Team: Complete Guide
8 How to Contribute Claude Skills to Open Source
31 How to Optimize Claude Skill Prompts for Accuracy
34 Advanced Claude Skills with Tool Use and Function Calling
46 Build Your First Claude Code Skill in 5 Minutes
51 Claude Skills Marketplace Guide for Publishers
52 Antigravity vs Claude Native Skills: Complete Guide

Prompt Engineering (8 articles)

Write prompts that produce consistent, accurate results on the first try.

# Article
4 How to Use Tree of Thought Prompting with Claude Code
7 Claude Code for Few-Shot Prompting Best Practices Workflow
13 Speed Up Claude Code Responses with Better Prompt Structure
16 How to Write Effective Prompts for Claude Code
18 Claude Code for Self-Consistency Prompting Workflow
19 Claude Code Prompt Management Workflow Guide
61 Claude Code for Prompt Chaining Workflows
62 Claude Code Debugging Prompts That Work

Code Review (8 articles)

Automate PR reviews, enforce standards, and catch issues before merge.

# Article
5 Claude Code Automated Pull Request Review Workflow
39 Claude Code Engineering Manager Pull Request Review Workflow
47 Claude Code for Pair Review Workflow Tutorial Guide
72 Claude Skills Code Review Workflow for Pull Requests
74 AI Assisted Code Review Workflow Best Practices
75 Code Review Workflow with Claude Code
87 Claude Code for ESLint Custom Plugin Workflow
88 Claude Code for OSS Code Review Contribution Guide

Performance (8 articles)

Profile, optimize, and reduce latency across your stack.

# Article
6 Claude Code for Go Pprof Profiling
10 Claude Code for Node.js Profiling
14 Claude Code for Dead Code Elimination
38 Claude Code for P99 Latency Optimization
43 Bundle Size Reduction: Webpack to Vite 2026 Guide
58 Claude Code for Rust Profiling Workflow
63 Claude Skills Slow Performance Speed Up Guide
64 Claude Code for CDN Optimization Workflow

Debugging (8 articles)

Systematic approaches to finding and fixing bugs with Claude Code.

# Article
9 Claude Code Capacitor Hybrid App Debugging Workflow
17 Fix Claude Code Over-Engineers Simple Solutions
23 Claude Code Crashes When Loading Skill: Debug Guide
29 How to Make Claude Code Explain Its Reasoning Steps
44 Claude Code Debug Configuration Workflow
49 Claude Code Skill Circular Dependency Error Fix
50 Claude Code CS50 Project Help and Debugging Guide
53 Fix Claude Skill Not Triggering Automatically

Testing (8 articles)

Generate tests that catch real bugs – property testing, snapshot testing, browser testing, and more.

# Article
20 Claude Code Hypothesis Property Testing Guide
40 Claude Code Jest Snapshot Testing Workflow Best Practices
55 Claude Code for Documentation Testing
70 Claude Code Selenium Browser Testing Automation
76 Claude Code Pytest Parametrize Advanced Workflow Patterns
84 Claude Code L10n Testing Automation Workflow
92 Claude Code JUnit5 Test Patterns Guide
96 Claude Code Artillery Performance Testing

DevOps (8 articles)

CI/CD pipelines, container management, cloud deployments, and infrastructure as code.

# Article
12 Claude Code DevOps Engineer CI/CD Pipeline Daily Workflow
30 Claude Code Nix Flake Reproducible Development Environment
56 Claude Code GCP Google Cloud Setup and Deployment Guide
59 Claude Code Kubernetes Persistent Volumes Guide
77 Claude Code for Fly.io Deployment Automation
81 Claude Skills + AWS Lambda: Serverless Guide
85 Claude Code Docker Health Checks Guide
89 Claude Code Container Security Scanning Workflow

Development Workflows (8 articles)

Daily workflows, package publishing, data management, and developer tools.

# Article
21 Claude Code for PR Diff Analysis
24 How to Use Claude Data Access Permissions: Retention
25 Claude Code for PyPI Package Publishing
26 How to Use Claude Knowledge Base Markdown Files: Setup
28 Claude Code for Call Graph Analysis
37 Claude Code Developer Portal Setup Guide
41 Claude Code for Maven Artifact Publishing
42 Claude Code Skills for C# .NET Developers

Frontend (7 articles)

Component architecture, style guides, naming conventions, and cross-platform development.

# Article
11 Claude CLAUDE.md for Fullstack Projects
22 How to Make Claude Code Follow Team Style Guide
27 Claude Code Daily Workflow for Frontend Developers
35 How to Make Claude Code Follow My Naming Conventions
80 How to Use Astro Workflow
94 Claude CLAUDE.md Example for Remix Fullstack Application
99 Claude Code for Redwood JS Fullstack Workflow

Git Workflow (6 articles)

Branching strategies, monorepo management, and commit enforcement.

# Article
2 Claude Code Conventional Commits Enforcement Workflow
45 Organize Claude Skills in a Monorepo: Best Way
57 Claude Code Git Worktree Parallel Development Workflow
65 Claude Code for Release Branching Strategy
69 Claude Code Skills Monorepo Management Workflow
83 Claude Code Git Workflow Best Practices Guide

Documentation (6 articles)

API reference generation, changelogs, docs-as-code, and automated documentation.

# Article
33 Claude Code API Reference Generation Guide
36 Automated Code Documentation Workflow with Claude Skills
60 Claude Code for Docs as Code Workflow
68 Claude Code for Keep a Changelog Workflow
73 Claude Code Confluence Documentation Guide
86 Claude Code for Technical Documentation Workflow

Database (7 articles)

ORM workflows, query optimization, infrastructure as code for data stores.

# Article
32 How to Use TypeORM Entities Relations Migration
54 Claude Code for CDKTF Terraform CDK Workflow
66 Claude Code Dart Flutter Cross Platform Development
67 Claude Code for Terraform Cloud Run Workflow
82 How to Use Supabase Full Stack Apps
98 Claude Code ActiveRecord Query Optimization
100 Claude Code Laravel Eloquent ORM

API Development (4 articles)

Tool use, function calling, OpenAPI spec generation, and API client development.

# Article
15 Claude API Tool Use and Function Calling Deep Dive
78 How to Use OpenAPI Spec Generation
79 Claude Code Rails API Mode Full Stack Workflow
90 Claude Code API Client TypeScript Guide

Architecture (4 articles)

Refactoring legacy code, design patterns, microservices, and parallel agents.

# Article
48 How to Use Claude Code to Refactor Legacy JavaScript
91 Claude Code Design Patterns Refactoring Guide
95 Claude Code for Monolith to Microservices Refactor
97 Claude Code Parallel Subagents – Best Practices

Security (2 articles)

Prompt injection prevention and security engineering workflows.

# Article
71 How to Use MCP Prompt Injection Attack Prevention
93 Claude Code Skills for Security Engineers and Pentesters

Get the Complete Playbook

Want all 200 patterns in a single downloadable package?

The complete Playbook includes every article above as clean markdown files, organized by category, plus a quick-start guide that tells you the 5 articles to read first.

Download the Complete Playbook – Free with email signup.

The public half (100 patterns) is also available as a GitHub repository you can star, fork, and contribute to.


Last updated: April 2026. Curated from 3,000+ Claude Code articles by the Claude Skills Guide team.