← Return to Report 📚 All Topic Sources ⬇ Download Module Transcript (.txt)

Episode Production Provenance & Module Transcript — AI For Engineers, Part 6: Anthropic Deep Dive — Claude, MCP, Skills & Sandboxed Agents

Episode Production Provenance & Remediated Module Transcript — AI For Engineers, Part 6: Anthropic Deep Dive — Claude, MCP, Skills & Sandboxed Agents
Scope Notice: Internal episode structure and narration transcript (cite ONLY for episode module organization/continuity, NEVER as external proof of vendor policies or scientific claims).
Canonical Episode ID: ai-for-engineers-part-6
Canonical NotebookLM ID: 2b3bd34f-f966-4e17-91e1-30ae898177a0
Master Video Asset: rem_AI_For_Engineers_Part_6_Anthropic_Deep_Dive.mp4
Series Track & Installment: AI FOR ENGINEERS · PART 06 / 09
Architectural Focus: Aero-Blue & Aero-Pink Inspect Tier Trade-Offs, Extended Thinking, KV Caching, MCP, and Kernel Containment

=== REMEDIATED MODULE OVERVIEW & NARRATION ===

Module 01 (MODULE 01 / 12 · CONTINUITY & SCOPE): From OpenAI to Anthropic's Engineering Stack
Banner: Every Claude capability maps directly to fixed-weight Transformer inference, token budgets, tools, and deterministic checks.
Welcome back to Studio A. I am Aero-Blue, joined at the anchor desk by Aero-Pink for Part 6: our Anthropic Deep Dive. In Part 5, we examined OpenAI's model tiers, stateful APIs, and cloud coding containers. Now we apply our Video 1 engineering definitions to Anthropic's Claude ecosystem. Every Claude model is a Large Language Model: a deep neural network of stacked Transformer blocks that computes probabilities over discrete tokens during inference while its learned parameters and weights stay fixed. Across twelve modules, we will inspect Opus, Sonnet, and Haiku latency trade-offs, Constitutional post-training alignment, hybrid Extended Thinking, Key-Value prompt caching, the Model Context Protocol, reusable SKILL dot MD files, Claude Code subagents, pixel Computer Use, and kernel sandboxes.
  - [CONTINUITY · PART 05 → 06] Desk Briefing: Anthropic Architecture: Aero-Blue and Aero-Pink evaluate Claude models, protocols, workspaces, and agent sandboxes using Video 1 definitions. (Scope: Models → Protocols → Workspaces → Agents)
  - [DEFINITION · FIXED INFERENCE] Stacked Transformer Blocks at Runtime: During inference, learned weights and biases remain frozen while input tokens route context through attention layers. (Inference: Fixed Weights + Input Tokens → Logits)
  - [OPEN PROTOCOL · MCP & SKILLS] Standardizing Context and Procedures: Model Context Protocol servers supply external data and tools, while SKILL.md files load repeatable steps into context. (Context Window = System + Docs + Tools + Output)
  - [GOVERNANCE · CONTAINMENT] Agents Bounded by OS Kernel Rules: Claude Code and Computer Use pair multi-step tool loops with permission tiers, hooks, and kernel filesystem limits. (Agent = LLM + Tool Loop + Deterministic Gate)

Module 02 (MODULE 02 / 12 · MODEL TIER TRADE-OFFS): Claude Opus, Sonnet & Haiku Compute Trade-Offs
Banner: Select model tiers by balancing layer depth and width compute cost against latency and multi-step reasoning accuracy.
Thank you, Aero-Blue. Anthropic structures its frontier family into three tiers—Claude Opus, Claude Sonnet, and Claude Haiku—that trade parameter scale, layer depth, and internal vector width against token latency and cost. Remember from Video 1 that a token averages roughly three-quarters of an English word, and each token ID maps to a learned embedding vector refined across layers by mathematical attention. Opus allocates the largest compute budget per token for multi-repository architecture and lead agent planning. Sonnet balances interactive throughput with high tool-calling accuracy for daily software engineering. Haiku minimizes time-to-first-token for high-volume log triage and parallel worker tasks. All three tiers operate across 200-thousand to 1-million token context windows without changing internal vector width.
  - [TIER 1 · CLAUDE OPUS] High-Depth Architectural Synthesis: Highest per-token compute and latency; built for cross-repo root-cause analysis, complex planning, and lead orchestration. (Role: Lead Planner & Deep Spec Verifier)
  - [TIER 2 · CLAUDE SONNET] Interactive Coding & Tool Workhorse: Balances reasoning depth with fast token generation for iterative code diffs, MCP tool calls, and GUI coordinate parsing. (Role: Primary SWE Loop & Computer Use Engine)
  - [TIER 3 · CLAUDE HAIKU] Low-Latency Triage & Worker Node: Lowest latency and per-token cost; executes parallel file filtering, schema extraction, and classification sub-tasks. (Role: Sub-Second Router & Parallel Worker)
  - [CONTEXT · 200K TO 1M TOKENS] Shared Finite Token Budget: System instructions, repository files, tool schemas, and generated tokens all compete inside one finite context window. (Total Tokens ≤ Context Limit (200K–1M))

