Sequential Flow Pattern (Claude Code)¶
The Sequential Flow Pattern is the most fundamental workflow mode within [[Claude Code]]. It involves processing tasks in a linear, consecutive sequence within a single terminal session^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md].
In this pattern, the context accumulates progressively as tasks are completed one after another^[001-TODO__Claude_Code_5种Agent模式_-从顺序流到自主工作流.md]. This is suitable for workflows where subsequent steps rely on the completion or output of previous steps, such as building a page, adding a hero image, and then adding a form^[001-TODO__Claude_Code_5种Agent模式-_从顺序流到自主工作流.md].
Context Accumulation and Rot¶
As the session progresses, the context window fills up. This is visually indicated by a growing green progress bar^[001-TODO__Claude_Code_5种Agent模式_-从顺序流到自主工作流.md]. A critical limitation of this pattern is "Context Rot," where the accumulated information eventually causes the model to start forgetting details or fail to retrieve previous information^[001-TODO__Claude_Code_5种Agent模式-_从顺序流到自主工作流.md].
Mitigation Strategies¶
To delay or manage the impact of Context Rot, several commands and structural tools are used^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md]:
- Structured Context: Using a well-structured
claude.mdand [[Skills]] allows the model to load and unload information on demand rather than holding everything in active memory^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md]. - Compaction: The
/compactcommand can be used to retain a summary of the conversation, reducing the token count while preserving key points^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md]. - Clearing: The
/clearcommand is used to wipe the context and start fresh^[001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md].
Despite these mitigations, the Sequential Flow Pattern will eventually hit a hard limit as the complexity of the session grows^[001-TODO__Claude_Code_5种Agent模式_-从顺序流到自主工作流.md]. At this point, it is necessary to upgrade to more complex patterns such as the [[Operator Pattern (Claude Code)]]^[001-TODO__Claude_Code_5种Agent模式-_从顺序流到自主工作流.md].
Related Concepts¶
- [[Operator Pattern (Claude Code)]]
- [[Split & Merge Pattern (Claude Code)]]
- [[Agent Teams Pattern (Claude Code)]]
- [[Headless Pattern (Claude Code)]]
Sources¶
001-TODO__Claude_Code_5种Agent模式_-_从顺序流到自主工作流.md