0Pricing
Claude Architect · 강의

고정 파이프라인과 적응형 분해

단계가 정해진 작업에는 프롬프트 연결을, 열린 작업에는 적응형 방식을 사용합니다

고정 파이프라인과 적응형 분해은(는) CoddyKit의 무료 Claude Architect 강의입니다. 이것은 4개 중 1번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Claude Architect 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Claude Architect 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

Two Ways to Break Down Work

When a task is too big for a single prompt, you decompose it. There are two fundamental strategies, and choosing the right one is a core architecture skill.

  • Fixed pipeline (prompt chaining): you hard-code a known sequence of steps. Step 1 feeds Step 2 feeds Step 3.
  • Adaptive decomposition: the model decides what to do next based on what it discovers, looping until the goal is met.

The rule of thumb: fixed pipelines for known sequential steps; adaptive for open-ended investigations. This lesson makes that decision precise.

Fixed Pipeline = Prompt Chaining

A fixed pipeline is just prompt chaining: you orchestrate a deterministic sequence in your own code. You know the steps in advance, so you wire them up explicitly. Each call does one focused job, and its output becomes the next call's input.

Because you control the order, the flow is predictable, debuggable, and cheap to reason about. There is no model-driven branching about what to do next — only the work inside each step.

# Fixed pipeline: extract -> classify -> summarize
from anthropic import Anthropic
client = Anthropic()

def step(system, user):
    r = client.messages.create(
        model="claude-sonnet-4-5",
        max_tokens=1024,
        system=system,
        messages=[{"role": "user", "content": user}],
    )
    return r.content[0].text

entities = step("Extract entities as JSON.", document)
category = step("Classify this record.", entities)
summary  = step("Write a one-line summary.", category)

When a Fixed Pipeline Wins

Reach for a fixed pipeline when the work has a stable, known shape:

  • The steps are the same every run (extract, then validate, then format).
  • Order matters and rarely changes.
  • You want predictable cost, latency, and easy debugging.
  • Each stage has a clear, narrow responsibility.

Classic example: structured data extraction. Extract fields, then run a validation/retry pass, then attach provenance. You always do those three things, in that order — so chain them.

Adaptive Decomposition = Model-Driven

Adaptive decomposition hands the planning to the model. You give it tools and a goal; it inspects results and chooses the next action. This is the agentic loop: send a request, inspect the stop_reason, and if it's tool_use, run the tools, append results to history, and repeat until end_turn.

You cannot pre-wire the path because you don't know it in advance — it depends on what each step reveals.

# Adaptive: the model decides which tool to call next
while True:
    resp = client.messages.create(
        model="claude-sonnet-4-5",
        max_tokens=2048,
        tools=tools,
        messages=messages,
    )
    if resp.stop_reason == "tool_use":
        results = run_tools(resp)          # execute requested tools
        messages.append({"role": "assistant", "content": resp.content})
        messages.append({"role": "user", "content": results})
        continue
    break  # terminate on stop_reason, never by parsing text

When Adaptive Decomposition Wins

Choose adaptive decomposition for open-ended investigations where the path can't be known ahead of time:

  • Debugging from a vague symptom — you grep, read, then grep usages based on what you find.
  • Multi-source research where follow-up queries depend on earlier answers.
  • Customer support where the next action depends on what a lookup returns.

Here the branching IS the work. A rigid pipeline would either miss paths or explode into unmaintainable conditionals.

Terminate on stop_reason, Not on Text

The single most common adaptive-loop mistake on the exam: ending the loop by scanning the model's text for words like "done" or "finished." Don't. Decisions are model-driven; terminate on the API stop_reason.

The loop ends when stop_reason is end_turn. While it's tool_use, you keep going. An iteration cap is a safety net only — never the primary stop mechanism. Reserve hard-coded control for guarantees, not for deciding when the work is conceptually complete.

# WRONG: parsing text for completion
if "done" in resp.content[0].text.lower():
    break

# RIGHT: drive on stop_reason; cap is only a safety net
MAX_STEPS = 25
for _ in range(MAX_STEPS):
    resp = client.messages.create(...)
    if resp.stop_reason != "tool_use":
        break  # end_turn / max_tokens / stop_sequence

Hybrid: Pipelines Containing Adaptive Stages

Real systems mix both. The outer flow is often a fixed pipeline, but one stage may be an adaptive agentic loop. You get the predictability of chaining at the macro level and flexibility where you genuinely need it.

