Beyond the Chat Window
1.1 The Three Levels of Working with AI
Most people are stuck at Level 1 or 2. This guide takes you to Level 3.
Level 1 — The Chat
| What it is | One prompt → one response. Session ends, memory resets. |
| Good for | Drafting emails, quick Q&A, brainstorming, summarizing. |
| Ceiling | Anything requiring continuity, multiple steps, or reuse. |
Level 2 — The Configured Assistant
| What it is | A system prompt gives the AI a persona, rules, and context. Consistent behavior across sessions. |
| Good for | Dedicated support bots, review assistants, domain-specific helpers. |
| Ceiling | One agent still does everything. Context fills up. Quality degrades across domains. |
Level 3 — The Agentic System
| What it is | A team of specialized AI agents, each with a bounded role, coordinated by an orchestrator. |
| Good for | Complex, multi-stage workflows that need consistency, specialization, and scale. |
| Ceiling | Your ability to design the system — not a context window. |
| Benefit | What it means in practice |
|---|---|
| Specialization | Each agent tuned for one job → more reliable, more predictable |
| Parallelism | Multiple agents work simultaneously → faster results |
| Reusability | Agents built once, used across many workflows |
| Maintainability | Something breaks? Fix one agent, not a 3,000-word prompt |
| Scale | Multi-stage processes that overwhelm one conversation become tractable |
1.2 What Are Agentic Flows?
Definition: A structured AI system where specialized agents — each with bounded responsibilities and defined tools — are coordinated by an orchestrator to produce a reliable, repeatable output from a given input.
Three things make a flow "agentic" rather than just a long system prompt:
- Specialized agents — each knows exactly what it does and what it doesn't. A Fact-Checker doesn't style-edit. A Style Reviewer doesn't check facts. Constraint is a feature.
- An orchestrator — receives the high-level goal, breaks it into tasks, routes to the right agent, handles exceptions, assembles output. Think: project manager, not doer.
- Reliable, repeatable output — runs the same way every time. If results vary wildly between runs, the flow is broken.
The Mental Shift
| From | To |
|---|---|
| "What should I ask the AI?" | "What system should I design?" |
| One conversation | An architecture |
| Ad hoc prompting | Defined roles and flows |
| Start over each time | Build once, reuse forever |
1.3 Why Claude Code?
Claude Code is a platform where you define AI systems using files, and Claude executes them. The name says "code" — the reality is much broader. It works equally well for:
- Content pipelines (research → draft → edit → publish)
- Operations (data extraction → classification → reporting)
- Research (gather → synthesize → summarize)
- Customer support (triage → draft response → escalate)
- Business intelligence (monitor → analyze → report)
Your System Lives in Files
your-project/
├── CLAUDE.md ← system constitution (always loaded)
└── .claude/
├── agents/
│ ├── researcher.md ← subagent: research specialist
│ ├── writer.md ← subagent: content writer
│ └── editor.md ← subagent: review & editing
├── skills/
│ └── weekly-report/
│ └── SKILL.md ← reusable workflow
└── settings.json ← hooks & permissions | Benefit | What it enables |
|---|---|
| Version control | Commit to Git → full history, rollback, branching |
| Collaboration | Push to repo → team shares the same agent config |
| Portability | Move the folder → system moves with it |
| Transparency | Read every line → no hidden settings |
.claude/ files.Getting Started with Claude Code
2.1 What You Need
| Requirement | Details |
|---|---|
| Claude subscription | Pro ($20/mo), Max 5x ($100/mo), or Max 20x ($200/mo) |
| Claude Desktop | macOS or Windows — claude.com/download |
| A project folder | Any folder on your local machine |
| Git (optional) | Strongly recommended — version control for your agent files |
| Plan | Best for |
|---|---|
| Pro ($20/mo) | Learning, small workflows, occasional use |
| Max 5x ($100/mo) | Regular professional use — Opus access included |
| Max 20x ($200/mo) | Daily heavy use, multiple parallel sessions |
2.2 Opening the Code Tab
Claude Desktop is the primary interface — no terminal required.
- Open Claude Desktop → click the Code tab
- Click Select folder → choose your project folder
- Pick a model — Sonnet 4.6 for most tasks
- Start prompting in natural language
2.3 Your First Session
Start with a read-only prompt so Claude can explore without changing anything:
Analyze this project folder and tell me what it contains. Every modification goes through the same approval loop:
2.4 How Your Files Connect
Claude Code works entirely with local files — nothing is uploaded to the cloud. When you select a folder, Claude automatically discovers CLAUDE.md and everything inside .claude/.
your-project/
├── CLAUDE.md ← always loaded at session start
├── .claude/
│ ├── agents/ ← subagent definitions
│ ├── skills/ ← reusable workflows
│ └── settings.json ← hooks & permissions
└── your-other-files/ .claude/ directory to Git. Your entire agentic system becomes version-controlled, shareable, and rollback-safe.2.5 The CLI Alternative
# Install
npm install -g @anthropic-ai/claude-code
# Run inside your project folder
cd your-project && claude | Desktop Code tab | CLI | |
|---|---|---|
| Setup | Zero — already installed | npm install -g |
| Interface | Visual diffs, GUI | Text-based diffs |
| Best for | Learning, daily work | Automation, scripting, CI/CD |
Same .claude/? | ✓ | ✓ |
2.6 Authentication
| Method | When to use | How |
|---|---|---|
| Browser login | Personal use, Desktop, interactive CLI | OAuth — same account as Claude.ai |
| API key | CI/CD, automation, scripts | export ANTHROPIC_API_KEY=sk-ant-… |
How Claude Code Works — The Mental Model
3.1 The Conversation Loop
Claude Code is not a chatbot that happens to touch files. It's a read-modify-execute loop with you as the approver at every step.
3.2 Essential Commands
| Command | What it does |
|---|---|
/help | List all available commands |
/clear | Reset conversation, keep CLAUDE.md loaded |
/compact | Compress context to free up token space |
/model | Switch model mid-session (+ set effort level) |
/plan | Enter Plan Mode — think before acting |
/agents | View and manage active subagents |
/hooks | Configure hooks interactively |
/doctor | Run diagnostics on your setup |
@filename | Reference a specific file in your prompt |
!command | Run a shell command directly |
@agent-name | Explicitly invoke a named subagent |
3.3 Plan Mode — Think Before You Build
What it is: Claude analyzes your request, produces a plan, and waits for your approval before touching any file. Enter with /plan or Shift+Tab.
Explore ──→ Plan ──→ Implement ──→ Commit
Read files Design approach Execute steps Done | Use Plan Mode for | Skip it for |
|---|---|
| Multi-file changes | Single file edits |
| Architectural decisions | Quick fixes |
| First time running a new workflow | Routine, familiar tasks |
3.4 Context Management
Every file read, tool call, and response consumes tokens from Claude's context window. When it fills, quality degrades.
| Strategy | When to use |
|---|---|
/compact | Context is filling up but you want to continue |
/clear | Conversation has drifted — start fresh, CLAUDE.md stays loaded |
| New session | Task is complete; starting something unrelated |
| Use subagents | Heavy exploration — each subagent has its own isolated context window |
3.5 Model Selection
Use /model to switch mid-session. Default rule: start with Sonnet, escalate to Opus when needed.
| Model | Speed | Best for | Context |
|---|---|---|---|
| Sonnet 4.6 | Fast | 80%+ of tasks — coding, writing, analysis | 1M tokens |
| Opus 4.6 | Slower | Complex reasoning, architecture, agent teams | 1M tokens |
| Haiku 4.5 | Fastest | Classification, quick edits, high-volume tasks | 200K tokens |
In agent and skill frontmatter, use the alias — not the full model string:
---
model: sonnet # fast, cost-effective — use by default
model: opus # complex reasoning
model: haiku # fast, simple tasks
--- The Anatomy of an Agentic System
4.1 Core Components
Every agentic system — regardless of complexity — is built from ten entity types. In Claude Code, each maps to a specific file, directory, or configuration.
| Entity | Location in Claude Code | Role |
|---|---|---|
| Workflow | .claude/commands/wor-*.md | Orchestrates multi-step processes. Coordinates agents, manages handoffs, and assembles results across steps. |
| Agent Specialist | .claude/agents/age-spe-*.md | Executes a specific domain of responsibility. One job, clear boundaries, own context window. |
| Agent Supervisor | .claude/agents/age-sup-*.md | Reviews or validates output from other agents. Quality gate, not a worker. |
| Skill | .claude/skills/ski-*/SKILL.md | Reusable capability package. Triggered by name or description match. Can be shared across agents. |
| Command | .claude/commands/com-*.md | Direct, deterministic action triggered by the user. Always manual, always atomic. |
| Rule | .claude/rules/rul-*.md | Behavioral constraint. Can live in CLAUDE.md (always-on) or as standalone files (on-demand). |
| Knowledge Base | .claude/knowledge-base/kno-*.md | Reference information consulted on demand. Never executed — only read. |
| Resource | .claude/resources/res-*.md | Support document that extends other entities. Loaded conditionally when the main entity needs extra detail. |
| Script | .claude/scripts/scp-*.sh | Executable automation — validation, deployment, data processing. In Claude Code: .sh or .py files. |
| Hook | .claude/settings.json | Event-driven automation. Fires on system events, not user commands. Documentation in .claude/hooks/hok-*.md. |
Naming Conventions
Every entity file follows a strict prefix system. This makes entities identifiable at a glance and enables automatic discovery.
| Entity | Prefix | Example |
|---|---|---|
| Workflow | wor- | wor-content-pipeline.md |
| Agent Specialist | age-spe- | age-spe-email-classifier.md |
| Agent Supervisor | age-sup- | age-sup-output-validator.md |
| Skill | ski- | ski-format-output/SKILL.md |
| Command | com- | com-quick-translate.md |
| Rule | rul- | rul-output-standards.md |
| Knowledge Base | kno- | kno-brand-guidelines.md |
| Resource | res- | res-api-full-reference.md |
| Script | scp- | scp-lint-check.sh |
| Hook | hok- | hok-auto-lint.md |
All names use kebab-case, no spaces, no uppercase. The name field in frontmatter is limited to 64 characters; the description to 250. Descriptions should follow a "what + when" pattern: what it does, and when it should be used.
4.2 How They Relate
- Workflow (
wor-) orchestrates the flow — invokes Agents, manages handoffs - Specialists (
age-spe-) execute domain work; Supervisors (age-sup-) validate output - Agents use Skills and run Scripts
- Commands are invoked directly by the user — they bypass the Workflow
- Rules constrain everyone — including the Workflow
- Knowledge Base and Resources are consulted, never executed
- Hooks fire on events, not on commands
wor-*) and Commands (com-*) live in .claude/commands/. The prefix is what distinguishes them — not the directory.4.3 Component Reference
Workflow (wor-)
- Receives the high-level goal; breaks it into steps; routes to the right agents; manages handoffs; assembles output
- In Claude Code:
.claude/commands/wor-*.md - The orchestrator of the system — not a worker, but a coordinator
Agent Specialist (age-spe-)
- Exactly one domain of responsibility — nothing more
- Defined in
.claude/agents/age-spe-*.mdwith YAML frontmatter - Has its own isolated context window
- Invoked automatically (description match) or explicitly via
@agent-name
Agent Supervisor (age-sup-)
- Reviews, validates, or scores output produced by Specialists
- Defined in
.claude/agents/age-sup-*.md - Acts as a quality gate — does not produce primary work, only evaluates it
- Use when you need a "second pair of eyes" before results leave a step
Skill (ski-)
- A named, reusable capability package — not a worker, but a procedure
- Triggered by name (
/skill-name) or automatic description match - Lives in
.claude/skills/ski-*/SKILL.md - Can fork a new context window for heavy work
Command (com-)
- A direct, deterministic action — a "saved prompt" that always produces the same behavior
- User-invoked only via
/command-name— no agent or workflow delegates to a Command - Lives in
.claude/commands/com-*.mdwith minimal YAML frontmatter - Use for atomic, repeatable tasks: export a system, publish a version, apply optimizations
Rule (rul-)
- A constraint, not a capability
- Two locations: in
CLAUDE.md(always-on, every session) or as standalone files in.claude/rules/rul-*.md(loaded on demand) - Always written as "Instead of X, do Y" — never just a prohibition
- Standalone rule files use a structured format: Context, Hard Constraints, Soft Constraints
Knowledge Base (kno-)
- Static reference content: style guides, API docs, domain glossary
- Lives in
.claude/knowledge-base/kno-*.md - Tell agents when to read it: "If you encounter an error, read
kno-error-codes.md"
Resource (res-)
- Support document that extends another entity when its content is too long or too detailed
- Lives in
.claude/resources/res-*.md - Referenced conditionally: "For complex API usage, read
res-api-full-reference.md" - Keeps the main entity lean — the agent loads the resource only when needed
Script (scp-)
- Executable automated procedure — validation, deployment, data processing
- In Claude Code:
.claude/scripts/scp-*.shorscp-*.py(executable files) - Run by agents or hooks, not invoked directly by users
Hook (hok-)
- Fires automatically on system events — file save, session start, task complete
- Configured in
.claude/settings.json(the runtime configuration) - Documentation lives in
.claude/hooks/hok-*.md(what the hook does and why)
4.4 Decision Tree: Which Component Do I Need?
| Mistake | Problem | Fix |
|---|---|---|
| Orchestration logic inside an Agent | Scope creep — "God Agent" | Move routing to a Workflow (wor-) or a dedicated Skill |
| Workflow when you need a Command | Commands are atomic; Workflows coordinate multi-step flows | If single action → Command (com-). If multi-step → Workflow (wor-) |
| Skill when you need a Rule | Skills are invoked; Rules are always-on | If always applies → Rule in CLAUDE.md or .claude/rules/ |
| Everything in CLAUDE.md | Context fills every session | Move workflow logic to Skills, long rules to rul-*.md files |
| Command when you need a Skill | Commands can't be reused by agents | If other agents need it → Skill (ski-) |
| KB when you need a Resource | KB is standalone; Resources extend entities | If it supplements an agent's instructions → Resource (res-) |
| Rules as negatives only | Agents don't know what to do instead | Always: "Instead of X, do Y" |
4.5 A Minimal Working System
The smallest valid agentic system needs just three things:
your-project/
├── CLAUDE.md
└── .claude/
└── agents/
└── age-spe-researcher.md CLAUDE.md
# Project: Market Research Assistant
## Purpose
This system researches topics and returns structured summaries.
## Rules
- Always cite sources
- Use the researcher agent for all information gathering
- Output in Markdown with clear section headers
## Agents
- **@age-spe-researcher** — handles all research and fact-finding tasks .claude/agents/age-spe-researcher.md
---
name: age-spe-researcher
description: Researches topics using web search and returns structured
summaries with citations. Use for any information gathering,
fact-checking, or background research task.
model: sonnet
tools: WebSearch, Read
---
You are a research specialist. When given a topic:
1. Search for current, authoritative sources
2. Synthesize findings into a clear summary
3. List all sources with URLs
Output format:
## Summary
[2-3 paragraph synthesis]
## Key Facts
- [bullet list]
## Sources
- [URL] — [one-line description] One rule set, one specialist. Start here — add complexity only when the task demands it.