CCDV-F practice question 8 of 10

Your Claude application runs long agentic workflows where the agent makes many tool calls, and the conversation history grows quickly. After about 20 tool calls, you notice the agent's responses become less focused and sometimes ignore earlier task constraints. How would you address this?

Full set: 95 questions
Answer options
A: Remove tool calling from the workflow entirely so the agent operates as a single text-generation step with no tool outputs accumulating in the context window.
B: Apply context engineering techniques such as tool output pruning or compaction to keep the active task state visible while reducing the volume of older content. Correct answer
C: Increase the model's context window so the agent can hold every tool output at full detail across the entire workflow no matter how many tool calls it accumulates.
D: Restart the agent every five tool calls to prevent any drift, with the agent losing all task state at each restart point during the workflow.
Correct Answer:
B. Apply context engineering techniques such as tool output pruning or compaction to keep the active task state visible while reducing the volume of older content.
Explanation

In long-running agentic workflows, accumulating tool calls and their outputs can lead to context bloat, causing the model to lose focus, degrade in reasoning quality, or forget initial constraints. Anthropic recommends context management techniques such as pruning irrelevant tool outputs, summarizing past turns, or compacting the history. This keeps the active task state visible and maintains a focused, efficient context window without exceeding limits or degrading performance.

Why Incorrect

A: Removing tool calling eliminates the agent's ability to interact with external systems, defeating the purpose of the workflow. C: Simply increasing the context window does not solve the degradation of focus (the "lost in the middle" effect) and increases costs and latency. D: Restarting and losing all task state prevents the agent from completing complex tasks that require memory of previous steps and context.

References

- Anthropic Official Documentation: "Prompt engineering", Managing long contexts and context windows.

- Anthropic Official Documentation: "Building effective agents", Memory and context management in agentic loops.

Scroll to Top