JOIN THE COMMUNITY
guides

Meet Your AI Co-Worker: Claude Code in 6 Building Blocks

Claude Code stops feeling like a chatbot the moment you understand its 6 building blocks: CLAUDE.md, Skills, Hooks, Subagents, Routines, and Slash Commands. Here's the 2026 guide that finally makes them click.

Professor Glitch
Professor Glitch
11 min
Meet Your AI Co-Worker: Claude Code in 6 Building Blocks

Most people use Claude Code like a fancy autocomplete. They type a prompt, watch it edit a file, and move on.

That's like buying a Tesla and only using it to listen to the radio.

Claude Code is an agentic coding tool (Anthropic's words, not mine). It reads your codebase, edits files, runs commands, and integrates with your dev tools across your terminal, IDE, desktop, and browser. The thing that flips it from "autocomplete with a prompt box" into "an actual co-worker who knows your project" is six small features most people never touch.

This is a 60-second carousel I shipped on TikTok and Instagram, expanded into the full guide. By the end you'll know what each piece is, where it lives, when to reach for it, and what the 2026 versions actually look like (not the 2024 articles you'll find on page one of Google).

Let's go.


The mental model first

Before the six building blocks, the one idea that makes them click.

Every Claude Code session starts with a fresh context window. Nothing remembers anything. The six features below are different ways to carry knowledge across that gap: by writing it down once (CLAUDE.md, Skills), wiring it to a trigger (Hooks, Routines), spawning a fresh worker (Subagents), or with keystroke shortcuts that pull a saved playbook in on demand (Slash Commands).

Keep that frame in your head and you'll know which one to reach for every time.


1. Identity: CLAUDE.md

"CLAUDE.md files are markdown files that give Claude persistent instructions for a project, your personal workflow, or your entire organization. You write these files in plain text; Claude reads them at the start of every session."Anthropic docs

This is the file that teaches Claude your project. Stack, conventions, rules, what's off-limits. Drop it at the root of any repo as CLAUDE.md (or ./.claude/CLAUDE.md), and Claude auto-loads it every conversation.

The simplest one I use:

# Project context

- Stack: Next.js 15, Postgres, Vercel
- Tests: Vitest. Run `npm test` before any commit.
- TypeScript strict mode, no `any`.
- No `console.log` in prod code.
- API handlers live in `src/api/handlers/`.
- Never write to `migrations/` without asking.

That's it. Six lines, no ceremony. Every session starts knowing what stack you're on.

Where you can put it

There's a hierarchy. More specific locations win.

Scope Location Use case
Managed policy /Library/Application Support/ClaudeCode/CLAUDE.md (mac) Org-wide standards your IT team can't let you turn off
Project ./CLAUDE.md or ./.claude/CLAUDE.md Team-shared, checked into git
User ~/.claude/CLAUDE.md Your personal preferences across every project
Local ./CLAUDE.local.md (gitignored) Your private project notes (sandbox URLs, test data)

Run /init and Claude analyzes your codebase and writes a starting CLAUDE.md for you. If one already exists, it suggests improvements instead of overwriting.

When to add to it

Anthropic's official rule of thumb is the cleanest version of this I've seen: add to CLAUDE.md when Claude makes the same mistake twice. If you're correcting the same thing into chat session after session, it belongs in CLAUDE.md. If a code review catches something Claude should have known about your codebase, it belongs in CLAUDE.md. If a new teammate would need that context to be productive, it belongs in CLAUDE.md.

Keep it under 200 lines. Longer files reduce adherence (Anthropic literally tells you this in their own docs). If your instructions are growing, split them into .claude/rules/ with paths: frontmatter so they only load when Claude touches matching files.


2. Capabilities: Skills

"Skills extend what Claude can do. Create a SKILL.md file with instructions, and Claude adds it to its toolkit. Claude uses skills when relevant, or you can invoke one directly with /skill-name."Anthropic docs

Skills are step-by-step playbooks the agent auto-loads when your task matches the trigger. Where CLAUDE.md says "this is what's true about my project," a skill says "when someone asks me to do X, here's the recipe."

Live at .claude/skills/<skill-name>/SKILL.md. Format is a YAML frontmatter block + markdown body:

---
description: Summarizes uncommitted changes and flags anything risky. Use when the user asks what changed, wants a commit message, or asks to review their diff.
---