Module 03 (MODULE 03 / 12 · ALIGNMENT & TRAINING): Pre-Training, Constitutional AI & RL Alignment
Banner: Constitutional AI replaces parts of human preference labeling with rule-guided critique, supervised fine-tuning, and RL.
Before any Claude tier serves API traffic, its parameters are shaped across distinct training stages. First, self-supervised pre-training optimizes next-token prediction across large unlabeled text and code corpora using backpropagation gradients. Pre-training builds broad representation capacity, yet raw base models still produce sycophantic agreement or unsupported hallucinations. Anthropic addresses post-training alignment through Constitutional AI. In the supervised learning phase, the model critiques and revises its own draft responses against an explicit written constitution of honesty and safety rules. In the reinforcement learning phase, an AI preference model scores candidate outputs to update policy weights via RL from AI Feedback. Finally, Anthropic gates deployment under AI Safety Levels—ASL-1 through ASL-4—measuring cyber, biological, and autonomous replication risks.
  - [STAGE 1 · PRE-TRAINING] Self-Supervised Next-Token Loss: Updates billions of weights via gradient descent on unlabeled text and code before task-specific alignment begins. (Pre-Training: Unlabeled Text → Base Weights)
  - [STAGE 2 · SUPERVISED CRITIQUE] Constitutional Self-Revision: Model critiques and rewrites its own outputs against explicit written principles, generating supervised training pairs. (Draft → Principle Critique → Supervised Update)
  - [STAGE 3 · RLAIF POLICY UPDATE] Reinforcement Learning Alignment: Preference signals derived from constitutional rules update policy weights to curb sycophancy and unsafe completions. (RLAIF: Reward Signal → Policy Weight Update)
  - [GOVERNANCE · ASL TIERS] Responsible Scaling Policy Gates: Binds each checkpoint to AI Safety Levels (ASL-1 to ASL-4) via red-team evaluations before API release. (Capability Threshold → Mandatory Containment)

Module 04 (MODULE 04 / 12 · EXTENDED THINKING): Hybrid Extended Thinking & Interleaved Tools
Banner: Extended Thinking allocates an explicit inference-time token budget for intermediate reasoning between tool invocations.
During inference, Opus and Sonnet operate as hybrid reasoning models rather than separate model families. Engineers leave extended thinking off for low-latency completions, or set an explicit budget-tokens parameter—starting at 1,024 tokens and scaling into tens of thousands—inside the same Messages API call. Those thinking tokens let the model test edge cases, check math constraints, and discard invalid branches inside the context window before emitting final output tokens. Crucially, Claude supports interleaved thinking across agent loops. Instead of planning only once up front, the model generates thinking tokens, invokes a bash command or MCP tool, reads the returned observation, and generates a fresh block of thinking tokens to adapt its plan when a test fails.
  - [HYBRID MODE · API PARAMETER] Programmable Thinking Token Budget: Single checkpoint toggles between direct completion and Extended Thinking via an integer budget_tokens setting. (budget_tokens ≥ 1,024 (Billed as Output Tokens))
  - [TEST-TIME COMPUTE · ROLLOUTS] Serial Hypothesis Verification: Generates internal scratchpad tokens to check boundary conditions and backtrack before writing the user-facing answer. (Prompt → Thinking Tokens → Verified Answer)
  - [INTERLEAVED · TOOL REASONING] Reasoning Between Every Tool Call: Evaluates live stdout, compiler errors, or SQL rows in a new thinking block before selecting the next tool call. (Think → Call Tool → Observe → Think → Act)
  - [ADAPTIVE TOOL LOOP] Re-Planning From Tool Output: Invokes bash or MCP tools, reads returned observations, and emits a fresh thinking block to adapt the plan when tests fail. (Tool Observation → Fresh Think Block → Adapt)

