Skip to content
Back to skills

Agent Loop Design

ASecurity

Evidence-based rules for designing an agent's loop: tool surface and MCP servers, best-of-N, voting, effort and retries, making a loop cheaper or faster (prompt cache, serving), plans vs replanning, recovering from mid-task failures, telling harness faults from model faults, latent handoffs and diffusion decoders, probes, steering, and monitoring closed-API agents (reasoning text, "done" claims, confidence, ask or abstain gates). Use when building or tuning an agent loop or harness, or before...

  • 5 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added November 14, 2026
ai-agentsrustreactapi

Works with

  • api
  • mcp

Security analysis

A100/100

Pro scans all 9 files and shows the line behind each finding

Scanned November 15, 2026

npx -y skills add kookr-ai/kookr --skill agent-loop-design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Agent Loop Design?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Agent Loop Design
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/kookr-ai-agent-loop-design/badge)](https://www.skillsdirectory.com/skills/kookr-ai-agent-loop-design)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: agent-loop-design
group: design-analysis
keywords: agent loop, harness faults, silent failures, tool design, MCP, best-of-N, reasoning effort, prompt cache, inference cost, planning, replan, failure recovery, latent reasoning, probes, steering, parallel tool calls, self-refine, debate, diffusion LM, CoT monitor, abstention
related: token-efficiency, agent-fleet-orchestration, automation-design, autonomous-watch-loop, error-handling-patterns, agent-safety, adversarial-swarm-analysis
description: >
  Evidence-based rules for designing an agent's loop: tool surface and MCP servers, best-of-N, voting,
  effort and retries, making a loop cheaper or faster (prompt cache, serving), plans vs replanning,
  recovering from mid-task failures, telling harness faults from model faults, latent handoffs and
  diffusion decoders, probes, steering, and monitoring closed-API agents (reasoning text, "done" claims,
  confidence, ask or abstain gates). Use when building or tuning an agent loop or harness, or before
  adding tools, samples, retries, a planner or a monitor.
---

# Agent loop design

Each guide holds evidence-based rules for one design decision.

Read only the guide that matches the decision in front of you (several if the task spans them).

| Decision you face | Read |
|---|---|
| Building or auditing tools / MCP servers; wrong tool picked; schemas or tool output eat tokens; which calls to run in parallel or ahead | [references/agent-tool-surface-design.md](references/agent-tool-surface-design.md) |
| Whether to spend more compute for a better answer: N samples, voting, higher effort, retries; revise vs resample after a failure; vote, judge, synthesis or debate | [references/inference-budget-allocation.md](references/inference-budget-allocation.md) |
| Making a run cheaper or faster: cache hits, fewer tokens, self-hosted serving options (llama.cpp, vLLM, SGLang) | [references/agent-inference-efficiency.md](references/agent-inference-efficiency.md) |
| Plan up front or act reactively; when to replan; keeping plan and progress across a long run | [references/long-horizon-planning.md](references/long-horizon-planning.md) |
| The agent hit an error, regression, stuck loop or stall mid-task; choosing an attempt budget | [references/agent-failure-recovery.md](references/agent-failure-recovery.md) |
| About to blame the model for a failure; output looks right but state is wrong; auditing tool wrappers, validators or provider error handling; accepting harness edits from an optimizer | [references/harness-faults.md](references/harness-faults.md) |
| Someone proposes latent reasoning, KV-cache or hidden-state handoffs, looped models, diffusion LMs | [references/latent-vs-text-agent-design.md](references/latent-vs-text-agent-design.md) |
| Someone proposes probes, steering vectors or SAE features; designing a stuck or drift detector | [references/agent-internal-signals.md](references/agent-internal-signals.md) |
| Monitoring a hosted (closed-API) agent: reading its reasoning, trusting its "done" or confidence, ask or abstain gates | [references/closed-model-agent-monitoring.md](references/closed-model-agent-monitoring.md) |

Related skills: `token-efficiency` (context size and prompt-cache rules), `agent-fleet-orchestration`
(splitting work across subagents), `automation-design` and `autonomous-watch-loop` (supervisors and
watch loops), `error-handling-patterns` (code-level retry and idempotency).

Files in this skill

  • SKILL.md3.3 KB
  • references/agent-failure-recovery.md8.9 KB
  • references/agent-inference-efficiency.md6.3 KB
  • references/agent-internal-signals.md4.3 KB
  • references/agent-tool-surface-design.md7.8 KB
  • references/closed-model-agent-monitoring.md5.6 KB
  • references/inference-budget-allocation.md8.7 KB
  • references/latent-vs-text-agent-design.md6.4 KB
  • references/long-horizon-planning.md6.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.