Skip to main content
LLMs degrade as context windows fill up. The more history an agent accumulates, the more likely it is to lose focus, repeat mistakes, or forget earlier instructions. Twill addresses this through deliberate context management.

Sub-Agent Architecture

Twill splits work across specialized sub-agents so each step runs with a focused context. See How Twill Works for the full workflow (planning, implementation, environment setup when needed, verification, review, and commits). The key idea is that each sub-agent starts with only what it needs: the Planning Agent doesn’t carry implementation details, and the Code Agent doesn’t carry long verification logs. This keeps each agent operating in its optimal context range.

Verification Loops

After implementation, Twill runs verification and a focused code review. If issues are found:
  1. Results are summarized (not dumped verbatim)
  2. Code agent receives a focused description of what to fix
  3. Agent makes corrections
  4. Verification runs again
This loop continues until everything passes. The key is that each iteration starts with a clean, relevant context—not an ever-growing log of previous attempts.

Why This Matters

A single agent running for hours will accumulate thousands of tokens of context: file contents, command outputs, error messages, previous attempts. By the time it’s debugging its third issue, it’s operating with degraded attention. Sub-agents avoid this. Each one runs, completes its task, and hands off a summary. The next agent starts fresh with exactly the context it needs.