Module 05 (MODULE 05 / 12 · CACHING & CITATIONS): KV Prompt Caching, Batches & Citations API
Banner: Prompt Caching reuses Transformer Attention Key-Value tensors across shared prefixes, while Citations anchor source spans.
Multi-turn engineering workflows repeatedly send identical system prompts, tool schemas, and reference specs. Without caching, Transformer blocks recompute attention Key and Value matrices for every prefix token on each request. Anthropic's Prompt Caching stores those exact Key-Value states across a five-minute ephemeral or one-hour extended time-to-live, reducing cached input token cost by up to ninety percent and cutting time-to-first-token latency. For offline evaluations, the Message Batches API processes asynchronous workloads within twenty-four hours at a fifty percent token discount. And to curb hallucination on engineering records—like our prototype pump log LOG-104 peaking at 84.2 degrees Celsius within SPEC-201's 85.0 degree housing limit while dropping 18.4 psi—the native Citations API attaches verifiable character or PDF page spans to source-grounded statements, helping engineers audit claims and spot numeric drift or uncited tags like SPEC-992.
  - [ATTENTION · KV PREFIX REUSE] Prompt Caching (5m & 1h TTL): Persists computed Attention Key-Value tensors for static system rules, tool catalogs, and repository files across turns. (Cache Hit: Up to −90% Input Cost & −85% TTFT)
  - [ASYNC · MESSAGE BATCHES API] Offline High-Throughput Queues: Executes non-interactive regression suites, corpus extractions, and document audits asynchronously inside a 24h window. (Batch Pricing: 50% Input & Output Token Cost)
  - [GROUNDING · CITATIONS API] Character-Exact Source Spans: Attaches verifiable character or PDF page offsets to grounded claims against LOG-104; engineers still verify coverage and interpretation. (Grounded Claim → Verifiable Span in LOG-104)
  - [PUMP AUDIT · ZERO DRIFT] Exposing Numeric Drift & SPEC-992: Verifies LOG-104's 84.2°C housing peak against SPEC-201's 85.0°C ceiling while exposing 94.2°C drift or phantom SPEC-992. (Missing Source Span → Flag Drift / SPEC-992)

Module 06 (MODULE 06 / 12 · MODEL CONTEXT PROTOCOL): MCP Architecture: Hosts, Clients & Servers
Banner: The Model Context Protocol replaces N × M custom tool glue code with a single JSON-RPC 2.0 client-server standard.
Before late 2024, connecting N model harnesses to M engineering data sources required N times M custom adapters. Anthropic open-sourced the Model Context Protocol, or MCP, to collapse that matrix into a single JSON-RPC 2.0 interface. In MCP's three-part topology, the Host application—such as an IDE or desktop harness—runs isolated MCP Clients, each maintaining a stateful session with an MCP Server over local standard input-output streams or remote Streamable HTTP with OAuth. Every MCP Server exposes up to three typed primitives: read-only Resources like telemetry logs and database schemas, executable Tools like SQL queries or Git operations, and parameterized Prompts. Through Anthropic's remote MCP connector and on-demand Tool Search, Claude discovers needed schemas without flooding the context window.
  - [TOPOLOGY · JSON-RPC 2.0] Host, Client & Server Separation: The AI Host manages 1-to-1 Client connections to local stdio processes or remote OAuth-authenticated HTTP MCP Servers. (Integration Complexity: N × M → N + M)
  - [PRIMITIVE 1 · RESOURCES] Application-Controlled Read Data: Streams read-only context such as LOG-104 sensor CSVs, Git diffs, or API specifications into the Context Window. (Resource: URI-Addressed Read-Only Context)
  - [PRIMITIVES · TOOLS & PROMPTS] Model-Invoked Actions & Templates: Tools expose JSON-schema functions for model execution; Prompts provide user-triggered structured workflow templates. (Tools = Side-Effect Calls | Prompts = Specs)
  - [SCALING · REMOTE MCP & SEARCH] Deferred Tool Schema Loading: Messages API connects directly to remote HTTPS MCP servers and loads specific tool definitions only when queried. (Tool Search → Load Needed Schemas Only)

Module 07 (MODULE 07 / 12 · PROJECTS & ARTIFACTS): Claude Projects, 5-Part Prompts & Artifacts
Banner: Projects standardize inference-time Context Window inputs, while Artifacts isolate rendered code and UI in a sandboxed frame.
Inside Anthropic's web and desktop workspaces, two mechanisms structure engineering context and outputs: Claude Projects and Claude Artifacts. A Project pins reference documents, code repositories, and shared instructions into a persistent workspace context window. Remember our Video 1 rule: uploading SPEC-201 into a Project never updates Claude's neural network weights; it injects grounded primary evidence at inference time. Teams pair Project files with a structured five-part prompt specifying Role, Context, Task, Format, and explicit Verification acceptance rules. When Claude generates standalone HTML dashboards, React components, SVG schematics, or Mermaid architecture diagrams, Artifacts render and execute that output inside an isolated browser sandbox beside the chat, maintaining discrete version snapshots so engineers can inspect diffs across iterations.
  - [WORKSPACE · CLAUDE PROJECTS] Shared Inference Context Base: Curates repositories, interface specs, and team rules inside a shared 200K+ token workspace without fine-tuning weights. (Project Docs → Inference Context (Weights Fixed))
  - [SPEC · 5-PART PROMPT STRUCTURE] Role, Context, Task, Format, Verify: Project instructions codify acceptance rules—such as rejecting uncited numbers—across every team member's session. (Prompt = Role + Context + Task + Format + Verify)
  - [SANDBOX · CLAUDE ARTIFACTS] Isolated Side-Panel Rendering: Renders React apps, SVG diagrams, Mermaid graphs, and HTML tools in a restricted iframe with per-turn version history. (Generated Code → Sandboxed Preview + Diffs)
  - [ITERATIVE DIFFS · SNAPSHOTS] Per-Turn Artifact Version History: Maintains discrete Artifact version snapshots across prompt turns so engineers inspect exact code and diagram diffs safely. (Version Snapshots → Inspect Iterative Diffs)

Module 08 (MODULE 08 / 12 · MODULAR SKILLS): Reusable SKILL.md Playbooks vs Fixed Weights
Banner: Skills package repeatable Markdown instructions and deterministic scripts loaded on demand—not newly trained model weights.
As engineering teams automate recurring audits, stuffing fifty workflow guides into every system prompt wastes context window capacity and dilutes attention. Anthropic solves this through modular Skills defined in SKILL dot MD files alongside task-graph orchestration. Recall our Video 1 definition: Skills are reusable written procedures and optional helper scripts loaded into context, never newly trained neural network weights. Using progressive disclosure, the agent harness loads only short skill names and descriptions at startup. When a task matches—such as auditing pump thermal logs—the harness loads the full SKILL dot MD instructions and executes deterministic scripts like verify document dot py. Similarly, a Persistent Agent saves task state on disk across sessions without continuous weight retraining.
  - [DEFINITION · SKILL.MD] Instructions + Scripts, Not Weights: Bundles YAML metadata, step-by-step Markdown rules, and deterministic Python or shell verifiers into a portable folder. (Skill = Markdown Procedure + Helper Script)
  - [PROGRESSIVE DISCLOSURE] Two-Stage Context Window Loading: Startup reads compact skill metadata only; full SKILL.md text enters the Context Window strictly when triggered. (Idle: Metadata Only → Triggered: Full Playbook)
  - [VERIFICATION · HELPER SCRIPTS] Pairing LLMs with Exact Code: Delegates arithmetic thresholds and citation checks—like 84.2°C vs 85.0°C—to verify_document.py rather than token guesses. (Prose Draft (LLM) + Math/ID Audit (Python))
  - [TASK GRAPHS · ORCHESTRATION] Dependency-Tracked Execution: Decomposes multi-file deliverables into ordered checkpoints so persistent agents resume cleanly across sessions. (Persistent State = Disk Checkpoints (Not RL))

