The conceptual backbone

The mental model

If you internalize one page, make it this one. Every Claude Code feature — skills, hooks, MCP, teams, workflows — is a special case of four nested levels of control over a model. Reviewed 2026-06-10.

Prompt βŠ‚ Context βŠ‚ Harness βŠ‚ Loop

Each level is a bigger unit of work than the last and contains the one before it: a message sits inside a context window, which sits inside a single session, which a loop runs over and over. Start at the message; end at a system that runs itself.

β‘  the message
Prompt
Compose one best input.
β‘‘ the memory
Context
Curate a finite window.
β‘’ the machine
Harness
Gather β†’ Act β†’ Verify, once.
β‘£ the timer
Loop
The harness, self-feeding.

Each level in depth below — same four facts every time: the unit Β· what you engineer Β· fix here when Β· in Claude Code. The first three are the canonical home of the Tide prompt/context/harness model; the loop is the floor above, where a 2026 practice lives.

β‘  the message

Prompt engineering

Compose one best input, then refine the weakest ingredient and resend.

The unitOne inference call β€” the single message you hand the model.
You engineerrole Β· context Β· instructions Β· examples Β· output format
Fix here whena single answer is wrong, vague, or mis-formatted — the model had what it needed, you just asked badly.
In Claude Codethe prompt and effort level you send each turn.
β‘‘ the memory

Context engineering

A finite budget. A curator selects, compresses, drops so only what matters reaches the model each step.

The unitThe whole context window β€” a finite token budget, refilled every step.
You engineerwhat to select, compress, or drop before the window fills.
Fix here whenthe model forgets earlier facts, drowns in irrelevant tokens, or contradicts itself over a long session.
In Claude CodeCLAUDE.md + session memory, and the curated window the Gather step assembles.
β‘’ the machine

Harness engineering

The outer loop — Gather β†’ Act β†’ Verify β†’ retry — that contains prompt and context inside it, and runs once.

The unitOne full session β€” the Gather β†’ Act β†’ Verify cycle, run once.
You engineerthe wiring — which tools/subagents Act can reach, and what verifies the result before it ships.
Fix here whenthe agent does the right thing once but can’t recover, retry, or check its own work.
In Claude Codetool + subagent calls (Act), tests/judges (Verify), the curated window (Gather).
The harness loop, zone by zone

β‘  GATHER β€” the context-engineering zone. A curator fills a finite context window from: the user request, memory (CLAUDE.md, sessions), prior tool outputs, retrieved docs.

β‘‘ ACT β€” the prompt-engineering zone. Assemble one prompt β†’ run inference β†’ branch to tools (exec, fetch, MCP) or subagents (specialists).

β‘’ VERIFY β€” a verifier (tests, LLM-as-judge) checks the result. Pass β†’ final answer. Fail β†’ retry: re-run gather β†’ act β†’ verify with updated context.

β‘£ the timer

Loop engineering

The harness put on a timer that feeds itself: it finds work, hands it out, checks it, records progress, decides the next thing — then pokes the agent instead of you.

The unitMany sessions over time β€” the harness on a heartbeat that restarts it.
You engineerthe heartbeat, a trusted “done” gate, and on-disk memory so progress survives between runs.
Fix here whenone session nails it but the work doesn’t persist, recur, or restart without you in the chair.
In Claude Code/loop Β· /goal Β· routines (the heartbeat) + the repo as system of record.
The shift β€” the leverage point moved The highest-value thing is no longer writing each turn; it’s designing the loop. Same model, same harness — what changes is that nobody has to be in the chair for the next cycle to start. The same five Claude Code blocks ship in Codex too, so the shape outlives any one tool.
What a loop is built from β€” a heartbeat, five blocks, and a memory

The heartbeat β€” what restarts the cycle without you. Three flavours: /loop = a clock (run again every N minutes); /goal = a condition (keep going until a separate validator confirms done); a routine = cloud cron (a saved config a trigger runs unattended, laptop closed).

