Claude Code Orchestrates Sub-Agents into Scripts, Only the Final Answer Is Visible in the Main Context
Ado Kukic, a Developer Relations staff member at Anthropic, demonstrates Claude Code's dynamic workflow: when prompted with "use a workflow", Claude writes a script to run a full set of sub-agents. All loops and intermediate results stay contained in the code, and only the final answer is passed to the main context.
Ado Kukic from Anthropic's Developer Relations team published the demo for Advent of Claude 2026 Day 1. The short demo works as follows: say "use a workflow" in Claude Code, and Claude will generate a script to run a full suite of sub-agents. All loops and intermediate results are stored within the code, so the main context only receives the final answer.
This development comes against the backdrop that Claude Code already supports sub-agents. Sub-agents are great for splitting complex tasks, but too many split subtasks will fill the main conversation with endless intermediate outputs. The extended context drives up costs and makes the model's attention scattered easily. The dynamic workflow approach essentially moves orchestration from the conversation thread to independent scripts: the model writes the workflow logic, the script executes the process, and sub-agents handle specific assigned tasks. This drastically reduces unnecessary noise in the main context.
There is a key detail in Ado's description: the main context will only ever see the final answer. The intermediate process does not disappear — it remains fully preserved in the script execution. You can check the code and runtime records for troubleshooting when necessary, and the main thread only holds the conclusion when no debugging is needed. This tradeoff is extremely practical.
Impressive as the demo is, you should not treat this feature as a universal magic button. Whether the workflow is written correctly and whether tasks are split reasonably still depends on the model capability and prompt quality. Scripts can control execution loops, but they cannot resolve vague and ambiguous task goals. For developers, this direction is well worth paying attention to: in the future, when asking AI to complete complex tasks, you may first let it write a full task-running program, and then let the program call a group of agents to finish the work.
If you are using Claude Code right now, you can try writing your repeated subtasks into workflows to see if your main context stays much cleaner.
Source: Original post by Ado Kukic
via AIHOT
发布时间: 2026-12-02 00:17