A while Loop Is Not an Agent Runtime. 8 Parts You're Missing.
Introduces a five-layer diagnostic framework (Prompt, Context, Loop, Graph, Harness) to help engineers triage agent failures by identifying which layer a problem belongs to Argues that prompt engineering is a subset of context engineering, not the whole job, as agent systems have evolved beyond single-turn interactions Each layer answers a distinct question: Prompt = how you say it, Context = what the model knows, Loop = when it runs again, Graph = how work connects, Harness = runtime environmen
Analysis
TL;DR
- Introduces a five-layer diagnostic framework (Prompt, Context, Loop, Graph, Harness) to help engineers triage agent failures by identifying which layer a problem belongs to
- Argues that prompt engineering is a subset of context engineering, not the whole job, as agent systems have evolved beyond single-turn interactions
- Each layer answers a distinct question: Prompt = how you say it, Context = what the model knows, Loop = when it runs again, Graph = how work connects, Harness = runtime environment
- The framework resolves confusion around overlapping mechanisms (MCP, memory, skills, hooks) by asking "what does it actually move?"
- Context problems manifest as hallucination, forgetting, and token burn; Loop problems manifest as agents that never stop or never restart
Why It Matters
This framework provides AI practitioners with a practical triage methodology for debugging complex agent systems, preventing wasted effort on the wrong layer. As agents evolve from single-turn prompts to continuous multi-turn systems with memory, tools, and subagents, having a clear mental model for where problems originate becomes essential for efficient development and troubleshooting.
Technical Details
- Five-layer nested architecture: Prompt (text wording), Context (content selection and injection), Loop (execution timing and termination), Graph (work unit connectivity and parallelism), Harness (runtime environment and operational guarantees)
- Context engineering encompasses: memory systems (instruction, long-term, working, summary), RAG/retrieval, CLAUDE.md imports, skill trigger mechanics, compaction, tool result truncation, and subagent isolation
- Loop types identified: goal-based (agent self-continues until evidence or maxTurns), time-based (timer-driven observation-then-act cycles), and turn-based (human-presses-continue)
- Key diagnostic test: determine whether you're improving wording of existing text (Prompt) or deciding what enters the context window (Context)
- Failure signatures are layer-specific: Context problems show hallucination/forgetting/token burn; Loop problems show infinite loops or premature termination; Graph problems show coordination failures between parallel nodes
Industry Insight
- Teams should adopt layer-first debugging discipline: before rewriting prompts, verify whether the issue lives in context injection, execution flow, or runtime guarantees
- The framework explains why "skill prompt engineering" debates are category errors—skills span both Prompt (instruction body) and Context (trigger/description mechanics)
- As agent systems grow more complex with subagents, parallel execution, and persistent state, investing in Graph and Harness layer understanding will become a competitive differentiator for production-grade deployments
Disclaimer: The above content is generated by AI and is for reference only.