Subagents β€” split the maker from the checker so a verifier the loop trusts decides “done” (no model grading its own homework β€” what /goal’s separate Haiku evaluator does).

Worktrees β€” git isolation so concurrent runs don’t collide on the same files.

Skills β€” project intent written down once, so the loop doesn’t re-derive it from zero each cycle.

Plugins + MCP β€” connectors that let the loop act in real tools: open a PR, update a ticket, post to Slack.

On-disk memory β€” the repo is the system of record. The model forgets everything between runs, so “what’s done” has to live on disk, not in a context window.

Pick the heartbeat β€” two questions

The official docs don’t stack these as control levels; they treat them as siblings you pick between, split on two questions. Where does it run — inside an open session you’re driving, or independent of any session? What fires the next unit of work — a clock, a condition, or an event? “Where it runs” is the load-bearing one: the scheduling-options table makes “Requires open session” its spine, and the agents page fences this whole family off as “a different problem than splitting work across agents.”

 Clock β€” an intervalCondition β€” a check passesEvent β€” something happens
In an open session
you’re driving; stops when the session ends
/loop 5m β€” re-run a prompt every N min on a fixed cron step /goal β€” until a separate small-model validator confirms done; self-paced /loop (Claude picks the delay); a custom Stop hook Hooks (PreToolUse, Stop…); Channels β€” CI pushes a failure straight into the session
Independent of session
survives a closed laptop; launches a fresh session
Routines (schedule) Β· Desktop scheduled tasks Β· OS cron Β· GitHub Actions β€” rare; encode the check as the routine’s own first step Routines (GitHub event Β· API /fire) Β· GitHub Actions (CI events)

The split runs right through the session boundary: /loop Β· /goal Β· hooks Β· Channels drive turns inside one session; routines Β· desktop tasks Β· cron Β· Actions are a trigger ring outside it that fires a whole session. That boundary — not the trigger type — is the first thing to decide, which is why the docs put it first.

The catch β€” build the loop, stay the engineer The loop changes the work; it doesn’t delete you from it. Verification, comprehension debt, and cognitive surrender all get sharper as the loop improves. Treat it as a 2026 practice/preview, not a settled standard.

Concept node: Loop Engineering (patterns layer) Β· depends-on Harness Engineering, repo-as-record, and externalized completion.

Every primitive pulls one of four levers

Once you see Claude Code as a harness around a model, each feature is just a way to change one of these:

β‘  What the model knows

Soft context & instructions.

CLAUDE.md Β· rules files Β· skills Β· output styles Β· effort

β‘‘ What the model can reach

Tools & external systems.

built-in tools Β· MCP servers

β‘’ What is guaranteed

Deterministic enforcement.

hooks Β· permission rules Β· managed policies

β‘£ How work is coordinated

Single-thread β†’ fleet.

subagents Β· agent view Β· agent teams Β· workflows Β· worktrees

The three axes that separate everything

Axis 1 β€” Soft vs Hard

Does the model choose to follow it, or does the client enforce it no matter what?

Soft
CLAUDE.md, rules files, skills, output styles, effort, MCP tool choice. Guidance β€” the model may ignore it.
Hard
Hooks, permission rules, managed settings. Runs or blocks regardless of the model. The only real guardrails.

Axis 2 β€” Who holds the plan

The single best discriminator among the coordination primitives. As you move right, more runs in parallel and you watch each step less.

Who decides what runs nextPrimitiveWhere intermediate results live
You, in one promptPrompt engineeringThe single response
The model, across one sessionOne session / context engineeringThe context window
The model, delegating turn-by-turnSubagentsEach subagent’s own context; summary returns
You, supervising many sessionsAgent viewEach session’s transcript + worktree
A lead agent, turn-by-turnAgent teamsA shared task list + mailbox
A script the runtime executesDynamic workflowsScript variables (not a context window)

Adapted from the official “who holds the plan” table.

Axis 3 β€” Breadth vs Depth

