dual-loop

dual-loop is a skill for Claude Code, Codex from richfrem/agent-plugins-skills. It costs 55 tokens per session (668 once invoked), scanned A, original, MIT.

A workflow for a lead agent to assign a specific task to a worker agent, check the result, and repeat the work when needed.

In plain words
What is it for?
Use it to split planning from coding or other execution, then validate the worker’s output before accepting it.
Why use it?
It adds a clear handoff and verification step so delegated work is not treated as finished without evidence.

Skill for Claude CodeCodex

Part of the agent-orchestration plugin — 9 skills, 1 agent shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/richfrem/agent-plugins-skills/dual-loop
Any agent
npx skills add richfrem/agent-plugins-skills --skill dual-loop
Clone the repo
git clone --depth 1 https://github.com/richfrem/agent-plugins-skills

Made for: Claude Code, Codex.

Or install agent-orchestration, the plugin that ships this one along with the rest of its 9 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for dual-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/richfrem/agent-plugins-skills/dual-loop.svg)](https://agentmods.dev/skills/richfrem/agent-plugins-skills/dual-loop)
Your own site
<a href="https://agentmods.dev/skills/richfrem/agent-plugins-skills/dual-loop"><img src="https://agentmods.dev/badge/skills/richfrem/agent-plugins-skills/dual-loop.svg" alt="Measured on agentmods" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 668 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00055 $0.00668
Opus 5 $0.00028 $0.00334
Sonnet 5 $0.00011 $0.00134
Haiku 4.5 $0.00006 $0.00067

Measured today against content hash 2cf39bc1e10a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

dual-loop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/agent-orchestration/skills/dual-loop/SKILL.md · 56 lines

How it starts

The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Dual-Loop (Inner/Outer Agent Delegation)

The Dual-Loop architecture splits work between a strategic Outer Loop (Supervisor/Director) and an execution-focused Inner Loop (tactical coding sub-agent). The Outer Loop organizes tasks, delegates via Strategy Packets, verifies output, and generates Correction Packets.


1. Setup & Interactive Orientation (Outer Loop)

  1. Decomposition: Break work down into atomic, testable Work Packages (WPs).
  2. Interactive CLI & Model Selection: Ask user for preferred CLI (agy, claude, copilot, codex, llama) and model. Consult references/cheapest_models.json.
  3. Workspace Isolation: Receive isolated git worktree or directory branch from orchestrator.

2. Strategy Packet Generation & Dispatch

  1. Author Strategy Packet (handoffs/task_packet_NNN.md):
    • Scope, target files, acceptance criteria, and explicit "NO GIT" rule for the Inner Loop.
  2. Dispatch sub-agent with standard input redirected (< /dev/null to prevent SIGTTIN halts):
    python scripts/run_agent.py handoffs/task_packet_001.md <target_file> handoffs/result.md \
      "Execute strategy packet exactly." --cli <cli> --model "<model>" < /dev/null
    

3. Supervised Verification Gates

Upon completion signal, the Outer Loop verifies output:

  1. Delta Audit: Run git diff to verify only authorized paths were modified; zero stub placeholders (TODO, TBD).
  2. Automated Test Run: Run unit and integration tests mechanically.
  3. Outcome Resolution:
    • PASS: Mark complete, update task tracker, proceed to closure.
    • FAIL: Issue a Correction Packet categorized by severity:
      • 🔴 CRITICAL: Fails compile/tests. Return immediate error diagnostics.
      • 🟡 MODERATE: Breaks architecture/conventions. Cite specific rule.
      • 🟢 MINOR: Style only. Supervisor fixes directly.

4. Retrospective & Closure

  1. Conduct post-run self-assessment survey (references/post_run_survey.md).
  2. If friction reoccurs 3+ times, flag for triple-loop escalation.
  3. Merge verified branch and emit handoff summary.

Read the full file on GitHub · 56 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · -145 lines · -25 tokens per session 2cf39bc1e10a
  2. 4d ago First seen · 201 lines · 80 tokens per session scan A 75611c28c3fe

Subscribe to this mod's changes

dual-loop is a skill published in the GitHub repository richfrem/agent-plugins-skills (6 stars, last pushed yesterday), licensed MIT. It adds 55 tokens to every session and 668 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

bootstrap

Generate a personalized SOUL.md through a warm, adaptive onboarding conversation. Trigger when the user wants to create, set up, or initialize their AI partner's identity — e.g., "create my SOUL.md", "bootstrap my agent", "set up my AI partner", "define who you are", "let's do onboarding", "personalize this AI", "make…

bytedance/deer-flow · 114 tokens

multi-agent

Orchestrate a task across multiple AI models/providers. Define a team of agents with different roles, providers, and models. Each agent handles a phase (planning, execution, auditing, etc.) and results are combined. (/multi-agent, orchestrate, multi-model, team).

adolfousier/opencrabs · 59 tokens

kapso-whatsapp

How to interact with Kapso WhatsApp from the swarm — read inbound webhook payloads (text AND media), fetch message history, send free-form messages within the 24h session window (and template messages outside it), mark-as-read, show the typing indicator, send reactions, download media, verify webhook signatures, and…

desplega-ai/agent-swarm · 156 tokens

prd

Generates a Product Requirements Document from a natural language app description. Asks clarifying questions, researches similar apps, defines scope, stack, architecture, and produces a structured PRD that Archon can decompose into a campaign.

SethGammon/Citadel · 48 tokens

attio-interaction

Generic Attio CRM REST API v2 recipes for querying records, upserting companies/people/deals, writing notes/tasks/comments, managing lists, and handling webhooks.

desplega-ai/agent-swarm · 39 tokens

scheduled-task-resilience

Guardrails for polling, scheduled jobs, and long-running external operations. Use whenever a task waits on CI, builds, deploys, browser jobs, or another asynchronous API so work survives heartbeat checks without duplicate delivery.

desplega-ai/agent-swarm · 48 tokens