Skip to content
Code Guide

Claude Code Workflows

Step-by-step guides for common development patterns with Claude Code.


Master the art of code search by combining rg, grepai, Serena & ast-grep

Learn when to use each tool, how to combine them for maximum efficiency, and real-world workflows including:

  • Exploring unknown codebases
  • Large-scale refactoring
  • Security audits
  • Framework migrations
  • Performance optimization

Key Topics:

  • Quick decision matrix
  • Complete feature comparison
  • 5 combined workflows
  • Performance benchmarks
  • Common pitfalls
  • Tool selection cheatsheet

Structure complex tasks with planning mode before execution.

When to use: Multi-step features, architectural changes, uncertainty about approach

Test-Driven Development workflow: write tests first, implement after.

When to use: Critical functionality, regression prevention, API design

Write specifications before code for better requirements clarity.

When to use: Team collaboration, complex features, documentation-first projects

Improve code through multiple refinement cycles.

When to use: Quality improvements, performance optimization, code cleanup

Use existing battle-tested repositories as scaffolding for new projects.

When to use: Starting new projects, standardizing team patterns, rapid prototyping from proven foundations

Scale CLAUDE.md across a multi-developer, multi-tool team with profile-based module assembly.

When to use: Team 5+ devs, multiple AI tools (Claude Code + Cursor/Windsurf), mixed OS

Enforce per-PR documentation with a 3-layer system: CLAUDE.md rule + UserPromptSubmit hook + CI gate

Eliminates merge conflicts on CHANGELOG.md, captures context at implementation time, and ensures DB migrations are never silently deployed. Includes a reusable UserPromptSubmit hook pattern for enforcing any mandatory workflow step.

Key Topics:

  • CLAUDE.md workflow rule for autonomous fragment creation
  • UserPromptSubmit hook with 3-tier priority (enforcement, discovery, contextual)
  • Conditional suggestion pattern: “if PR-intent without fragment-mention”
  • CI enforcement with independent migration check job

Two-engine UserPromptSubmit hook system: regex enforcement + self-calibrating BM25 lexical scoring

Injects ranked skill suggestions as additionalContext so Claude proposes the right skill even when phrasing was never anticipated. BM25 generalizes from scenario examples; the regex layer handles enforcement patterns. Both run in parallel on every prompt.

Key Topics:

  • Regex vs BM25 decision table (when each engine wins)
  • Corpus format: 10+ positive + 3+ negative scenarios per skill
  • build-index.js: leave-one-out calibration, F-beta threshold, ok/excluded/conflict status
  • Wiring two hooks in parallel via settings.json
  • Detached background index rebuild when corpus changes

3-phase feature development with explicit validation gates between phases

Build features in three locked phases: Research feasibility first, plan the implementation second, write code third. Each phase produces a concrete artifact (RESEARCH.md → PLAN.md → code). Each gate requires an explicit GO before the next phase starts.

When to use: Features with unclear feasibility, more than a day of work, unknown technical territory, or anywhere discovering a wrong assumption late is costly

5 production-ready patterns for automating PR reviews, issue triage, and quality gates

Connect Claude directly to your GitHub workflow via the official claude-code-action. Two modes: interactive (@claude mentions) and fully automated (push/schedule triggers).

Key Topics:

  • Setup via /install-github-app (30-second quickstart)
  • Pattern 1: On-demand PR review via @claude mention
  • Pattern 2: Automatic review on every push
  • Pattern 3: Issue triage and labeling
  • Pattern 4: Security-focused review on sensitive paths
  • Pattern 5: Scheduled weekly repo health check
  • Cost control, concurrency, fork safety

When to use: Any team wanting AI-powered code review without managing infrastructure


Switch between specialist roles across your ship cycle: strategic product gate, architecture review, paranoid code review, automated release, native browser QA, and retrospective.

When to use: Ship cycles where you want explicit separation between product direction, engineering rigor, review, and release — rather than one generic assistant handling all phases