Two different kinds of scaling. Breadth = how many things run in parallel. Depth = how much sustained, single-thread reasoning & shared context a unit of work keeps. Picking the wrong axis is the most common mistake: people reach for agent teams or workflows (breadth) when they needed one deep session (depth), and vice-versa.

Rule of thumb If the units of work don’t need each other’s context β†’ push for breadth (workflows / agent view). If they do β†’ keep depth (one session, or a small agent team that talks).

Related to Axis 2 but not the same: Axis 2 is about who controls the plan and where results live; Axis 3 is about parallelism vs shared context. They correlate (more control often means less parallelism) but diverge β€” agent teams are high-control and fairly deep. For the scored breadth/depth bars on every primitive, see the comparison matrix.

How it all nests

These aren’t nine flat options — they stack. Reading inside-out:

managed policies            ← hard ceiling over everything (org governance)
└── harness (one session)   ← Gather β†’ Act β†’ Verify loop
    β”œβ”€β”€ memory / CLAUDE.md   ← soft context in Gather
    β”œβ”€β”€ skills               ← procedures pulled into Act on demand
    β”œβ”€β”€ MCP servers          ← extra tools available in Act
    β”œβ”€β”€ hooks                ← deterministic code at lifecycle events
    β”œβ”€β”€ subagents            ← delegated workers (own context, summary returns)
    └── /loop & /goal        ← keep the session working (clock / until a condition holds)

  ...and when one session isn't enough:
    agent view   = you supervising MANY of these sessions
    agent teams  = a LEAD session coordinating PEER sessions that message
    workflows    = a SCRIPT spawning dozens–hundreds of subagents
    worktrees    = git isolation UNDER all of the above (so files don't collide)
    routines     = a saved config a TRIGGER runs unattended in the cloud (laptop closed)
Three things people mix up Subagent = a worker inside one session (can’t spawn its own subagents). Agent team teammate / agent-view session = a full session. Worktree = not an agent at all β€” a git directory that keeps parallel sessions from editing the same files.

The coordination spectrum β€” three questions

When a job is too big for one session, the docs reduce the choice to three questions (agents):

Who coordinates?

You β†’ agent view. The model in one session β†’ subagents. A lead model β†’ agent teams. A script β†’ workflows.

Do workers talk to each other?

No, report up β†’ subagents / agent view. Yes, peer-to-peer β†’ agent teams.

Do they touch the same files?

If yes β†’ isolate with worktrees (automatic under agent view; manual partition for teams).

A dynamic workflow in miniature β€” how this guide was researched

You wanted to see the workflow pattern, not just read about it. A dynamic workflow moves the plan into code: a script fans work out to many subagents, holds the intermediate results in variables, cross-checks them, and returns only the synthesis. This guide was built with exactly that shape — here is the “script” that was effectively run:

// pseudo-workflow: research the Claude Code primitives
const slices = [
  "parallel surfaces: subagents, agent view, agent teams, worktrees",
  "skills + MCP: mechanism, invocation, security",
  "terminology: hooks vs rules, conventions vs policies, 'routines'",
  "curriculum + leveling + announcement dates",
];

// PHASE 1 β€” fan out (parallel, isolated context each)
const findings = await Promise.all(
  slices.map(s => agent({ task: s, sources: "code.claude.com/docs only" }))
);

// PHASE 2 β€” cross-check (claims that disagree get dropped or flagged)
const verified = crossCheck(findings);   // e.g. "routines" β†’ 2 meanings: colloquial=skills, official=cloud automation

// PHASE 3 β€” synthesize (only the answer reaches the main context)
return synthesize(verified);             // β†’ this field guide
The payoff Four research streams ran in parallel; their raw output never touched the writing context — only the cross-checked synthesis did. That’s the whole value proposition of workflows: more agents without more context bloat, plus a built-in quality gate. The real feature does this with up to 16 concurrent agents (1,000 cap) and a watchable progress view; here it was emulated with parallel subagents.

β†’ The dynamic workflows primitive