Claude Code Guide›What is Claude Code?
✦ Updated
Foundation

What is Claude Code?

Same AI model — three completely different environments. The model is identical. The environment changes everything about what's possible.

The 3 Tools
Why It Matters
The Mindset Shift
Claude.ai · Web Only
💬 Claude Chat
Your thinking partner. Ask questions, brainstorm, write, strategise. Responds with text — but doesn't act. Great for exploration and advice. Never touches your files or tools.
Terminal / IDE · This Guide
⚡ Claude Code
Your autonomous executor. Describe the outcome — Claude takes multi-step action: reads files, connects to apps, writes outputs, runs scheduled tasks. It delivers, not advises.
Desktop App · Non-Developers
🖥️ Claude Cowork
Desktop-only autonomous executor for non-coders. Reads files, connects to apps, runs scheduled tasks. No terminal needed. Lives in the Claude Desktop App.
🍽️
Analogy — The Restaurant
Claude Chat is your head chef on a consulting call — brilliant advice, but not in your kitchen. Claude Code is the sous chef who shows up at 6 AM, reads the menu you left on the counter, and has everything ready. Claude Cowork is the front-of-house manager — runs the restaurant without touching code.
ℹ️
Where does Claude Code live?
Install via npm install -g @anthropic-ai/claude-code · Run in terminal with claude · Requires Node.js 18+

📺 Learn By Watching

These two videos are the complete deep-dives this guide is built from.

Why Claude Code Changes Everything

Agentic Loop
Plans, acts, observes results, adjusts, and continues until the task is done — like a detective following leads through a case.
File System Access
Reads, writes, edits, and deletes real files on your machine. Every change is visible immediately in your editor.
Terminal Execution
Runs bash commands, installs packages, starts servers, runs tests. Your terminal — automated.
External Connections (MCP)
Connects to GitHub, Gmail, Slack, databases, browsers, and 3,000+ external tools via the MCP standard.
Persistent Memory
CLAUDE.md is your project brain. Every session inherits your rules, conventions, and context automatically.
Scheduled Autonomy
Via Cloud Routines — runs tasks on Anthropic's servers, even when your laptop is closed.

The Mindset Shift

Most people use Claude Code like a smarter autocomplete. The real shift is from prompting to delegating.

Old MindsetNew Mindset
"Write me this function""Build this feature end-to-end, with tests"
One prompt → one responseOne outcome → Claude plans multi-step execution
I review every change manuallyHooks and agents enforce quality automatically
I run the same tasks every morningCloud Routines run them before I wake up
Skills are prompts I retypeSkills are reusable processes I define once
Claude Code is a tool I useClaude Code is a system that works for me
⚡
The Core Insight
The difference between a tool you use and a system that works for you is whether it operates when you're not there. That's what this guide teaches you to build.
Foundation

Pricing & Plans

Claude Code is available on every plan. What changes is daily limits, model access, and automation capabilities.

Free
$0
per month
  • Basic Claude access
  • Limited daily messages
  • No sub-agents
  • No Cloud Routines
Pro ↑ Best Start
$20
per month
  • 5× more usage vs Free
  • Sonnet 4.6 + Haiku 4.5
  • Skills & Agents
  • 5 Cloud Routines/day
  • Desktop Tasks (Mac/Win)
Max
$100
per month
  • 5× Pro usage
  • Opus 4.8 access
  • Agent Teams
  • 15 Cloud Routines/day
  • Priority access
API / Console
Pay
per token
  • All models
  • No rate limits
  • Full programmatic
  • Best for power users
💡
Pro vs API — Which to choose?
Pro ($20/mo): Fixed cost, perfect for learning and daily use. Start here. API/Console: Pay per token — cheaper for high-usage power users. Switch when you outgrow Pro's limits.

Model Quick Reference

ModelBest ForSpeedCost
Haiku 4.5Sub-agents, routine tasks, logging⚡⚡⚡$
Sonnet 4.6Daily coding, features, code reviews⚡⚡$$
Opus 4.8Architecture, complex reasoning, Agent Teams⚡$$$
Foundation

Setup Guide

From zero to first working session — install, configure, and give Claude Code your project's context.

Installation
CLAUDE.md
The .claude Folder
1
Install Node.js 18+
Download from nodejs.org. Verify: node --version. This is required — Claude Code is an npm package.
2
Install Claude Code globally
npm install -g @anthropic-ai/claude-code

# Windows: if claude doesn't work, add npm global to PATH
npm config get prefix  # shows the path to add
3
Authenticate
claude  # Opens auth in your browser

# Or use API key directly:
export ANTHROPIC_API_KEY=your-key-here
4
Open in your project
cd my-project && claude
Claude Code reads your folder structure and starts a session. First session loads slightly slower due to indexing — subsequent sessions are faster.

