Free Claude Code lesson 2 of 3
The agentic stack
Know what is a file, what is a model call, and what is a running process.
Click a layer. See its real responsibility.
U1 · Supplied practical masterclass ↗
A model response is not a filesystem operation
The model can request a tool operation. The host checks permissions, executes it, and returns an observation. The next model turn reasons over that observation.
Modelchooses a tool
Hostchecks and executes
Resultstdout / error / file
Modelchooses next step
U1 · Supplied practical masterclass ↗
Read the three kinds of “workflow”
Prompt workflow: an ordered procedure written in a skill.
Program workflow: code calls a worker, tests its result, retries, or stops.
Event workflow: GitHub starts a job after an event. That job may then execute either of the above.
Only the second and third directly encode control flow outside the model’s judgment.
U1 · Supplied practical masterclass ↗G2 · GitHub: workflow triggers ↗
One feature, three control planes
| Plane | Example | Failure you must consider |
|---|
| Reasoning | Agent interprets the ticket and edits code. | It misunderstands a requirement or overlooks an edge case. |
|---|
| Execution | Shell installs dependencies; tests return an exit status. | The command fails, hangs, or uses the wrong environment. |
|---|
| Coordination | Scheduler claims ready work and records outcomes. | Two workers claim the same task, or successors start before integration. |
|---|
This three-plane decomposition is a teaching model. Use it to locate a bug: bad instructions, bad execution, or bad coordination?
Trace one turn without hand-waving
Where each piece lives
User goal
Project instructions
Skill / workflow
Tools and agents
Tests and review
A workflow is an ordered policy for doing work. It may be written inside a skill, encoded in a script, expressed as several commands, or coordinated by an external runner. It is not a special file type.
| Component | Question it answers | Typical home | Execution behavior |
|---|
| CLAUDE.md | What should Claude know every session? | ./CLAUDE.md or ~/.claude/CLAUDE.md | Instructions in context; guidance, not a hard guard. |
|---|
| Rule | What applies to a path or topic? | .claude/rules/ | Scoped or general instructions. |
|---|
| Skill | How should this recurring task be done? | .claude/skills/name/SKILL.md | Instructions and optional supporting assets load when invoked. |
|---|
| Subagent | Who should do this bounded task? | .claude/agents/name.md | Separate agent context; may use tools and return a result. |
|---|
| Hook | What must run on an event? | .claude/settings.json or plugin hooks | Host triggers handler on an event, subject to configuration. |
|---|
| MCP | Which external service can supply tools? | .mcp.json or CLI-managed settings | Connection exposes tools; credentials and permission still matter. |
|---|
| Plugin | How are extensions distributed? | Marketplace / installed package | Can package skills, agents, hooks, and MCP definitions. |
|---|
| Git worktree | Where can concurrent edits live? | Another directory of the same Git repository | Separate checkout; not a security sandbox. |
|---|
Where each one costs context is covered in Context budget: what loads when.
U1 · Supplied practical masterclass ↗
Pick the smallest useful extension
What are you trying to make reliable?
Recommended: Use a short CLAUDE.md for facts needed every session; use .claude/rules/ for scoped conventions.
| What you want to make reliable | Smallest useful extension |
|---|
| A repeatable project convention | Use a short CLAUDE.md for facts needed every session; use .claude/rules/ for scoped conventions. |
|---|
| A multi-step procedure | Create a skill with explicit inputs, steps, evidence, and an exit condition. Add scripts only for deterministic operations. |
|---|
| A command that must run at an event | Use a hook on the relevant lifecycle event. Test its matcher and whether it should warn, block, or simply record. |
|---|
| Access to a tracker or service | Configure an MCP server, CLI, or API integration and authenticate it. Then tell the workflow exactly when to read or update the service. |
|---|
| A bounded task in fresh context | Define a bounded subagent task and an expected report. Add a worktree if another agent edits the same checkout. |
|---|
| Share the whole setup with a team | Package the tested setup as a plugin or share project files in Git. Document what installation enables and what remains opt-in. |
|---|
U1 · Supplied practical masterclass ↗
Reading rule: a repository’s README describes intent; its actual SKILL.md, hook files, scripts, and configuration show how it works. “Automatically” in a README may depend on installation, permissions, credentials, or a separate command.
← PreviousNext: Context budget: what loads when →
Lessons 1 to 3 are free. Sign in to open the other 21 chapters and ask the assistant.