Convert design mockups (Figma, wireframes) into working code.

When to use: Frontend development, UI implementation, design system work

Generate social preview images dynamically at build time with Satori and resvg.

When to use: Astro projects, keeping social previews accurate without maintaining static PNGs

Generate professional PDFs using Quarto/Typst with Claude Code.

When to use: Reports, documentation, whitepapers, technical documents

6-stage skill pipeline: raw material → structured talk → AI-generated slides via Kimi.

When to use: Conference talks, meetup presentations, internal tech talks — from article, transcript, or notes

Configure Text-to-Speech for Claude Code responses (Agent Vibes integration).

When to use: Audio feedback, accessibility, hands-free coding


Systematically explore and understand unfamiliar codebases.

When to use: New projects, legacy code, documentation gaps

Related: See Search Tools Mastery for advanced multi-tool exploration strategies.


JavaScript scripts that orchestrate tens to hundreds of subagents with deterministic control flow, parallel fan-out, and automatic resume on interruption.

When to use: Multi-stage parallelizable work, long-running jobs, tasks needing structured data handoffs between phases, or any situation where a single agent would hit context limits

Key Topics:

  • Primitive reference: agent(), parallel(), pipeline(), phase(), log(), budget
  • pipeline() vs parallel() with benchmark data (3x latency difference, 2x token difference)
  • Schema-structured outputs across phases
  • 5 named patterns: adversarial verification, loop-until-dry, judge panels, multi-modal sweep, plan-execute-review
  • Behavioral guarantees: determinism constraints, resume/caching, concurrency caps

Orchestrate multiple specialized agents working in parallel on complex tasks.

When to use: Tasks that benefit from parallelism, specialized expertise, or independent verification

Fast-track guide to setting up your first agent team in under 30 minutes.

When to use: New to multi-agent patterns, want to experiment before committing to full setup

Run Opus for planning and Sonnet for execution in two coordinated Claude Code instances.

When to use: Complex features needing deep reasoning for architecture, cost-effective execution

Coordinate agents through hook events rather than direct orchestration.

When to use: Reactive workflows, hook-triggered automation, loosely-coupled agent pipelines

Full end-to-end plan pipeline: /plan-start, /plan-validate, /plan-execute as a coherent workflow.

When to use: Any significant feature where planning rigor pays off before writing code

Multi-session task tracking with TodoWrite, tasks API, and context persistence across sessions.

When to use: Long-running tasks spanning multiple sessions, team coordination, complex backlogs


Your SituationRecommended Workflow
New to codebaseExploration Workflow + Search Tools Mastery
Complex featurePlan-Driven or Spec-First
Need reliabilityTDD with Claude
Large refactoringSearch Tools Mastery
UI implementationDesign to Code
Code qualityIterative Refinement
New project from templateSkeleton Projects
Team AI instructionsTeam AI Instructions
Enforce mandatory workflow stepsChangelog Fragments
Skill routing from natural-language promptsSmart-Suggest Routing
Unknown feasibility, multi-day featureRPI: Research → Plan → Implement
DocumentationPDF Generation
Social previewsOG Image Generation
Conference talk from raw materialTalk Preparation Pipeline
Audio feedbackTTS Setup
Deterministic multi-agent orchestrationDynamic Workflows
Multi-agent tasksAgent Teams
First agent teamAgent Teams Quick Start
Cost-optimized planningDual-Instance Planning
Hook-driven automationEvent-Driven Agents
Full plan workflowPlan Pipeline
Multi-session trackingTask Management
Strategic gate before codingCognitive Mode Switching
Non-MCP browser automationCognitive Mode Switching

New workflow ideas? Open an issue or PR in the main repository.

Workflow Template Structure:

  1. Title & Purpose
  2. When to Use
  3. Prerequisites
  4. Step-by-Step Guide
  5. Real-World Examples
  6. Common Pitfalls
  7. Related Workflows

Last updated: March 2026