CLAUDE.md is your project's brain. It loads automatically every session — giving Claude Code your project context, coding standards, and rules without re-explaining each time.

CLAUDE.md — Example
# My Project — Claude Code Context

## What This Is
Django REST API for a task management SaaS.
Backend: Django 4.2, PostgreSQL, Redis, Celery.

## Coding Standards
- Python: PEP 8, Black formatter, type hints required
- Never use bare `except:` — always catch specific exceptions
- All endpoints must have docstrings and tests
- Use `os.environ.get()` — never hardcode secrets

## Common Commands
- Start dev: `python manage.py runserver`
- Run tests: `pytest --cov=. --tb=short`
💡
Best Practices
Keep under 500 tokens — it loads every session. Repeatable workflows → Skills (on-demand). Personal preferences → CLAUDE.local.md (git-ignored). Extensive rules → rules/ folder that CLAUDE.md references.
.claude/
├── CLAUDE.md            ← Project brain (auto-loads every session)
├── settings.json        ← Permissions, hooks, env vars
├── settings.local.json  ← Personal overrides (git-ignored)
├── skills/              ← Custom automation playbooks
│   └── generate-report/
│       ├── SKILL.md
│       └── scripts/scan.py
├── agents/              ← Specialist sub-agents
│   └── code-reviewer.md
├── hooks/               ← Event-triggered local scripts
│   ├── auto_format.py
│   └── security_guard.py
├── logs/                ← Session activity logs
└── agent-memory/        ← Persistent agent knowledge
    └── code-reviewer/MEMORY.md
Core Features

Context Management

The context window is Claude Code's working memory. Manage it well and performance stays sharp. Ignore it and quality degrades — silently.

🖊️
Analogy — The Whiteboard
The context window is a whiteboard that fills up as you work. Fresh session = clean board, crisp thinking. Three hours in = covered in old notes and crossed-out ideas. /compact is filing the old notes into a folder — you summarise what mattered, clear the board, and keep working sharp. /clear is throwing the whiteboard away and starting fresh.

Context Rot Warning Signs

😵
Repetition
Claude re-asks questions it already answered, or contradicts earlier decisions it made 30 minutes ago.
🐢
Slower Responses
Noticeably longer pauses — Claude is processing a huge context on every single turn.
🌀
Drifting Quality
Earlier in the session Claude followed your CLAUDE.md standards. Now it's producing generic boilerplate code.

Key Commands

/compactSummarise context and clear the detail — keeps essentials, removes noise. Use when context is 70%+ full.
/compact [instruction]Custom compact: "Focus on the API layer. Forget the debugging detours." Guides what gets preserved.
/clearWipe full context. Use when the task is completely done and you're starting something new.
/contextShow token usage breakdown — how much context your tools, files, and conversation are consuming.
💡
The CHANGELOG.md Technique
At session start: ask Claude to read CHANGELOG.md. At session end: ask it to update CHANGELOG.md. This gives you session continuity without burning context on history — Claude reads the summary, not the full conversation.
Core Features

Skills System

Document a process once. Claude executes it on demand, forever. Skills are the most economically valuable feature in Claude Code.

🎼
Analogy — The Orchestra
The skill.md is the conductor. It doesn't play any instrument — it orchestrates. The musicians are your scripts (Python, bash). The conductor points and signals. You write the score once. Claude conducts it forever. You sit in the audience.
Skill Anatomy
Key Concepts
Skill vs Sub-Agent
.claude/skills/generate-report/SKILL.md
---
name: generate-report
description: >
  Generates a daily project status report. Use when asked to
  summarise the codebase, create a status update, or generate
  a report. Reads Python files in /src and writes to /reports/.
trigger: /generate-report
effort: low   # low | normal | high | max
---

# Goal
Generate a status report for: $ARGUMENTS[1] (default: src/)

# Steps
## Step 1: Scan
Run scripts/scan_codebase.py $ARGUMENTS[1]

## Step 2: Summarise
Compile per-file info: purpose, function count, TODOs

## Step 3: Write report
Create /reports/YYYY-MM-DD-status.md with all findings

