PTENES
TRACK 2

🔵 Technique: Architecture & Engineering

Lift the hood. Here you learn how each piece works under the hood and develop the engineering discipline that separates “worked once” from “reliable.” CLAUDE.md engineering, the WAT framework in depth, MCP under the hood, context and token management, and RAG & data—five modules that turn you from an operator into an architect.

5
Modules
32
Topics
~4h
Duration
Inter.
Level
Learning path progress 0% · 0 of 32
Technical track banner: blueprint, gears, and circuits in blue — the architecture and engineering behind the scenes
Module 2.1 CLAUDE.md Module 2.2 WAT Framework Module 2.3 MCP under the hood Module 2.4 Context & tokens Module 2.5 RAG & data

The path through track 2: from the instruction file (the project’s "constitution") to the WAT architecture, MCP protocol, context efficiency, and RAG — the internal layers that separate a prototype from a reliable system.

Learning path map

Detailed content

Illustration for module 2.1
2.1 ~45 min · 6 topics

📜 CLAUDE.md Engineering

CLAUDE.md is the project’s persistent system prompt — the "constitution" the agent rereads every session. Its anatomy, operating rules, how to trim it to under ~500 lines, what belongs in CLAUDE.md vs. skills, and how to iterate on the file through conversation.

Module progress 0% · 0 of 6
What it is:

A Markdown file at the project root that defines role, context, and preferences — and that the agent reads at the start of each session, without you having to explain them again.

Why learn:

It’s what keeps things consistent across sessions; if it’s poorly written, the agent forgets the rules every time.

Key concepts:

Persistent; markdown; read every session; role + context + rules.

What it is:

Typical sections: who the agent is, what is being built, operating rules, communication style, and the project's folder structure.

Why learn:

A clear skeleton prevents confusing files and lost rules.

Key concepts:

Role; context; rules; style; structure.

What it is:

Behavioral directives: look for an existing tool before creating a new one, learn and adapt when something fails, and keep the files up to date.

Why learn:

Are the rules that activate the agent’s self-improvement loop.

Key concepts:

Reuse before creating; learn from failures; keep it up to date.

What it is:

Limit the file (target: under ~500 lines) because it enters the context every session; long files dilute the important rules.

Why learn:

If the agent keeps getting the same rule wrong even though it’s written down, the file may be too long and the rule may “get lost.”

Key concepts:

Under ~500 lines; only content for every session; concise.

What it is:

CLAUDE.md stores only what applies to every session (purpose, rules, framework); instructions for specific tasks go in skills, loaded on demand.

Why learn:

Putting everything in CLAUDE.md overflows the context window; skills save space.

Key concepts:

Every session → CLAUDE.md; on demand → skills.

What it is:

CLAUDE.md isn’t written once and then forgotten — you ask the agent to add or change sections ("add a rule to keep explanations short").

Why learn:

The file evolves with the project; iteration is how it gets sharper.

Key concepts:

Always editable; ask in natural language; living document.

Illustration for module 2.2
2.2 ~50 min · 7 topics

🔠 The WAT Framework in Depth

The structure behind every agentic workflow: W = Workflows (Markdown instructions = SOP), A = Agent (the coordinator that makes decisions), T = Tools (scripts, one task each). Plus the self-improvement loop, the folder structure, and when NOT to use WAT.

Module progress 0% · 0 of 7
What it is:

A three-layer pattern — Workflows, Agent, Tools — that gives the agent a "manual + brain + hands." Most agentic builds fit this model.

Why learn:

It gives you a shared vocabulary and a repeatable way to structure any project.

Key concepts:

W + A + T; manual + brain + hands; repeatable.

What it is:

Natural-language Markdown files (with headings, bullets, and bold text) that work like a job description or SOP, telling the agent what to do.

Why learn:

It's the layer you edit most; a good workflow is half the result.

Key concepts:

Markdown; SOP; objective + input + output + steps.

What it is:

The coding assistant itself: the coordinating brain that reads workflows, sees the available tools, and decides which one to use and when — like a project manager delegating tasks.

Why learn:

Understanding that the agent makes decisions (it isn’t a fixed script) changes how you write instructions.

Key concepts:

Coordinator; reads and decides; delegates to tools.

What it is:

Scripts (usually Python) that do the actual work, ideally one per task (scrape a site, generate a PDF, analyze data). The agent writes and fixes them—you don’t need to code.

Why learn:

Small, focused tools are easy to test, reuse, and fix.

Key concepts:

One task each; auto-generated; reusable.

What it is:

The agent runs a workflow, encounters an error, diagnoses it, fixes the tool, and updates the workflow file so the error doesn’t happen again — runs get smoother and faster over time.

Why learn:

It’s WAT’s superpower: the system improves itself while it runs.

Key concepts:

Error → diagnosis → fix → updated workflow.

What it is:

The recommended organization: a workflows folder, a tools folder, a temporary folder (intermediate/output files), the environment file (.env, secrets), and CLAUDE.md.

Why learn:

A clear structure helps the agent find what it needs and keep secrets separate from the code.

Key concepts:

workflows; tools; temporary; .env; CLAUDE.md.

What it is:

For one-off tasks, initial experimentation, or instructions that fit in one sentence, setting up the WAT structure is overkill — just type the request.

Why learn:

Knowing when NOT to use it avoids bureaucracy and wasted context.

Key concepts:

One-off task; one-off; don’t force the structure.

Illustration for module 2.3
2.3 ~50 min · 7 topics

🔌 MCP Under the Hood

The protocol that gives the agent external tools. What it solves, how the agent discovers and chooses tools, the .mcp.json and manual key (never in chat), project-level vs global, where to find servers, how to verify/diagnose, and the context cost.

Module progress 0% · 0 of 7
What it is:

MCP (Model Context Protocol) lets a single connection expose multiple tools/actions — like Gmail exposing send, draft, and search emails all at once.

Why learn:

It's how AI gets "arms" without you integrating every action by hand.

Key concepts:

Protocol; one connection = many tools; exposed actions.

What it is:

As soon as the agent and server connect, the agent knows all the available tools and decides on its own which one to call, when, and with which parameters.

Why learn:

You describe the outcome; it chooses the tool.

Key concepts:

Discovery; autonomous decision-making; parameters.

What it is:

When installing a server, the agent generates a .mcp.json with the configuration and a space for the API key; you paste the key into the file manually—never into the chat.

Why learn:

It's the basic MCP security rule: keep secrets out of the conversation.

Key concepts:

.mcp.json; placeholder; key manually; never in chat.

What it is:

The MCP config can be global (the whole machine) or at the project level; the project level is recommended to keep secrets and context isolated.

Why learn:

Global config can trigger security warnings on every restart; project-level config fixes this.

Key concepts:

Project-level; isolation; move to the project folder.

What it is:

Servers live in dedicated directories (e.g., mcp.so) or on GitHub (search for "MCP server" + service name). Common categories: scraping (Firecrawl), databases (Postgres, Supabase), documents, communication.

Why learn:

Knowing where to look greatly speeds up the build.

Key concepts:

Directories; GitHub; server categories.

What it is:

The /mcp command lists installed servers and their status; if a new server doesn’t appear, restarting the assistant fixes it most of the time.

Why learn:

It’s the first step in troubleshooting any MCP issue.

Key concepts:

/mcp; status; restart first.

What it is:

Each active server injects its tool definitions into the context, which consumes tokens. Turning off the ones you don’t use frees up context.

Why learn:

Less noise in context = fewer errors and lower cost.

Key concepts:

Tool definitions = tokens; turn off unused ones.

Illustration for module 2.4
2.4 ~40 min · 6 topics

🧠 Context & Tokens

Don't let the agent “rot.” Context rot and degradation after ~60%, the thresholds (0-50 / 50-70 / 70-85 / 85%+), /clear vs /compact, one task per session, defining “done” to avoid loops, and cost-saving strategies.