Example: an extraction pipeline whose middle stage is an adaptive "resolve ambiguities" agent that may call lookup tools an unknown number of times — wrapped by a deterministic validate-and-format stage before and after.

# Outer = fixed chain; one stage = adaptive loop
raw      = extract_stage(document)        # fixed
resolved = adaptive_resolver(raw)         # agentic loop inside
final    = validate_and_format(resolved)  # fixed

Multi-Pass Code Review: A Decomposition Choice

Decomposition isn't only about pipelines vs loops — it's also about how you split a task to protect the model's attention. Multi-file code review is the canonical case.

A single pass over many files dilutes attention and misses both local bugs and integration issues. The fix is a deliberate decomposition: a per-file local pass first, then a separate cross-file integration pass. Two focused passes beat one unfocused pass.

# Decompose review into focused passes
for f in changed_files:
    review_local(f)          # pass 1: per-file, focused

review_cross_file(changed_files)  # pass 2: integration concerns

Coordinators Decompose Adaptively

In a hub-and-spoke multi-agent system, the coordinator decomposes the goal, delegates to subagents, then aggregates. This is adaptive decomposition at the orchestration layer — the coordinator decides how to split based on the request.

Critical: subagents do not inherit the coordinator's conversation history. Every subagent prompt must carry its full context explicitly. Multiple Task calls in one response run in parallel — useful when sub-problems are independent.

# Coordinator delegates with explicit, self-contained context
subagent_prompt = f"""You are researching ONE sub-topic.
Context (do not assume shared history):
  Goal: {goal}
  Sub-topic: {subtopic}
  Constraints: {constraints}
Return findings with source citations."""

Sessions: Resume, Fork, or Start Fresh

Adaptive work often spans sessions. Claude Code gives you --resume <name> to continue a named session and fork_session to branch from a shared point and explore alternatives in parallel.

But beware: resumed tool results can be stale if the codebase changed since. Sometimes a fresh session seeded with a structured summary beats resuming — you get current state plus the distilled context, without dragging outdated tool output along.

# Continue a named session
claude --resume refactor-auth

# Branch to explore an alternative path
# fork_session creates a sibling from the shared point

# When code moved on, prefer a fresh session + summary
claude -p "Here is a structured summary of prior work: ..."

A Decision Checklist

Before you build, ask:

  • Do I know the steps in advance, in a fixed order? -> fixed pipeline / prompt chaining.
  • Does the next step depend on what earlier steps reveal? -> adaptive agentic loop.
  • Mostly fixed with one uncertain stage? -> hybrid: chain the outer flow, embed an adaptive loop.
  • Reviewing many files? -> decompose into per-file then cross-file passes.

And always: terminate adaptive loops on stop_reason, with iteration caps only as a safety net.

Quick Check

A scenario-based decision on choosing a decomposition strategy.

Recap

Key takeaways:

  • Fixed pipeline (prompt chaining) for known, ordered steps — predictable, debuggable, cheap.
  • Adaptive decomposition for open-ended investigations where the next step depends on what you discover.
  • Hybrid is common: a fixed outer flow with an adaptive stage embedded.
  • Always terminate adaptive loops on stop_reason (end_turn); iteration caps are a safety net, never the primary stop. Never parse text for "done."
  • For multi-file review, decompose into a per-file pass then a separate cross-file pass.
  • Subagents don't inherit history — pass context explicitly. Resume sessions carefully; a fresh session with a structured summary can beat stale resumed tool results.

자주 묻는 질문

“고정 파이프라인과 적응형 분해” 강의는 무료인가요?

네 — “고정 파이프라인과 적응형 분해” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Claude Architect 강의 전체를 잠금 해제할 수 있습니다. Claude Architect 강의에는 총 4개의 강의가 포함되어 있습니다.

“고정 파이프라인과 적응형 분해”에서 뭘 배우나요?

단계가 정해진 작업에는 프롬프트 연결을, 열린 작업에는 적응형 방식을 사용합니다 브라우저에서 직접 실행하는 실습 코드로 Claude Architect을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

Claude Architect을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 Claude Architect은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 1번째 강의입니다.

“고정 파이프라인과 적응형 분해” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 Claude Architect 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 Claude Architect 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. 고정 파이프라인과 적응형 분해
  2. 다중 패스 분해
  3. 세션 관리
  4. 오래된 컨텍스트와 새로 시작하기
← Claude Architect(으)로 돌아가기