## Step 4: Confirm
Print: files scanned, TODOs found, report path
$ARGUMENTS
/generate-report src/api passes "src/api" as $ARGUMENTS[1]. Makes any skill reusable across any path or input.
Numbered Steps
Step 3 cannot run before Step 2 completes. Execution order is guaranteed by the numbered structure.
Scripts Folder
Add scripts/ beside SKILL.md for pre-built Python/bash. Claude runs the script instead of generating code each time — consistent and reliable.
Effort Levels
low for formatters/reports · normal for feature work · high for security audits · max for architecture decisions.
Global Skills
~/.claude/skills/ — available in ALL projects. Share via git repo for team-wide automation.
Skill Creator Plugin
Describe a task in plain English → Claude writes the SKILL.md for you. Install: /plugin install skill-creator.
SkillSub-Agent
What is it?A playbook / checklistA separate Claude instance
Runs inSame session contextOwn isolated context window
MemoryShares parent contextFresh context + optional MEMORY.md
ToolsInherits parent toolsScoped explicitly (e.g. read-only)
ModelUses active modelCan use cheaper model (Haiku)
Best forRepeatable workflowsIsolated specialist tasks
Core Features

Hooks System

Event-driven scripts that fire automatically at lifecycle points. Zero LLM involvement. Zero tokens. Pure local execution.

🪝
Analogy — Assembly Line Quality Control
Cars move through stations on an assembly line. Quality control checks run automatically at each station — before paint, after engine install. These checks don't slow the line. They run in parallel. They happen whether the manager is watching or not. Hooks are your automatic quality control on Claude Code's assembly line.

Hook Events

EventWhen it firesCan block?Best for
PreToolUseBefore any tool executes✅ Exit 2Security guards, validation
PostToolUseAfter tool succeeds❌Auto-format, logging
NotificationClaude needs attention❌Desktop/Slack pings
StopClaude finishes responding❌"Done" notifications, final logs
PermissionDenied 2026Auto mode blocks actionReturn retry:trueIntelligent retry logic
SessionStartSession opens❌Logging, setup tasks

Exit Code System — Critical

Exit 0
Allow ✅
Action proceeds. Use for every hook that should let the action continue — formatters, loggers, notifications.
Exit 2
BLOCK 🛑
Action cancelled. Works even in bypass mode. The emergency brake. PreToolUse only. Your most powerful safety control.
Exit 1
Error (non-blocking)
Hook failed but Claude continues. Use when your hook script itself errors — don't stop Claude for a formatter not being installed.

Production Settings.json

.claude/settings.json — Four Essential Hooks
{
  "hooks": {
    // 1. Security guard — blocks dangerous bash commands
    "PreToolUse": [{ "matcher": "Bash", "hooks": [{
      "type": "command",
      "command": "python .claude/hooks/security_guard.py",
      "timeout": 10 }] }],
    // 2. Auto-format — formats after every file write/edit
    "PostToolUse": [{ "matcher": "Write|Edit", "hooks": [{
      "type": "command",
      "command": "python .claude/hooks/auto_format.py" }] }],
    // 3. Notification — pings you when Claude needs input
    "Notification": [{ "hooks": [{
      "type": "command",
      "command": "python .claude/hooks/notify.py",
      "async": true }] }],
    // 4. Session logger — logs everything silently in background
    "Stop": [{ "hooks": [{
      "type": "command",
      "command": "python .claude/hooks/session_logger.py",
      "async": true }] }]
  }
}
Core Features

MCP Connectors

Model Context Protocol — Anthropic's open standard connecting Claude Code to the outside world. GitHub, Gmail, databases, browsers, and 3,000+ tools.

🔌
Analogy — USB-C
Before USB-C, every device had a different cable — constant friction. Then one universal standard replaced them all. MCP is USB-C for AI agents. One protocol. Connect Claude Code to GitHub, Slack, Notion, PostgreSQL, Playwright, Tavily — all with the same configuration standard.
Local vs Hosted
Configuration
Must-Have Servers
stdio transport
🖥️ Local MCP Server
Runs on your machine. Launched with npx or uvx. Examples: Playwright (browser automation), Filesystem MCP. Install once, runs locally.
HTTP/SSE transport
☁️ Hosted MCP Server
Runs on their servers. Connect via URL + API key. Examples: Tavily Search, hosted GitHub. Nothing to install. The future of MCP.
⚠️
Token Cost + Tool Search Fix
One large MCP server loads ~19,000 tokens at startup. Tool Search (2026) fixes this: only tool names load at startup, full definitions load on-demand. 95% reduction in MCP overhead. Enabled by default in Claude Code 2026.
.mcp.json — Complete Example
{
  "mcpServers": {
    // Local stdio server (Node.js)
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_..." }
    },
    // Local stdio server (Python)
    "playwright": {
      "command": "uvx",
      "args": ["mcp-playwright"]
    },
    // Hosted remote server (HTTP)
    "tavily": {
      "type": "http",
      "url": "https://mcp.tavily.com/mcp/?apikey=tvly-..."
    }
  }
}
🪟
Windows Users — Critical Fix
Replace "command": "npx" with "command": "cmd" and add ["/c", "npx", "-y", ...] as args. Without the cmd /c wrapper, ALL local MCP servers fail with "Connection closed" on Windows.
🐙
GitHub MCP
Read/create issues, review PRs, search code, check CI status — all in natural language.
claude mcp add github --env GITHUB_PERSONAL_ACCESS_TOKEN=ghp_... -- npx -y @modelcontextprotocol/server-github
🎭
Playwright MCP
Browser automation — navigate pages, fill forms, scrape data, take screenshots. Any website, no API needed.
claude mcp add playwright -- npx -y @playwright/mcp
🔍
Tavily Search (Hosted)
Real-time web search with current information. Hosted — no install required. Just API key + URL.
claude mcp add tavily --transport http --url "https://mcp.tavily.com/mcp/?apikey=tvly-..."
Specialist System