## Current changes

!`git diff HEAD`

## Instructions

Summarize the changes above in two or three bullet points,
then list any risks: missing error handling, hardcoded values,
tests that need updating.

Two things to notice:

  1. The description is what Claude reads to decide when to fire this skill. Write it like you're writing a tooltip for yourself. Front-load the trigger words.
  2. The !`git diff HEAD` line is dynamic context injection. Claude Code runs the command first and pastes the output into the skill before Claude sees it. Your skill gets the actual diff, not the words "git diff HEAD." This single feature is what separates skills from "instructions you paste into chat."

Skill or CLAUDE.md, when to use which

The split that's served me best:

Skills only load into context when invoked. CLAUDE.md loads every session. So if it's a multi-step procedure, especially one with side effects, it belongs in a skill. Your context window will thank you.

Recent change worth flagging: in 2026 Anthropic merged custom slash commands into skills. Files in .claude/commands/ still work, but the recommended path is now .claude/skills/<name>/SKILL.md. They're the same thing under the hood.


3. Automation: Hooks

"Hooks are user-defined shell commands, HTTP endpoints, or LLM prompts that execute automatically at specific points in Claude Code's lifecycle."Anthropic docs

Hooks are the part of Claude Code that runs scripts before or after Claude uses any tool. Logs. Guards. Status writers. Auto-formatters. Anything that should happen deterministically, not because Claude felt like it.

Configured in .claude/settings.json:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "if": "Bash(rm *)",
            "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/block-rm.sh"
          }
        ]
      }
    ]
  }
}

That hook fires every time Claude tries to run a Bash command starting with rm, runs your script, and lets the script vote yes/no on whether the action goes through. It's the line of defense between "Claude is helpful" and "Claude rm -rf'd my repo because I told it to clean things up."

The lifecycle events you actually use

There's a long list (the full reference is here), but five hooks cover 90% of real-world setups:

The CLAUDE.md vs Hooks distinction Anthropic makes in their own docs is the one to remember: CLAUDE.md is advisory, Hooks are mandatory. If an instruction must run (security checks, formatters, lint), it goes in a hook. If it's behavioral guidance Claude should generally follow, it goes in CLAUDE.md.


4. Delegation: Subagents

"Subagents are specialized AI assistants that handle specific types of tasks. Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions."Anthropic docs

A subagent is a helper Claude spawns for one specific job. It runs in its own fresh context (your main thread stays clean) and returns only the summary.

Example: you ask Claude "find every place we call the Stripe API." Without subagents, your main thread fills up with grep output, file paths, and irrelevant snippets. With subagents, Claude spawns an Explore subagent, that subagent burns its own context window doing the search, and your main thread gets back a one-paragraph summary plus the file list. You keep working.

Defined in .claude/agents/<name>.md. Same shape as a skill, YAML frontmatter + markdown:

---
name: code-reviewer
description: Reviews recent changes for bugs, security issues, and stylistic problems. Use when the user asks for a review or before merging.
tools: Read, Grep, Glob, Bash
---

You are a senior code reviewer for a Next.js + Postgres codebase.
Focus on: SQL injection, missing input validation, leaked secrets,
N+1 queries, and missing error handling. Be terse.
Lead with the highest-severity issue.

The four built-in subagents you get for free are worth knowing by name:

When to delegate

The two questions Anthropic suggests asking yourself:

  1. Will the side task produce a wall of output you won't reference again? (logs, search results, file dumps) → subagent
  2. Are you spawning the same kind of worker repeatedly with the same instructions? → custom subagent

