CCAR-F practice question 10 of 10

You are building developer productivity tools using the Claude Agent SDK. The agent helps engineers explore unfamiliar codebases, understand legacy…

Full set: 191 questions
You are building developer productivity tools using the Claude Agent SDK. The agent helps engineers explore unfamiliar codebases, understand legacy systems, generate boilerplate code, and automate repetitive tasks. It uses the built-in tools (Read, Write, Bash, Grep, Glob) and integrates with Model Context Protocol (MCP) servers. Your agent has analyzed a complex service module—reading 23 source files, tracing request flows, and identifying error handling patterns. A developer wants to compare two testing strategies before committing to one: end-to-end tests with mocked external services vs. snapshot tests capturing expected outputs. They need to independently develop both approaches to evaluate trade-offs. How should you manage the sessions?
Answer options
A: Resume the analysis session with fork_session enabled, creating a separate branch for each testing strategy. Correct answer
B: Start two fresh sessions, having each re-read the relevant source files before beginning.
C: Continue in the original session, developing end-to-end tests first, then snapshot tests sequentially.
D: Export the analysis session’s key findings to a file, then create two new sessions that reference this file.
Correct Answer:
A. Resume the analysis session with fork_session enabled, creating a separate branch for each testing strategy.
Explanation

The most efficient and effective approach is to fork the existing session. The initial analysis, which involved reading 23 files and tracing flows, has created a rich, valuable context. The forksession feature is specifically designed for this scenario, allowing the creation of two new, independent child sessions that inherit the complete state and context of the parent. This enables the parallel and isolated development of both testing strategies without repeating the costly initial analysis. Each branch can then proceed without interfering with the other, providing a clean environment for comparing the two approaches.

Why Incorrect

B. Start two fresh sessions, having each re-read the relevant source files before beginning. This is highly inefficient as it discards the completed analysis and duplicates the expensive initial work for both new sessions.
C. Continue in the original session, developing end-to-end tests first, then snapshot tests sequentially. This fails the requirement for independent development, as the state and artifacts from the first strategy would influence the second.
D. Export the analysis session’s key findings to a file, then create two new sessions that reference this file. This is a lossy and cumbersome workaround. A summary file cannot capture the full, nuanced context that is preserved by forking.

References

1. Anthropic Claude Documentation, "Tool use": The documentation explains that Claude's ability to use tools effectively relies on the context built throughout a conversation. The model uses the entire history of user prompts, assistant responses, and tool results to inform its next action. Forking a session is the canonical method to leverage this accumulated context for exploring divergent, parallel paths without losing the initial state. (Reference: docs.anthropic.com/claude/docs/tool-use, Section: "How to prompt for tool use").

2. Anthropic Claude Documentation, "Building with Claude": In designing complex, multi-turn interactions with agents, maintaining and manipulating state is critical. The principle of session management, including branching or forking, allows developers to build sophisticated applications where different possibilities can be explored from a common contextual starting point, which is essential for tasks like comparing alternative solutions. (Reference: docs.anthropic.com/claude/docs/building-with-claude, Section: "Building conversational experiences").

Scroll to Top