Task Decomposition

Breaking complex tasks into smaller, manageable subtasks to overcome limitations like context window constraints in AI systems.

Key Principles

  • Atomicity: Subtasks must be small enough to complete within context window limits (e.g., <1k tokens for AI agents).
  • Sequential Dependencies: Subtasks ordered to build incrementally (output of one informs next).
  • Context Minimization: Each subtask uses only necessary context from prior steps.

AI Coding Workflow (Claude Implementation)

  • Problem: AI agents fail at “one-shot” large code generation due to context window limitations.
  • Solution: Decompose coding tasks into iterative, context-aware subtasks.
  • Workflow:
    • Break feature into atomic steps (e.g., “parse input”, “validate data”, “generate output”).
    • For each step:
      • Generate code snippet.
      • Validate against constraints.
      • Pass result to next subtask.

Advanced Orchestration Examples

References