Module progress 0% · 0 of 6
What it is:

Quality gradually declines as the session gets longer; errors become more common after ~60% of the context is used, when noisy history drowns out the core rules.

Why learn:

Knowing this keeps you from arguing with an agent that’s just “tired.”

Key concepts:

Degradation; ~60%; noise drowns out rules.

What it is:

A guideline: 0-50% is safe; 50-70% is yellow (consider compacting); 70-85% is orange (run /compact); above 85%, run /clear and start over.

Why learn:

Turns abstract “context rot” into concrete action by threshold range.

Key concepts:

Green / yellow / orange / red.

What it is:

/clear resets the entire conversation (use it when switching tasks or when quality drops); /compact creates a smart summary that keeps the essentials and compresses the rest (use it in the middle of a long task).

Why learn:

Choosing the wrong option loses useful context or keeps junk.

Key concepts:

clear = reset; compact = summary; when to use each.

What it is:

Keep each session focused on one task and clear it before starting the next, instead of reusing a bloated conversation for something unrelated.

Why learn:

Clean context = more accuracy and fewer tokens spent.

Key concepts:

One task; clear first; focus.

What it is:

Give the agent an explicit completion criterion (e.g., "exactly 75 profiles") so it stops instead of researching endlessly.

Why learn:

Without a "done" condition, the agent can get stuck in a loop and burn through tokens.

Key concepts:

Definition of done; criteria; prevents loops.

What it is:

Cost-saving levers: use skills (loaded on demand), turn off unused MCPs, keep CLAUDE.md lean, and focus on one task per session.

Why learn:

Brings everything in the module together into a “context hygiene” routine.

Key concepts:

Skills; turn off MCP; keep CLAUDE.md concise.

Illustration for module 2.5
2.5 ~45 min · 6 topics

🗂️ RAG & Data

Give the agent memory and sources. The problem (AI doesn't know what's outside the context), system prompt vs vector store, embeddings & vector store in plain language, the indexer, the classifier that routes before spending agent tokens, and confidence score & fallback.

Module progress 0% · 0 of 6
What it is:

A model only answers about what’s in its context or training. To answer questions about your documents (policies, FAQ), you need to make that information available to it.

Why learn:

It’s the “why” behind RAG: without a source, AI makes things up or gets them wrong.

Key concepts:

Outside the context = invisible; ground it in a source.

What it is:

A system prompt embeds the text directly (simple and inexpensive for a few documents); a vector store retrieves only the relevant passages (scalable and better as you grow).

Why learn:

Choosing the wrong option uses up context or limits growth.

Key concepts:

Embed vs. search; small vs. scalable.

What it is:

Embeddings turn text into numbers that capture meaning; the vector store saves those numbers and finds matches by similarity of meaning, not exact words.

Why learn:

It’s the engine that makes search “understand” the question.

Key concepts:

Meaning in numbers; similarity search.

What it is:

A separate workflow that reads the documents, splits them into chunks, generates embeddings, and populates the vector store — run once (or when updating the knowledge base).

Why learn:

Separating indexing from querying is the standard RAG architecture pattern.

Key concepts:

Manual trigger; loader/splitter; populate the store.

What it is:

A classifier node decides early whether the input is relevant (e.g., a support question or not) and routes it — only what matters reaches the expensive agent.

Why learn:

Low-cost triage before the agent saves tokens and prevents out-of-scope responses.

Key concepts:

Triage; routing; only relevant items get through.

What it is:

When the search doesn't find anything relevant, the agent emits a "not found" marker and falls back (e.g., "let's research and get back to you") instead of making things up.

Why learn:

An honest agent that refuses to make things up is a desired outcome, not a bug.

Key concepts:

Confidence marker; fallback; don't hallucinate.

← Track 1 · Fundamentals & Glossary Track 3 · Prompts & Patterns →