CertSafari
    Anthropic Claude Certified Architect – Professional (CCAR-P)· Lessons

    Domain 1 · Lesson 2/38

    End-to-End Claude Architecture: Input, Processing, Output and Feedback Loops

    Design end-to-end architectures

    11 min read
    2.83% of exam
    4 sources
    Published 4 Oct 2026
    Docs as of 30 Sep 2026

    What you will be able to do

    • Turn a business requirement into the simplest Claude design that meets it, and say when a workflow or an agent is justified
    • Trace a request from input through context assembly, the model call and tool execution to output
    • Decide where each tool runs (your application or Anthropic's servers) and what your code is responsible for
    • Design a feedback loop that grades output against explicit criteria and sends the feedback back for another iteration

    Key concept

    Workflows vs. agents — Both are agentic systems. A workflow sends the model and tools down code paths you fixed in advance. An agent lets the model decide its own steps and tool calls. Choosing between them is the first decision in any end-to-end design.

    1.From business requirement to the simplest design that works

    An end-to-end architecture starts with a requirement, not a pattern. Anthropic's guidance is to find the simplest solution that works and add complexity only when it is needed. Sometimes that means not building an agentic system at all. Complexity has a price: agentic systems often accept extra latency and cost in exchange for better task performance. So the architect's first job is to decide whether the requirement justifies that trade.

    The basic building block is the augmented LLM: a model enhanced with retrieval, tools and memory, which it can use on its own initiative. For many applications, one well-optimized call to an augmented LLM is the whole architecture. Retrieval and in-context examples are often enough. Some tasks need no tools at all. The tool-use documentation says summarization, translation and general-knowledge questions do not need a tool round trip.

    When more complexity is justified, the next choice is between a workflow and an agent. A workflow fits a well-defined task, because its fixed code path gives predictable and consistent results. An agent fits when you need flexibility and decisions made by the model at scale. If you use a framework such as the Claude Agent SDK, make sure you understand the code underneath. Frameworks can add layers of abstraction that hide the actual prompts and responses.

    Checkpoint 1 of 6· Check yourself

    A support team wants Claude to answer product FAQs using the company's help-centre articles. Answers have no side effects, and the questions are well understood. What should the architect try first?

    Sources12

    2.Input → processing → output: the agent loop

    Once a design includes tools, every request goes through the same loop. On the input side, Claude receives more than the user's prompt. The system prompt, the tool definitions and the conversation history are assembled around it. That assembled context is everything the model knows when it decides what to do.

    Processing is a cycle. Claude evaluates the current state and replies with text, one or more tool-call requests, or both. The tools run, and each set of results goes back to Claude for its next decision. Each full cycle is one turn, and turns repeat until Claude replies without calling a tool. Your application can also step in during the loop: hooks can intercept, modify or block a tool call before it runs. On the output side, the SDK emits a final result message containing the answer, token usage, cost and session ID. These are the figures you need to judge the design against its business targets.

    Stages of one Agent SDK run and what your application sees
    StageWhat happensMessage yielded
    Receive promptPrompt arrives with system prompt, tool definitions and historySystemMessage (subtype "init")
    Evaluate and respondClaude replies with text, tool calls, or bothAssistantMessage per content block
    Execute toolsSDK runs each requested tool and returns results to ClaudeUserMessage with tool result content
    Return resultFinal text-only response, then the run endsResultMessage with final text, token usage, cost, session ID

    If you call the Messages API directly instead of using the SDK, you write this loop yourself. It is keyed on stop_reason. As long as the reply comes back with "tool_use", you run the tools and continue the conversation. Any other stop reason ("end_turn", "max_tokens", "stop_sequence" or "refusal") ends the loop, and your application has to handle it.

    Checkpoint 2 of 6· Put it in order

    Put the steps of a client-side tool loop on the Messages API in order.

    1. 1.Execute each tool and format the outputs as tool_result blocks
    2. 2.Repeat while stop_reason is "tool_use"
    3. 3.Send a request with your tools array and the user message
    4. 4.Claude responds with stop_reason "tool_use" and one or more tool_use blocks
    5. 5.Send a new request with the original messages, the assistant's response and the tool_result blocks

    Checkpoint 3 of 6· Exam question

    A team is designing the processing stage of a customer-support architecture. Support tickets arrive continuously and must be triaged with strong reasoning about edge cases, but the team has a strict per-ticket cost ceiling and wants to avoid over-provisioning intelligence. Which approach best fits the input-to-processing handoff for this architecture?

    Sources3

    3.Tool execution: who runs the code, and when tools belong in the design

    Tool use is a contract. You declare which operations exist and what their inputs look like, and Claude decides when to call them. The model never executes anything itself. It emits a structured request, something else runs the operation, and the result comes back into the conversation. Claude sees only the schema and the result, never your implementation. The main architectural question is therefore where the code runs, because that decides what your application must build.

    Tool categories and what each one leaves to your application
    ApproachWhen to use itYour responsibility
    User-defined client toolsCustom business logic, internal APIs, proprietary dataWrite the schema, execute the call, drive the agentic loop
    Anthropic-schema client tools (memory, bash, text_editor, computer, browser)Standard dev operationsExecute the call; the schema is trained-in, so Claude calls it reliably
    Server-executed tools (web_search, web_fetch, code_execution, tool_search)Web search, code sandbox, web fetchEnable the tool and read results; Anthropic runs the loop

    Server tools run their own loop on Anthropic's infrastructure, and that loop has an iteration limit. If the model hits the limit while it is still working, the response comes back with stop_reason: "pause_turn" instead of "end_turn". The work is unfinished, so you re-send the conversation to let it continue. Control also returns to you early when Claude calls a server tool and a client tool in the same parallel group.

    Tools belong in a design when the model cannot do the job from text alone. That covers actions with side effects, fresh or external data, outputs that must have a guaranteed structure, and calls into existing systems. They do not belong when every call adds a round trip whose cost outweighs a trivial task. One sign is reliable: if you are parsing free-form output to recover a decision, that decision should have been a tool call.

    Checkpoint 4 of 6· Check yourself

    A pipeline asks Claude to approve or reject an expense claim in prose. A regex then pulls 'APPROVED' or 'REJECTED' out of the reply. What is the architectural fix?

    Sources2

    4.Closing the loop: feedback and iterative refinement

    An end-to-end design does not stop at the first output. A feedback loop sends an assessment of that output back to the model so it can improve the work. The basic pattern is evaluator-optimizer: one LLM call generates a response, and another evaluates it and gives feedback, in a loop. It fits when two things are true. First, there are clear evaluation criteria. Second, iterative refinement adds measurable value. In practice, a response must improve when someone articulates feedback, and an LLM must be able to give that feedback itself.

    Claude Managed Agents builds this loop in as outcomes. You describe what 'done' looks like and supply a rubric, which is required. The harness then sets up a grader that scores the artifact against the rubric and returns its explanation to the agent for the next iteration. The grader runs in a separate context window, so the main agent's implementation choices do not influence it. Write each rubric criterion so it can be graded on its own. For example, 'The CSV contains a price column with numeric values' works, but 'The data looks good' does not.

    Starting an outcome-oriented session: a description, a rubric, and an optional iteration cappython
    client.beta.sessions.events.send(
        session_id=session.id,
        events=[
            {
                "type": "user.define_outcome",
                "description": "Build a DCF model for Costco in .xlsx",
                "rubric": {"type": "text", "content": RUBRIC},
                # or: "rubric": {"type": "file", "file_id": rubric.id},
                "max_iterations": 5,  # optional; default 3, max 20
            }
        ],
    )
    How each evaluation result steers the loop
    resultWhat happens next
    satisfiedSession transitions to idle
    needs_revisionAgent starts a new iteration cycle
    max_iterations_reachedOne final acknowledgment turn, then idle; no further evaluation
    failedSession transitions to idle; the rubric does not apply to the deliverables

    Checkpoint 5 of 6· Check yourself

    Why does the Managed Agents outcome grader evaluate the artifact in its own context window?

    Checkpoint 6 of 6· Exam question

    An architect is building an agent that must read internal wiki pages, query a ticketing database, and post replies to a chat tool. The team wants to avoid writing and maintaining custom tool-execution code for each integration and wants the agent to autonomously decide when to call each system. Which architecture choice best satisfies this?

    Sources14

    Exam traps

    Each one states something that sounds right. Open it to see what is actually true.

    1. 1.With server tools such as web_search, your application still has to build and send a tool_result block after each call.Why is that wrong?

      Anthropic runs server tools and loops over them itself. You enable the tool and read the results. The exceptions are a pause_turn response and a turn that also calls a client tool.

      Covered in Tool execution: who runs the code, and when tools belong in the design

    2. 2.A short, holistic rubric such as 'output is high quality' is enough for a grader-driven feedback loop.Why is that wrong?

      The grader scores each criterion separately, so vague criteria produce noisy feedback. Write criteria that are explicit and can each be graded.

      Covered in Closing the loop: feedback and iterative refinement

    Sources

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “we recommend finding the simplest solution possible, and only increasing complexity when needed”
      ↩︎ From business requirement to the simplest design that works
      “workflows offer predictability and consistency for well-defined tasks, whereas agents are the better option when flexibility and model-driven decision-making are needed at scale”
      ↩︎ From business requirement to the simplest design that works
      “This workflow is particularly effective when we have clear evaluation criteria, and when iterative refinement provides measurable value.”
      ↩︎ Closing the loop: feedback and iterative refinement
      “Workflows are systems where LLMs and tools are orchestrated through predefined code paths.”
      ↩︎ Key concept
      “For many applications, however, optimizing single LLM calls with retrieval and in-context examples is usually enough.”
      ↩︎ Checkpoint
    2. 2.
      “Summarization, translation, and general-knowledge questions don't need a tool round trip.”
      ↩︎ From business requirement to the simplest design that works
      “If the model is still iterating when it hits the cap, the response comes back with stop_reason: "pause_turn" instead of "end_turn".”
      ↩︎ Tool execution: who runs the code, and when tools belong in the design
      “Every tool call is at least one extra round trip; for lightweight tasks the overhead can exceed the work.”
      ↩︎ Tool execution: who runs the code, and when tools belong in the design
      “You never construct a tool_result block for these tools.”
      ↩︎ Exam trap 1
      “Repeat from step 2 while stop_reason is "tool_use".”
      ↩︎ Checkpoint
      “if you're writing a regex to extract a decision from model output, that decision should have been a tool call.”
      ↩︎ Checkpoint
    3. 3.
      “Claude receives your prompt, along with the system prompt, tool definitions, and conversation history.”
      ↩︎ Input → processing → output: the agent loop
      “Each set of tool results feeds back to Claude for the next decision.”
      ↩︎ Input → processing → output: the agent loop
      “Contains the final text result, token usage, cost, and session ID.”
      ↩︎ Input → processing → output: the agent loop
      “Claude continues calling tools and processing results until it produces a response with no tool calls.”
      ↩︎ Prediction
    4. 4.
      “That feedback is handed back to the agent for the next iteration.”
      ↩︎ Closing the loop: feedback and iterative refinement
      “The grader scores each criterion independently, so vague criteria produce noisy evaluations.”
      ↩︎ Exam trap 2
      “The grader uses a separate context window to avoid being influenced by the main agent's implementation choices.”
      ↩︎ Checkpoint

    Continue to page 2 of 2

    Claude Architecture Patterns: Workflows, Orchestrator-Workers and Multi-Agent Trade-offs

    Spotted a mistake, or was something unclear? Tell us.