Subagents save context, enforce constraints (you can limit which tools they're allowed to use), and let you route cheap work to faster, cheaper models like Haiku. Don't sleep on that last one.


5. Recurrence: Routines

"A routine is a saved Claude Code configuration: a prompt, one or more repositories, and a set of connectors, packaged once and run automatically. Routines execute on Anthropic-managed cloud infrastructure, so they keep working when your laptop is closed."Anthropic docs

This is the one that flips Claude Code from a tool into a teammate. Cron-driven agents that run without you asking.

Three trigger types, mix and match on the same routine:

You can create one from the CLI without leaving your terminal:

/schedule daily PR review at 9am

/schedule in 2 weeks, open a cleanup PR that removes the auth-v1 feature flag

Or visually at claude.ai/code/routines.

The use cases that have hooked me, ordered by ROI:

  1. Backlog triage: runs every weeknight, applies labels, assigns owners, posts a Slack summary
  2. Alert auto-fix: Sentry posts to the routine's API, Claude opens a draft PR with a proposed fix and a link back to the alert
  3. Bespoke PR review: runs on every pull_request.opened, leaves inline comments using your team's checklist
  4. One-off cleanups: "in 2 weeks, open a PR removing the feature flag" ships the cleanup PR while you've forgotten the flag exists

There's a separate but related thing called Desktop scheduled tasks. Routines run in Anthropic's cloud (laptop-closed-friendly). Desktop scheduled tasks run on your machine (have access to your local files). Pick based on whether the work needs your local environment or not.


6. Shortcuts: Slash Commands

"For built-in commands like /help and /compact, and bundled skills like /debug and /simplify, see the commands reference. Custom commands have been merged into skills."Anthropic docs

One-keystroke workflows. Type / and your whole playbook lives there. Built-ins like /init, /review, /security-review, /compact, /clear, /model, /loop, /schedule, plus every skill you've defined.

In 2026 the line between "slash command" and "skill" blurred (Anthropic merged them). A skill at .claude/skills/deploy/SKILL.md and a command at .claude/commands/deploy.md both create /deploy and behave identically. Skills are now the recommended shape because they support supporting files, frontmatter controls, and dynamic context.

The five built-in slash commands every Claude Code user should know cold:

Pair /loop 5m /security-review for a paranoid security check that runs every five minutes during a sensitive deploy. Stuff like that is why slash commands matter. They make multi-step workflows one keystroke away.


How they actually fit together

Drawn out, the six pieces stack like this:

Layer What it carries Loaded when
CLAUDE.md Persistent project facts Every session
Skills Procedures, recipes, playbooks When invoked or when description matches
Hooks Deterministic guardrails Around every tool call you configured
Subagents Isolated workers for big side-tasks When the lead delegates
Routines Cron / API / GitHub-triggered runs Without you opening Claude at all
Slash Commands Keystroke entry points When you type /

In a real session, you'll touch four or five of them in the same hour. CLAUDE.md gives Claude the project shape. You ask it to ship a feature. Claude spawns an Explore subagent to map the codebase, writes the change, a PostToolUse hook auto-formats your code, you type /review to invoke the review skill, and tomorrow morning your nightly routine triages the issues that came in overnight.

That's the difference between "Claude wrote some code" and "Claude is on the team."

A team of specialized agents (Atlas, Nova, Professor Glitch, Quill, Rack) coordinating from a single Control Room. Each one is its own Claude Code agent with its own CLAUDE.md, skills, and routines.


What to actually do next

If you're new to Claude Code:

  1. Install it: curl -fsSL https://claude.ai/install.sh | bash (or brew install --cask claude-code)
  2. cd into any project, run claude, and type /init
  3. Open the generated CLAUDE.md and tighten it. Strip generic stuff, add the 5 things you correct Claude on most.
  4. Pick one repetitive task you do every week and turn it into a skill
  5. Pick one thing you wish ran without you and turn it into a routine

Don't try to set up all six on day one. The point of the six building blocks isn't to use all of them. It's to know which one to reach for when a specific friction shows up.


Want a real AI workforce, not just Claude Code?

Claude Code is one employee. A great one. A real workforce (the kind I run on my own machine) has multiple specialized AI employees: a content strategist, a DevOps engineer, a proposal writer, a Google Workspace manager, all coordinating through a shared backlog and sprint board, all built on top of these same Claude Code primitives.

That whole system is what the Glitch Workforce is. It's open source. You install it on your Mac, hire employees by chatting to Professor Glitch, and they run on Claude Code under the hood, using exactly the CLAUDE.md / Skills / Hooks / Subagents / Routines / Slash Commands stack you just read about.

If that sounds like what you want, two paths:

If you only learn one of the six concepts above this week, make it Skills. They're the gateway drug. Once you've shipped one good skill, you'll see five more places it could replace something you do by hand.

Pick your friction. Build the skill that kills it. Tomorrow's you will thank you.

Ready to Build This Yourself?

Join 130+ builders inside the community. Structured paths, hands-on labs, and real walkthroughs.

JOIN THE COMMUNITY