Skip to content

Instantly share code, notes, and snippets.

@ctalladen78
Last active February 3, 2026 21:27
Show Gist options
  • Select an option

  • Save ctalladen78/7750a818e21d5c3b311790db1dac8f26 to your computer and use it in GitHub Desktop.

Select an option

Save ctalladen78/7750a818e21d5c3b311790db1dac8f26 to your computer and use it in GitHub Desktop.

blog.langchain.com/how-agents-can-use-filesystems-for-context-engineering

recursive subagent worker orchestration pattern

  • main orchestrator agent uses ralph wiggum loop technique to parse the prd.md file and decompose into steps and delegate todos steps to subagents
  • spawn isolated subagent with minimum necessary tools to complete a list of todo tasks
  • spawns subagents with access to skills
  • subagents use isolated venv temp files for work to avoid race condition
  • uses tmux to maintain session lifecycle
  • uses tmux to coordinate and communicate with subagent workers
  • isolated subagent has a fresh context window with minimum necessary message from parent orchestrator
  • subagents asynchronously and concurrently for the parent orchestrator
  • subagents may not spawn their own subagents
  • subagents use the ralph wiggum loop technique in a concurrency in their own temporary environment with locks
  • orchestrator uses progress.md to document session information and tokens used in summary and subagent workers used, number of tasks per worker, bugs, issues, and session summary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment