Course Roadmap: What We'll Build & Learn
Master the paradigm shift from manual prompt engineering to autonomous agent loops. Learn the 6 core pillars of loop architecture, automated research engines, independent verifier sub-agents, multi-modal workflows, and enterprise harness engineering.
What You Need Before Starting:
- Basic familiarity with AI tools like ChatGPT, Claude, or Gemini
- No advanced coding required — all concepts are explained from scratch with copyable architectural templates
- Curiosity to learn how autonomous AI workflows run in modern software teams
What is Loop Engineering? The Paradigm Shift from Prompting to Self-Driving Loops
Why writing loops that prompt AI is replacing manual prompt engineering.
In the early days of generative AI, the primary skill was Prompt Engineering: crafting clever instructions, specifying persona roles, and manually tweaking prompts whenever the AI made a mistake.
However, as autonomous coding tools (Claude Code, Codex, Devin) began handling tasks that run for hours or overnight, manual supervision broke down. Humans cannot sit at a keyboard re-prompting an agent every two minutes.
As pioneering engineers like Peter Steinberger and Boris Cherny (Anthropic) observed: 'I don't prompt Claude anymore; I write loops that prompt Claude.' Loop Engineering is the science of designing closed-loop autonomous architectures where machines understand tasks, execute actions, evaluate outputs with independent verifiers, persist state to disk, and iterate until the objective is achieved.
Traditional Methods vs. Loop Engineering
Human Involvement
Execution Model
Quality Assurance
The 6 Core Superpowers We Will Master
Closed-Loop Self-Correction
Agents detect mistakes through test suites and validator sub-agents, automatically self-correcting without human intervention.
Automated Triggers & Schedules
Run recurring cron workflows that wake up on schedule, scan sources, process data, and shut down gracefully.
Independent Verifier Sub-Agents
Separate creation from evaluation so dedicated critic agents audit outputs for hallucinations and red flags.
Persistent Disk State & Deduplication
Track processed IDs and session telemetry across runs so the agent never duplicates work.
Context-Grounding Engines
Inject rich domain data, customer history, and strict schema guardrails for executive-ready outputs.
Enterprise Harness Orchestration
Manage multi-agent clusters with automated routing, token budget caps, rate limiting, and failure recovery.
Quick Cheat Sheet: Essential Commands
Keep these core syntax triggers handy as you follow the walkthrough modules below:
| Command / Trigger | What It Does |
|---|---|
/loop | Initialize an autonomous closed-loop agent session in Claude Code or Codex |
schedule | Set recurring cron trigger (e.g. '0 9 * * 1-5' for weekdays at 9:00 AM) |
verify --strict | Invoke an independent critic sub-agent to audit candidate outputs against rubric rules |
log --dedup | Append processed records to a persistent tracking sheet to prevent repetition |
stop --threshold=N | Declare hard stopping criteria (e.g. stop after 20 validated items or 30 days) |
The Evolution of AI Engineering: From Prompts to Autonomous Loops
Understand the 6 evolutionary stages of AI development and why loop engineering emerged as the highest leverage skill.
To master loop engineering, you must understand how AI interaction has evolved from static rules to intelligent self-driving systems. In this module, we trace the transition from deterministic programming to closed-loop autonomous agents.
1The 6 Evolutionary Stages of AI Interaction
Do:Think in systems, not single prompts
Shift your mental model from 'How do I write a prompt for this task?' to 'How do I build a self-evaluating loop that runs this task continuously?'
Avoid:Treating loop engineering as a total replacement for prompt engineering
Prompting is the foundational vocabulary of loops. Loop engineering wraps prompts inside automated execution and evaluation architectures.
Hands-On Practice Checklist
Try each of these steps on your computer and check them off as you complete them:
The 6 Core Building Blocks of a Production Loop Architecture
Master the 6 essential components required to build any robust, non-halting, production-ready AI loop.
Without a structured architecture, an autonomous agent can wander aimlessly, repeat mistakes, or loop infinitely. Every reliable loop must be constructed with 6 distinct structural pillars.
Universal blueprint for engineering autonomous closed-loop workflows.
# Autonomous Loop Architecture Specification ## 1. Goal [Clear statement of desired outcome] ## 2. Automation Trigger - Schedule: [e.g., Every weekday at 09:00 AM or webhook event] ## 3. Rules & Guardrails - Ingestion Filters: [Location, price range, strict requirements] - Quality Standards: [Formatting guidelines, prohibited items] ## 4. Action Execution - Primary Worker Agent: [Scrapes data, analyzes files, drafts deliverables] ## 5. Verifier & Independent Critic - Quality Sub-Agent: [Audits candidate outputs, checks links, flags hallucinations] ## 6. Memory & State Persistence - Local Tracking Log: [e.g., outputs/processed_items.json or tracking_sheet.xlsx] - Deduplication: Skip any record already present in memory log. ## 7. Stop Condition & Escalation - Auto-Stop Threshold: [e.g., Target reach of 20 items or max 30-day runtime] - Human Escalation: [Alert user if 3 consecutive failures occur]
Do:Always include explicit Stop Conditions
Define clear numerical or temporal thresholds (e.g. 'Stop when 20 records are validated' or 'Max 5 retries') to prevent runaway token costs.
Avoid:Omitting the Memory Log
Without persistent state logging, scheduled loops will re-process the exact same records every morning, causing duplicate work.
Hands-On Practice Checklist
Try each of these steps on your computer and check them off as you complete them:
Designing Your First Autonomous Loop: Automated Job Discovery Engine
Build, configure, and schedule a multi-source web discovery loop with automated deduplication and scheduled cron triggers.
In this hands-on project, you will build an autonomous job discovery loop. Instead of manually browsing job boards every morning, the agent wakes up at 9:00 AM, scrapes multiple sources, verifies compensation criteria, logs results to an Excel spreadsheet, and stops when 20 opportunities are shortlisted.
1Step 1: Write the 6-Part Loop Prompt Specification
$ /loop
Goal: Discover matching career opportunities without manual daily portal searching.
Automation: Check job boards (LinkedIn, Indeed, Glassdoor) every morning at 9:00 AM.
Rules: Search for 'Senior AI Engineer' or 'Product Architect' roles; location Delhi NCR or Remote; minimum base compensation $120k / ₹25 LPA; company size > 50 employees.
Action: Scrape listings, extract key requirements, and append to ~/Documents/job_tracker.xlsx.
Verifier: Independent sub-agent checks for recruiter scams, unpaid listings, and stale postings.
Memory Log: Record every applied/shortlisted Job ID in tracker to guarantee zero duplicate entries.
Stop Condition: Auto-stop when 20 validated listings are logged in the tracker spreadsheet.2Step 2: Authorize the Scheduled Cron Task
$ Allow Claude Code / Codex to register recurring cron schedule3Step 3: Inspect the Generated Output & Deduplication Log
$ open ~/Documents/job_tracker.xlsxHands-On Practice Checklist
Try each of these steps on your computer and check them off as you complete them:
Market Research & Real-Estate Loops: Automated PDF Reporting
Build an autonomous market intelligence loop that explores real-estate listings, filters out suspicious properties, and compiles a multi-page PDF summary.
Finding an apartment or conducting competitive market research often requires checking 5+ different portals daily. In this module, we construct a loop that scans property portals, checks distance radiuses, enforces budget caps, and compiles an executive multi-page PDF brochure.
1Step 1: Execute the Market Intelligence Loop
$ /loop -f apartment-search-loop.mdSpecification for an automated property search and document generation loop.
Goal: Find rental properties meeting exact parameters without daily manual app searches. Automation: Run daily scan across property portals at 08:00 AM. Rules: - Budget: Max $1,500 / ₹25,000 per month - Layout: 2 BHK with dedicated parking space - Radius: Within 5 km of central business district - Brokerage: Zero broker fee or max 15 days rent Action: Extract matching listings and compile formatted summary into apartment_shortlist.pdf. Verifier: Check property photos for red flags (watermarks, misaligned address details, unrealistic pricing). Memory: Maintain list of contacted/inspected property IDs. Stop Condition: Halt loop once 8 verified candidate properties are compiled into the PDF.
Do:Define concrete numerical constraints
Avoid vague criteria like 'Find cheap places'. Always specify hard limits (e.g. '$1,500 max rent, 5km radius, 2BHK minimum').
Avoid:Accepting unverified listing data
Always instruct the verifier to validate photo authenticity and check for hidden brokerage fees.
Hands-On Practice Checklist
Try each of these steps on your computer and check them off as you complete them:
Self-Evaluating Verifiers & Independent Critic Sub-Agents
Implement the 'Separation of Generation and Evaluation' principle by deploying independent critic sub-agents with scoring rubrics.
A core reason autonomous agents fail is self-grading bias: an LLM that generated a piece of code or text will usually confirm that its own output is correct. Loop engineering solves this by creating a separate 'Critic Sub-Agent' whose sole job is to rigorously evaluate candidate outputs against a strict rubric.
1Step 1: Observe Worker-Critic Interaction
$ claude: 'Run data extraction loop with verifier-critic sub-agent'Independent critic sub-agent specification (`verifier-critic.md`).
--- name: verifier-critic description: Independent evaluator that audits worker agent outputs against strict acceptance rubrics. --- # Evaluation Rubric (Pass Threshold: >= 90/100) 1. Schema Accuracy (25 pts): Are all required JSON/Excel fields present with valid data types? 2. Constraint Compliance (25 pts): Are all price, location, and requirement rules 100% satisfied? 3. Source Verifiability (25 pts): Are all URLs active and do property/job details match the source? 4. Hallucination Check (25 pts): Are there any fabricated metrics or generic placeholder strings? # Protocol - If score >= 90: Return [PASS] and append candidate to production database. - If score < 90: Return [FAIL] with specific bulleted feedback and trigger worker retry loop.
Pro Tip for Beginners
Hands-On Practice Checklist
Try each of these steps on your computer and check them off as you complete them:
Context Engineering & Domain Grounding in Enterprise Loops
Ground your agent loops with rich domain context, organizational schemas, and executive audience tailoring.
A prompt is an instruction ('Write an email'); Context is the necessary domain information required to execute that instruction accurately (Customer purchase history, refund policy, CEO tone, sales data). In this module, you will learn how Context Engineering eliminates generic AI output.
1Step 1: Compare Generic Prompting vs. Context Grounding
$ Generic Prompt: 'Analyze this sales data and write a business report.'2Step 2: Apply Context Engineering in Gemini / Claude
$ Role: Senior Enterprise Business Intelligence Analyst.
Audience: CEO and Board of Directors.
Dataset: @data/superstore_sales.csv.
Domain Context: Company is ABC Superstore. High-priority focus areas are gross profit margin, East Region shipping delays, and B2B technology growth rate.
Deliverable: Executive report with KPI scorecards, quarterly trends, root-cause anomaly breakdown, and 3 high-ROI strategic recommendations.Hands-On Practice Checklist
Try each of these steps on your computer and check them off as you complete them:
Multi-Modal Agent Loops: Automated Reports, PPT Slides & Executive Emails
Orchestrate end-to-end agentic loops that ingest raw data and produce complete multi-format deliverable suites.
Real knowledge work requires producing multiple companion artifacts: an analytical report, a PowerPoint slide deck for leadership, and an executive briefing email. In this module, you will build a multi-action agent loop that creates all 3 deliverables from raw data in a single autonomous pass.
1Step 1: Provide the Multi-Deliverable Agent Prompt
$ As an AI Business Analyst, analyze @sales_data.xlsx and complete all 3 deliverables:
1. Generate an analytical markdown report with executive summary and KPI tables in /outputs/report.md.
2. Build a 5-slide presentation deck with visual charts in /outputs/presentation.pptx.
3. Draft a concise 4-sentence executive summary email for the CEO in /outputs/ceo_briefing.txt.Hands-On Practice Checklist
Try each of these steps on your computer and check them off as you complete them:
Harness Engineering & Production Resiliency (Multi-Agent Orchestration)
Understand enterprise harness engineering: coordinating multi-agent clusters, retry backoffs, token cost limits, and human escalation.
In production enterprise environments, dozens of specialized agents operate concurrently (Customer Support AI, Sales AI, Code Review AI, Compliance AI). Harness Engineering is the management layer that coordinates, monitors, routes, and safeguards this multi-agent ecosystem.
Production harness configuration for enterprise multi-agent clusters.
{
"harness": {
"routing": {
"code_tasks": "claude-3-7-sonnet",
"fast_classification": "haiku-3-5",
"deep_reasoning": "opus-4"
},
"rate_limits": {
"max_requests_per_minute": 60,
"max_tokens_per_session": 150000
},
"resiliency": {
"retry_policy": "exponential_backoff",
"max_retries": 3,
"fallback_model": "haiku-3-5"
},
"safety_guardrails": {
"require_human_approval": ["database_write", "git_push", "payment_api"],
"blocked_commands": ["rm -rf *", "drop database"]
}
}
}Pro Tip for Beginners
Hands-On Practice Checklist
Try each of these steps on your computer and check them off as you complete them:
Crash Course Starter Files & Templates
Loop Engineering Blueprint & Specification Pack
Includes copyable `loop-specification-template.md`, `verifier-critic.md` sub-agent blueprints, `harness-config.json` templates, and automated cron scheduling playbooks.