Sub-Agents

Separate Claude instances with isolated context, scoped tools, custom models, and defined permissions. Skills are playbooks. Sub-agents are specialists.

🏥
Analogy — Hospital Ward
The head doctor coordinates — but doesn't draw blood, run labs, read scans, AND prescribe simultaneously. Each specialist has a narrow job. Each has only the equipment they need. Sub-agents are your specialists. The main Claude Code session is the head doctor. Specialists do focused, isolated work and report back.

Five Key Properties

Isolated Context
Fresh context window. Doesn't see your conversation history. Clean thinking = sharp specialist output.
Scoped Tools
Only the tools you allow. Code-reviewer: Read-only only. Can't accidentally delete files while reviewing.
Custom Model
Run routine specialists on Haiku (cheap). Reserve Sonnet/Opus for complex reasoning only.
Persistent Memory
memory: project gives the agent its own MEMORY.md — accumulates knowledge about your codebase across sessions.
Independent Permissions
Set separately from the parent — not inherited. Agent permission level defined explicitly in frontmatter.
@-mention Invocation Apr 2026
Type @ to pick from typeahead. Guarantees that specific agent runs — no routing ambiguity.

Agent File Anatomy

.claude/agents/code-reviewer.md
---
name: code-reviewer
description: >
  Reviews code for quality, security vulnerabilities, and best practices.
  Use proactively before commits or PRs. Checks OWASP Top 10, N+1
  queries, and naming conventions. Best for Python, JS, TypeScript.
tools: Read, Grep, Glob, Bash
disallowedTools: Write, Edit
model: claude-haiku-4-5
memory: project
color: blue
---

You are a senior engineer specialising in code quality and security.
You have read-only access — you analyse and report, never modify.

For every review, check in order:
1. Security: SQL injection, hardcoded secrets, auth gaps
2. Performance: N+1 queries, blocking operations
3. Code quality: missing error handling, function length, naming
4. Output: Prioritised findings with severity + specific fix for each

Three Must-Have Agents

🔍
code-reviewer Haiku · Read-only
Reviews for OWASP Top 10, N+1 patterns, naming conventions. Builds memory of your codebase across sessions.
@code-reviewer look at auth.py before I commit
🗺️
repo-explorer Haiku · Read-only
Orients you in unfamiliar codebases in 30 seconds. Tech stack, entry points, architecture, how to run.
@repo-explorer give me an orientation of this project
🧪
qa-tester Sonnet · Write access
Audits for untested functions, writes pytest/Jest tests (happy path + edge cases + errors), runs them, reports.
@qa-tester generate comprehensive tests for payment.py and run them
📊
The Probability Math — Keep Tasks Simple
If each agent has 95% success rate: 3 parallel agents = 85.7% all succeed. 10 parallel = 59.9%. Keep parallel agent tasks narrow and outputs small. Save complex synthesis for the main session.
Specialist System

Agent Teams

Multiple Claude Code instances with a shared task list and peer messaging — working in parallel on the same codebase. Experimental

🏗️
The C Compiler Story
Anthropic gave 16 parallel Claude agents one task: write a complete C compiler in Rust capable of building the Linux kernel. Nearly 2,000 sessions over two weeks. 100,000 lines of code. Compiles Linux on x86, ARM, and RISC-V. Runs Doom. Total cost: ~$20,000 — a fraction of what a human team would charge.

Sub-Agents vs Agent Teams

Sub-AgentsAgent Teams
TopologyStar — everything through parentMesh — teammates talk directly
Peer messaging❌ Cannot✅ Direct mid-task messaging
Task distributionParent assigns manuallyShared task list — agents self-claim
File isolationSame directoryGit worktrees — separate branches
Cost~1× baseline~7× baseline
StabilityProduction-readyExperimental — known bugs

Enable & Use

# Requires: git repo + Opus 4.6+ model
# settings.json:
{ "env": { "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" } }

