Anthropic Says Fold Your Subagents. Let's Build a Tiny Single Agent Loop in TypeScript
Описание и применение
В статье описывается переход от иерархической архитектуры агентов к единому циклу, где навыки и инструменты загружаются по мере необходимости, сокращая длину подсказки и улучшая качество.
Задача
Organizational agent architectures create long prompts and lose context through handoffs.
Результат
Running npx tsx loop.ts demonstrates a single loop handling a refund by loading only necessary skills and tools, then stopping at a write gate.
Рабочий процесс
- Define a two‑level catalog of skills and tools.
- Expose only the catalog (names and short descriptions) to the model at start.
- Implement loader tools that fetch full skill or tool definitions when needed.
- Run the agent loop with a limit on context size and a write gate.
- Execute the loop for a refund scenario, loading only required components.
- Terminate after the write gate is reached.
- Measure performance and compare to org‑chart approach.
Доказательства
using fewer subagents in favor of progressively disclosed context and tools can improve quality while reducing cost and latency.
By the end, you'll run one command: npx tsx loop.ts
- Дата записи: 2026-10-25T22:11:22.881Z