Module 09 (MODULE 09 / 12 · CLAUDE CODE & SUBAGENTS): Claude Code CLI, Plan Mode & Subagent Contexts
Banner: Claude Code isolates noisy repository searches inside subagent Context Windows to preserve lead-agent Attention fidelity.
Anthropic's primary software engineering agent is Claude Code, which runs directly inside your terminal, IDE, or continuous integration runner via the Claude Agent SDK. At startup, Claude Code reads repository rules from CLAUDE dot MD and executes an iterative loop of file reads, syntax-tree searches, edits, and test commands. For architectural changes, engineers invoke read-only Plan Mode first, forcing the agent to inspect affected modules and align on a specification before mutating any file. When a task spans hundreds of files, dumping raw grep outputs into one session fills the context window and degrades attention routing. Instead, Claude Code spawns parallel subagents—often pairing an Opus lead planner with Sonnet or Haiku workers—each running in an isolated context window and returning only concise findings.
  - [AUTOMATION · CLAUDE AGENT SDK] Headless CI/CD & Custom Agents: Exposes context compaction, tool dispatch, and MCP connectivity as a Python and TypeScript library for automated pipelines. (SDK: Compaction + Tool Loop + MCP in CI)
  - [CLI HARNESS · CLAUDE CODE] Terminal-Native Repository Loop: Reads CLAUDE.md conventions, navigates git trees, edits source files, and runs unit test suites directly in the shell. (Loop: Read Repo → Edit Diff → Run pytest/lint)
  - [ALIGNMENT · PLAN MODE] Spec Verification Before Mutation: Disables write and bash mutation tools while the agent maps dependencies, edge cases, and test steps for human sign-off. (Phase 1: Read-Only Plan → Phase 2: Approved Edit)
  - [ISOLATION · SUBAGENT CONTEXTS] Preventing Context Window Pollution: Each spawned subagent searches files or runs logs in a separate Context Window, returning a compact summary to the parent. (Parent Context ← Distilled Subagent Summary)

Module 10 (MODULE 10 / 12 · GUI & BROWSER AGENTS): OS-Level Computer Use vs DOM Browser Use
Banner: Prefer CLI or MCP APIs first, structured DOM Browser Use second, and pixel-level Desktop Computer Use only for API-less GUIs.
When external software lacks an API or MCP server, Anthropic provides two distinct visual agent interfaces: Browser Use and OS-level Desktop Computer Use. Browser Use—delivered through Claude in Chrome or Playwright MCP—combines accessibility and DOM tree inspection with viewport screenshots to drive web consoles, forms, and end-to-end UI tests. Desktop Computer Use operates one layer lower inside a virtualized display buffer. At each step, Claude ingests a full screen image, estimates exact X and Y pixel coordinates, dispatches virtual mouse clicks or keystrokes, and captures a fresh screenshot to verify whether a dialog opened or a click missed. Because encoding full screenshots consumes thousands of image tokens and adds multi-second latency per step, engineers reserve pixel Computer Use strictly for legacy desktop GUIs.
  - [WEB LAYER · DOM BROWSER USE] Structured DOM + Viewport Control: Drives Chrome or Playwright via DOM selectors, console logs, and screenshots for web QA and cloud admin workflows. (DOM Tree + Selector → Deterministic Web Action)
  - [OS LAYER · COMPUTER USE] Pixel Screenshots & Virtual Input: Reads desktop framebuffers, computes X/Y pixel coordinates, and sends virtual mouse/keyboard events inside a container. (Screenshot → (X, Y) Coordinate → Virtual Click)
  - [CONTROL · VISUAL VERIFICATION] Observe-After-Act Recovery Loop: Inspects the post-action frame after every click to detect validation banners, layout shifts, or modal blockers. (Act → Capture Frame → Verify State Transition)
  - [ENGINEERING RULE · TOOL ORDER] Latency & Token Cost Hierarchy: Direct CLI/MCP calls cost tens of tokens in milliseconds; full-screen GUI loops cost thousands of tokens per step. (Priority: CLI / MCP → DOM Browser → Pixel GUI)