# Then in Claude Code — one prompt:
Create an agent team to refactor this codebase:
- Teammate 1: Fix SQL injection issues in /api
- Teammate 2: Write tests (wait for T1's API contract first)
- Teammate 3: Update documentation (can start immediately)

Three Tiers of Parallelism

T1
Single Session + Sub-Agents
Baseline cost. Sequential work with specialist agents. Use for daily development and focused tasks.
T2
Manual Parallel Sessions (Worktrees)
~3× cost. Multiple independent sessions via claude --worktree name. No shared task list — you coordinate.
T3
Agent Teams (Experimental)
~7× cost. Shared task list + peer messaging + git worktrees. Use when specialists genuinely need to coordinate mid-task.
Specialist System

Plugins & Marketplace

Bundle skills, agents, hooks, and MCP servers into one installable unit. Install community power-ups. Share your full Claude Code setup with your team in one command.

🧩
Analogy — The App Store
Before app stores, sharing software meant emailing files. Plugins are the App Store for Claude Code. One command to install. Versioned. The official marketplace is App Store with App Review. Community marketplaces are sideloading — useful but always read source before installing.

5 Must-Install Plugins

📚
Context7
Fetches current API docs from any library and injects them token-efficiently. Eliminates hallucinated API signatures entirely.
/plugin install context7@claude-plugins-official
🔎
Code Review
5 parallel Sonnet agents: CLAUDE.md compliance, bug detection, historical context, PR history, comments. Confidence-scored.
/plugin install code-review@claude-plugins-official → /code-review
🎨
Frontend Design
Auto-activates for frontend work. Guides towards bolder typography, better spacing, intentional visual hierarchy.
/plugin install frontend-design@claude-plugins-official
📝
Claude MD Management
Audit CLAUDE.md quality, capture session learnings, suggest improvements. Keeps your project brain current automatically.
/plugin install claude-md-management@claude-plugins-official → /claude-md-management:audit
🪝
Hookify
Create hooks in plain English. "Block any npm install — only yarn in this project." Claude generates the hook config.
/plugin install hookify@claude-plugins-official → /hookify
🚨
The #1 Plugin Mistake
Only plugin.json lives inside .claude-plugin/. Everything else — skills/, agents/, hooks/ — goes at the plugin root. Putting them inside .claude-plugin/ silently breaks the entire plugin.
Automation

Scheduling & Automation Loops

Claude Code that works while you sleep. Three scheduling tiers — from session-scoped polling to cloud-hosted routines that run when your laptop is closed.

⚡
Cron Jobs With Judgment
A cron job runs a script. When it fails — silent exit code. Claude Code scheduled tasks run an agent. When it hits an error, it reasons through it, tries alternatives, and documents what happened. You wake up to a diagnosed problem — not a silent exit code.

Three Scheduling Tiers

1
/loop Command Any Plan · v2.1.72+
Session-scoped. Dies when you close terminal. Perfect for deployment watching, build monitoring, and in-session polling.
2
Desktop Scheduled Tasks Pro+ · Mac/Win only
Persistent on your machine. Survives restarts. 7-day catch-up for missed runs. For daily automations while you work.
3
Cloud Routines April 14, 2026 · Pro+
Runs on Anthropic's infrastructure. Laptop can be closed. Three triggers: schedule / API POST / GitHub event. Pro: 5/day. Max: 15/day.

/loop Syntax

# Basic interval
/loop 5m check if the deployment finished

# Cron expression (more precise)
/loop 0 9 * * 1-5 run the morning standup skill

# Loop a skill
/loop 10m /fetch-api-data

# Adaptive — Claude chooses the interval dynamically
/loop watch the build status and report when it changes

# Job management
cron list                # see all jobs + IDs
cron delete job_a3f2     # cancel specific job

# Emergency brake — stops ALL scheduled tasks
export CLAUDE_CODE_DISABLE_CRON=1

Headless Mode (The Engine Behind Everything)

# Run without interactive session — for cron, GitHub Actions, pipelines
claude -p "analyse error logs and write summary to /reports/"

# With tool restrictions (safer)
claude -p "generate daily report" --allowedTools "Read,Bash,Glob"

# System cron (Linux — ALWAYS source .env for the API key)
0 9 * * 1-5 bash -c 'source ~/.env && cd /project && claude -p "/standup" >> /log/daily.log 2>&1'
Advanced · 2026

New 2026 Features

Anthropic shipped 74 releases in Q1 2026 alone. These six fundamentally change what Claude Code is.

🤖
Auto Mode
March 2026
Anthropic's middle ground between manual approval and --dangerously-skip-permissions. An AI safety classifier runs in the background: safe actions proceed automatically, risky ones pause. Users already approve 93% of prompts manually — Auto Mode eliminates that busywork while keeping guardrails on the 7% that matter. Enable: CLAUDE_CODE_ENABLE_AUTO_MODE=1
📡
Dispatch & Remote Control
Q1 2026
Dispatch triggers Claude Code sessions from your phone, another machine, or any HTTP client. Remote Control runs Claude Code as a headless server process — controlled via REST API or WebSocket. Together: Claude Code becomes a viable headless automation backend. One orchestrator can dispatch tasks to multiple instances running in parallel.
📺
Channels
Q1 2026
Real-time communication between Claude Code instances or between Claude Code and human operators via API. Instead of polling for build status every 5 minutes — your CI pushes the failure directly into the session via a Channel. Results delivered to Telegram or Slack without you checking. Solves multi-agent coordination when agents need to share findings live.
🖥️
Computer Use (Improved)
Q1 2026
Claude Code can now control your screen — click buttons, navigate GUIs, interact with legacy desktop apps with no API. Q1 2026 cut latency in half and dramatically improved recovery from unexpected UI states. If you can see it on screen, Claude can interact with it. Requires explicit permission — not for sensitive data environments.
☁️
Cloud Routines
April 14, 2026
Schedule Claude Code on Anthropic's infrastructure. Laptop completely off — routine still runs. Three trigger types: time-based (cron), API POST (from any system), GitHub events (PR, push, CI failure). Credentials stored in Anthropic's secure vault. Connect GitHub/GitLab — Claude clones at runtime, works, pushes commits back. Pro: 5 runs/day. Max: 15/day.
💬
/btw Command
2026
Ask a side question while Claude is working on a long task — without interrupting it and without adding to context. /btw what does this function return? runs in a fresh context, gets answered instantly, main task continues unaffected. Available even while Claude is processing a response. Single response only — no follow-ups.
Playbooks

Industry Playbooks

Real-world use cases across six industries. Click a sector to see specific workflows, skills, and prompts that work today.

📣
Marketing
Content, campaigns, SEO
💹
Finance
Analysis, reports, compliance
⚙️
Operations
Workflows, automation, SLAs
👥
HR & People
Recruiting, onboarding, policy
👷
Engineering
Code review, CI/CD, tests
📊
Data & Analytics
Pipelines, reports, anomalies

📣 Marketing Playbook

✍️
Content Production at Scale
An automated loop that researches hot sector trends using Tavily MCP, evaluates keyword semantic spacing against competitive sites via the Browser tool, builds optimized content layouts matching the company brand guide, and schedules publication entries directly to your local workspace CMS.
/loop every Monday 8am → /blog-post on this week's content calendar topics using Tavily search to fetch the top 5 high-ranking industry competitors, extract their main header configurations, and compile draft markdown templates in /content/drafts/ tracking targeted primary keywords.
📊
Campaign Performance Brief
Automated Cloud Routine running natively on Anthropic servers. It programmatically accesses marketing analytics repositories, computes cross-weekly cost-per-acquisition (CPA) standard deviations, maps channel performance drifts, and auto-posts a critical multi-channel optimization overview directly to specific operational paths.
Cloud Routine: 0 8 * * 1-5 → Execute unified channel script across performance data in /analytics/raw/, identify underperforming segments showing CPA increases > 15%, structure a clear executive briefing file in /reports/weekly-brief.md, and pipe the output to Slack connector #marketing-alerts.
🎯
Competitor Monitoring
An isolated, read-only custom sub-agent configured to spin up headless browser instances via Playwright MCP. It scrapes competitor conversion layers, catalogs modifications across pricing endpoints, creates deep visual and structural structural diff matrices, and writes alerts on strategic index shifts.
@market-watcher Scan competitor pricing configurations at target endpoints, map elements to structural layout files inside /competitors/pricing/, calculate itemized value delta differences against our price index, and structure an alert detailing any promotional tier variations.

💹 Finance Playbook

📋
Automated MIS Report
An automated monthly routine pulling raw ledger transactions via secure SQL connectors, sorting asset categories, compiling rolling balance metrics, computing structural cashflow variances, and producing localized executive financial summaries completely hands-free.
Cloud Routine: 0 8 1 * * → Read transaction ledgers via secure filesystem access, evaluate month-end asset changes, flag variance margins exceeding structural tolerance parameters, and output a complete P&L ledger narrative directly into /finance/reporting/monthly/.
🔍
Audit Trail & Compliance
A localized local validation hook tracking internal command execution layers. It systematically enforces data guard rails across production targets, halts unconstrained index adjustments, logs query profiles, and provides strict data state compliance.
PreToolUse hook tracking local operations: Match database engine calls, block unindexed update operations lacking transactional boundaries or filters, record command footprints, and immediately reject operations violating company security schemas via exit code 2.
📈
Investment Research Brief
A parameterised research playbook that reads specified company listings, gathers SEC filing metrics via live web hooks, analyzes risk declarations, reconciles financial ratios, and aggregates investment briefs into a clean markdown structure.
/research-brief ticker=$ARGUMENTS[1] → Fetch current SEC index profiles, parse liability indicators from the latest 10-K statement, perform multi-quarter balance reconciliations, and generate a structural risk/opportunity evaluation brief inside /investment/briefs/.

⚙️ Operations Playbook

🔔
Incident Response Autopilot
A high-frequency terminal monitoring loop tracking operational health indicators. It interprets production anomalies, automatically triggers system recovery triage sequences, builds context logs, files incident tracking sheets, and orchestrates team routing workflows.
/loop 2m scan raw production logs in /var/log/app.log for system warnings. If exception counts exceed 25 errors per minute: create an incident log in /incidents/, trace root execution pathways, open a tracking card via GitHub MCP, and broadcast status pages via Slack.
📦
Vendor SLA Monitoring
Daily script sequence parsing external system uptime matrices and provider performance markers. It systematically audits platform latency indicators against structural SLA agreements, logs breaches, and builds monthly reconciliation compliance cards.
Cloud Routine: daily at 11pm → Parse operational provider telemetry charts inside /logs/telemetry/, compute average multi-region latency deviations, cross-reference SLA error margins, and append non-compliance reports to vendor registry logs.
🔄
Process Documentation
A documentation alignment skill that scans system architecture configurations, evaluates procedural layouts against active runtime directories, uncovers structural gaps, and generates up-to-date deployment playbooks.
/update-runbook target_dir=$ARGUMENTS[1] → Audit directory layout configurations against functional runtime paths, index procedural gaps between active configurations and master layout files, and rewrite production operational manuals inside /docs/runbooks/.

👥 HR & People Playbook

📝
Job Description Generator
An organizational design skill that references cross-functional requirement parameters, audits current market talent indexes across targeted skill paths via Tavily MCP, normalizes compensation markers, and structures compliant, bias-free job descriptions.
/create-jd requirements=$ARGUMENTS[1] → Query industry baseline configurations via web fetch tools, compile core competency matrix templates, screen layout configurations for non-inclusive language constructs, and build structured candidate tracking parameters in /hr/requisitions/.
🎓
Onboarding Automation
A workflow routine listening for directory adjustments indicating successful team placement updates. It provisions modular onboarding roadmaps, configures task checksheets, structures resource guides, and dispatches automated system greetings.
GitHub event: repository teammate added → Create user profile path inside /team/onboarding/, populate modular task files customized by engineering focus lines, assign starter tracking issues via project interface tools, and post greetings to communication pipelines.
📊
Pulse Survey Analysis
An analytical parsing skill reading operational pulse tracking formats. It completes multi-layer semantic extraction passes, categorizes baseline friction trends across teams, processes data matrices safely, and provides granular action points for managers.
/analyse-survey data_source=/hr/surveys/latest.csv → Run multi-layer semantic grouping maps across sentiment rows, isolate critical systemic friction pathways by department boundaries without referencing personal data points, and generate an executive operational summary in /hr/insights/.

👷 Engineering Playbook

🔍
Automated PR Review Pipeline
An automated code evaluation cycle triggered directly by code management lifecycles. It utilizes specialized, isolated sub-agents to trace structural changes, identify algorithmic regressions, screen formatting frameworks, check validation compliance, and return annotations directly to development branches.
GitHub PR event opened → Activate isolated @code-reviewer sub-agent, run automated line audits across diff files tracking performance loops and missing exception handlers, score layout variations against style templates, and return code annotations directly to pull request threads.
🧪
Test Coverage Guardian
A recurring quality execution process running automated testing frameworks. It measures execution pathways across directories, calculates coverage margins, isolates untested function blocks, aggregates tracking checklists, and flags code safety drifts.
Weekly Routine: run test frameworks across system paths, isolate execution boundaries displaying coverage ratios under 85%, track newly added lines lacking testing fixtures, map defect regressions, and compile tracking issues via GitHub MCP connectors.
🏗️
Architecture Review Agent
A comprehensive pre-implementation layout checking suite. It traces component dependancy graphs across system components, uncovers architectural style drifts, models impact metrics of changes, and compiles validation assessments against core configuration rules.
@repo-explorer + @plan + @code-reviewer → Execute cross-component dependency scans across codebase directories, identify architectural boundary drifts against patterns defined in CLAUDE.md, map file layout adjustments, and generate technical implementation risk profiles in /docs/architecture/.

📊 Data & Analytics Playbook

🔄
Daily ETL Pipeline
A cloud routine managing continuous data ingestion workflows. It parses input datasets across distributed data channels, executes pipeline validations tracking structural null drifts and transactional data anomalies, performs required schema matching, and compiles pipeline health charts.
Cloud Routine: 0 5 * * * → Execute master ingest script across remote pipeline paths, run pipeline validation functions tracking type violations and schema mismatches, output transformed records to warehouse endpoints, and write automated pipeline health logs to /etl/logs/.
📉
Anomaly Detection Loop
A high-frequency analysis loop checking streaming analytics layers. It runs mathematical outlier validation patterns over current transaction arrays, monitors threshold triggers, isolates execution anomalies, builds log traces, and alerts support paths.
/loop */15 * 9-18 * 1-5 Parse transaction volumes in real-time database targets, execute anomaly checks to isolate statistical variance flags exceeding 3 standard deviations from baseline averages, generate diagnostics to /telemetry/, and drop alerts to Slack connector.
📋
Executive Dashboard Narrative
An analytical summarization routine reading raw performance indicators across business data matrix layouts. It evaluates performance margins against enterprise goals, calculates trend trajectories, and structures plain-language summaries detailing operational variances.
Monday 7am → Pull historical performance data indicators across database configurations, compute weekly rolling trajectory vectors, compare current markers against baseline performance targets, and generate an operational data narrative inside /reports/executive/.
Playbooks

Quick Reference

Slash commands, power prompts, and troubleshooting — everything you need in one place.

Slash Commands
Power Prompts
Troubleshooting
Session & Context
/compactSummarise and compress context — keeps essentials, removes noise
/compact [focus]Custom: "Focus on the API layer. Forget the debugging detours."
/clearWipe full context and start fresh
/contextShow token usage — tools, files, conversation breakdown
/resumeResume previous session with its scheduled task history
/btw [question]Side question without affecting main context 2026
Tools & Extensions
/mcpConnected MCP servers, status, OAuth authentication
/agentsList all sub-agents — built-in, project, user, plugin
/hooksShow configured hooks grouped by event type
/pluginPlugin manager — install, uninstall, browse marketplace
/reload-pluginsHot-reload all plugins without restarting Claude Code
Scheduling
/loop [interval] [prompt]Schedule repeating task in current session
cron listShow all scheduled jobs with IDs and expiry dates
cron delete [job_id]Cancel a specific scheduled job by ID
Permission Modes (Shift+Tab to cycle)
StandardAsk before all sensitive operations — the safe default
Auto / Accept EditsAuto-accept file edits, ask for bash and destructive actions
BypassFull autonomy — no prompts. Use hooks as your safety net.
Project Orientation
Give me a full orientation of this codebase: architecture, tech stack, entry points, how to run it, and the 3 most important things to understand before making changes.
Read CLAUDE.md and the last 10 commits. What was the team working on? What's the current state? What should I tackle first?
Code Quality
Review [file.py] for: SQL injection, hardcoded secrets, N+1 queries, missing error handling, and violations of our CLAUDE.md standards. Prioritise by severity (Critical/High/Medium/Low).
Look at git diff --staged. Write a professional PR description with: title (≤72 chars), what changed and why, testing instructions, any breaking changes.
Automation Setup
Create a skill called [name] that [describe process step-by-step]. Save to .claude/skills/[name]/SKILL.md and write any helper scripts needed in the scripts/ subfolder.
Create a PreToolUse hook that blocks any bash command matching [dangerous pattern]. Use exit code 2 to block. Save to .claude/hooks/ and update settings.json automatically.
/loop 0 9 * * 1-5 Read git log --since="24 hours ago". Write a standup to /reports/standup-today.md. Post a 50-word summary to Slack #dev via MCP.
ProblemLikely CauseFix
MCP "Connection closed" on WindowsMissing cmd /c wrapper"command":"cmd","args":["/c","npx",...]
MCP server shows disconnectedForgot to restart after config changeFully exit (/exit) and reopen Claude Code
Hook doesn't block anythingUsing exit 1 instead of exit 2Change to sys.exit(2) for blocking behaviour
Skill not appearing in / typeaheadWrong location or no restartCheck .claude/skills/name/SKILL.md — restart
Agent routing to wrong agentVague description fieldRewrite description with explicit trigger conditions
Context rot / quality degradingContext window 70%+ fullRun /compact "focus on [what matters]"
/loop task not firingClaude busy or new sessionUse claude --resume to restore; check cron list
Headless cron fails silentlyANTHROPIC_API_KEY missing in cron envAdd source ~/.env && before claude -p in cron
Plugin silently brokenComponents in wrong folderMove skills/agents/hooks to plugin ROOT, not inside .claude-plugin/
Agent Teams not workingNot on Opus / no git repoSet Opus 4.6+ model, run git init && git commit --allow-empty