Claude Code tutorials — write commands, build agents, add hooks | cctk
Tutorials · 12 guides

Learn Claude Code step by step

Hands-on tutorials for building with Claude Code — from your first slash command through advanced workflow patterns. Each guide is a working example you can run in 15-30 minutes.

Intermediate

Intermediate

Build a subagent from scratch

When slash commands aren't enough — build a focused subagent for extended, delegated work. This tutorial walks through building a <code>docs-agent</code> that reviews documentation drift.

25 minIntermediate
Intermediate

Add lifecycle hooks to enforce team standards

Hooks run at Claude Code lifecycle events (PreToolUse, PostToolUse, Stop) to enforce team conventions automatically. This tutorial builds a <code>block-secrets</code> hook step-by-step.

20 minIntermediate
Intermediate

Integrate an MCP server

Give Claude Code access to external services (Sentry, GitHub, Datadog, Linear) via MCP servers. This tutorial walks through installing the Sentry MCP and using it in a subagent.

15 minIntermediate
Intermediate

Debug a flaky test with Claude Code

Flaky tests are the worst kind of technical debt — expensive to ignore, tedious to fix. This tutorial walks through a real debugging session with Claude Code, from failing test to root cause to fix.

20 minIntermediate
Intermediate

Audit and tune your CLAUDE.md

CLAUDE.md is the most impactful file in your repo. This tutorial walks through a systematic audit — measuring current quality, identifying anti-patterns, and shipping a better version.

20 minIntermediate
Intermediate

Cut token costs with prompt caching

Prompt caching can reduce API costs by 60-90% for repeated-context workloads. This tutorial walks through when to use it, how to structure prompts for cache hits, and how to measure the savings.

15 minIntermediate
Intermediate

Debug a production incident with Claude Code

Walk through a real incident investigation using the <code>incident-investigator</code> subagent, Sentry/Datadog MCPs, and structured hypothesis testing. End-to-end pattern.

30 minIntermediate
Intermediate

Migrate a JavaScript module to TypeScript

A safe, incremental JS→TS migration using <code>refactor-agent</code>. Plan first, one file at a time, tests between steps, tighten tsconfig progressively.

40 minIntermediate
Intermediate

Build a custom Claude Skill from scratch

From empty directory to shipped-in-the-repo: activation conditions, file layout, conventions, examples, and pre-commit checklists. The full skill workflow.

35 minIntermediate
Intermediate

Set up an AI-powered PR review pipeline end-to-end

Wire up <code>pr-reviewer</code>, block-secrets hook, and GitHub Actions so every PR gets a Claude review — with team controls, cost caps, and human authority preserved.

45 minIntermediate
Intermediate

Set up cost observability and budgets for Claude Code

Build a working cost dashboard, per-team budget alerts, and the automation to catch runaway spend before it becomes a monthly surprise. Practical tooling — not just theory.

35 minIntermediate
Intermediate

Draft postmortems with Claude Code end-to-end

Build a postmortem workflow that captures context during incidents and produces a first-draft postmortem within an hour of resolution. Template-driven approach.

30 minIntermediate
Intermediate

Migrate your team from GitHub Copilot to Claude Code

A practical migration path — running both in parallel, moving workflows one at a time, and knowing when the migration is actually complete.

35 minIntermediate
Intermediate

Wire up a Slack integration for team Claude Code use

Build a Slack app that lets your team invoke Claude Code from any channel — for quick lookups, incident context, or triggering workflows.

40 minIntermediate
Intermediate

Build a design-review checklist workflow with Claude Code

Encode your team's design standards as a checklist and have Claude run first-pass review before human review — mechanical checks handled, judgment preserved for humans.

35 minIntermediate
Intermediate

Automate changelog and release notes with Claude Code

Generate meaningful release notes from git history — with the specific pattern that produces useful notes rather than a wall of commit messages.

30 minIntermediate
Intermediate

Build a documentation freshness sweep with Claude Code

Docs rot. This workflow finds the rot — pages that reference deleted files, wrong API signatures, outdated screenshots. Runs weekly, produces a PR with fixes.

35 minIntermediate
Intermediate

Automate technical spec generation from user requirements

Take a product requirement and generate a technical spec that's a genuine starting point — not a wall of AI text your engineers rewrite anyway.

40 minIntermediate

Advanced

Advanced

Chain slash commands into workflows

Compose commands and subagents into multi-step workflows. This tutorial covers when to chain (vs build one big command), the three common patterns (pipeline, fanout, gate), and how to ship workflows.

30 minAdvanced
Advanced

Run Claude Code in GitHub Actions

Move Claude Code from interactive sessions to CI. Automated PR reviews, nightly refactor checks, and post-deploy verification — with proper secrets handling and cost controls.

30 minAdvanced
Advanced

Customize cctk for a monorepo

Monorepos need a different Claude Code setup than single-package repos. Per-package CLAUDE.md, shared conventions, workspace-aware commands, and the trade-offs between scoped and global.

25 minAdvanced
Advanced

Refactor a legacy module safely (plan-first workflow)

Take a real-shaped legacy module and refactor it in reviewable increments. Uses <code>refactor-agent</code>, characterization tests, and step-by-step verification.

50 minAdvanced
Advanced

Multi-agent orchestration: chaining subagents

When a single subagent isn't enough — chain <code>incident-investigator</code> → <code>root-cause-analyzer</code> → <code>fix-drafter</code> into a coherent workflow with human checkpoints.

45 minAdvanced
Advanced

Build your own MCP server for an internal service

Build a working MCP server from scratch — schema, tool definitions, error handling, and connecting it to Claude Code. Uses an internal ticketing system as the example.

55 minAdvanced
Advanced

Set up audit trails for compliance-friendly Claude Code use

Build the audit logging that lets your compliance framework treat Claude Code sessions the same as any other tool. Structured events, session tracking, retention.

45 minAdvanced
Advanced

Build a parallel investigation workflow with multiple subagents

When one investigator isn't enough — run multiple subagents in parallel, each investigating a different angle of the same problem. Compresses investigation time.

40 minAdvanced
Advanced

Build a knowledge-base MCP for internal docs

Turn your team's wiki, ADRs, or internal docs into an MCP server that Claude Code can query. Grounded answers from your actual docs.

55 minAdvanced
Advanced

Create a repeatable code-migration workflow with rollback safety

When the same migration touches 40 services — reproducible workflow, verification per step, rollback baked in, PR-per-package for human review.

45 minAdvanced
Advanced

Coordinate an API change across services safely

Change one service's API and 12 downstream services need updates. Build the workflow that finds all consumers, generates updates, and rolls out in the right order.

50 minAdvanced
Advanced

Run Claude Code with enterprise SSO and access controls

Wire Claude Code into your identity provider (Okta, Azure AD, Google Workspace) so access follows the same policies as your other tools.

45 minAdvanced