Module 11 (MODULE 11 / 12 · SANDBOXES & HOOKS): Permission Tiers, Kernel Sandboxes & Hooks
Banner: Never rely on prompt wording alone for safety; enforce kernel sandboxes, explicit approval tiers, and deterministic hooks.
Because an agent executing shell commands or reading untrusted web DOMs faces prompt-injection risks, security boundaries cannot rely on probabilistic token prediction alone. Anthropic layers three deterministic controls around agent execution. First, four operator permission tiers—Read-Only Plan, Ask Default, Accept Edits, and Container Bypass—govern which tool classes require human confirmation. Second, OS kernel sandboxing via macOS Seatbelt and Linux bubblewrap restricts child processes at the syscall boundary, blocking filesystem writes outside the project directory and routing outbound network requests through an allowlisted proxy. Third, deterministic lifecycle hooks—PreToolUse and PostToolUse—execute external shell or Python policies around every tool call, blocking destructive git or file commands beforehand and running linters or verify document dot py immediately afterward.
  - [ACCESS · 4 PERMISSION TIERS] Graduated Operator Approval: Scales from Read-Only Plan Mode and Ask Default to Auto-Accept Edits, reserving Bypass Mode strictly for isolated VMs. (Tiers: Plan → Ask → Accept Edits → VM Bypass)
  - [KERNEL · SEATBELT & BUBBLEWRAP] Filesystem & Network Containment: Enforces OS-level write confinement to workspace paths, blocks SSH/.env exfiltration, and filters outbound domains. (Syscall Gate: Workspace R/W Only + Proxy Filter)
  - [PRETOOLUSE · COMMAND GATE] Blocking Destructive Shell Calls: Deterministic PreToolUse hooks execute external shell or Python policies before tool calls to block destructive git or file ops. (PreToolUse Non-Zero Exit → Block Execution)
  - [POSTTOOLUSE · CODE AUDIT] Auto-Running Linters & Verifiers: PostToolUse hooks run deterministic linters, typecheckers, or verify_document.py immediately after every file edit or tool run. (Tool Call → PostToolUse(verify_document.py))

Module 12 (MODULE 12 / 12 · SYNTHESIS & PART 07): Verified Anthropic Pipeline & Handoff to Part 7
Banner: Combine cached primary context, MCP tools, modular Skills, and deterministic hooks—then proceed to Part 7: Google AI.
Let us connect the entire Anthropic engineering stack on our prototype pump failure audit. An MCP resource server streams primary evidence LOG-104 and SPEC-201 into a Prompt-Cached context window, cutting repeated attention prefill costs by up to ninety percent. Claude Sonnet or Opus applies a five-part prompt and modular SKILL dot MD procedure, using Extended Thinking and native Citations to confirm seal-housing peak temperature hit 84.2 degrees Celsius within SPEC-201's 85.0 degree limit while pressure dropped 18.4 psi. Inside a Seatbelt or bubblewrap sandbox, a PostToolUse hook runs verify document dot py to block any 94.2 degree numeric drift or phantom SPEC-992 hallucination before commit. On behalf of Aero-Blue and myself, Aero-Pink, thank you for watching Part 6. Join Gort-Seven and C-Protocol next in Part 7 for our Google AI Deep Dive.
  - [STEP 1 · MCP & PROMPT CACHE] Streaming LOG-104 & SPEC-201: An MCP resource server streams primary evidence LOG-104 and SPEC-201 into a Prompt-Cached window, cutting prefill cost up to 90%. (MCP Resource + Prompt Cache → −90% Prefill)
  - [STEP 2 · CLAUDE + SKILL.MD] Extended Thinking & Exact Citations: Claude Sonnet or Opus runs a 5-part prompt and SKILL.md playbook, checking 84.2°C vs SPEC-201's 85.0°C ceiling and −18.4 psi drop. (5-Part Spec + SKILL.md → 84.2°C ≤ 85.0°C; −18.4 psi)
  - [LAYER 3 · SANDBOXED AGENTS] Subagents, Kernel Gates & Hooks: Isolate noisy searches in subagents, confine processes via Seatbelt/bwrap, and run verify_document.py in PostToolUse. (Sandbox + PostToolUse → Zero Unverified Claims)
  - [UP NEXT · PART 07 / 09] Google AI & Antigravity Deep Dive: Gort-VII and C-Protocol examine Gemini models, Multimodal Live APIs, NotebookLM grounding, and the Antigravity harness. (Next: AI For Engineers · Part 07 (Google AI))