CCDV-F : Applications & Integration (Domain 2)
Domain 2 : Applications and Integration
The Claude Certified Developer – Foundations (CCDV-F) certification represents the authoritative credential for engineers building, integrating, and shipping production-grade applications on the Anthropic platform. Domain 2, “Applications and Integration,” is the most significant portion of the CCDV-F examination, carrying a weight of 33.1%. This domain focuses on the practical bridge between Claude’s raw intelligence and functional software systems, requiring a deep understanding of API mechanics, engineering foundations, and configuration management.
2.1 Translating Business Requirements into Claude Technical Schemas
The first stage of developing a Claude-powered application involves the translation of high-level business requirements into technical specifications. This process requires identifying both functional and infrastructure requirements based on the solution architecture.
Functional and Infrastructure Requirements
In the context of the CCDV-F, requirements gathering must account for the specific behaviors of Large Language Models (LLMs). Developers must define:
- Content Boundaries: Establishing what information the model can access and where the limits of its generation lie.
- Technical Schemas: Designing the JSON structures required for structured output and tool definitions. This ensures that the model’s responses can be programmatically consumed by the rest of the application stack.
- Infrastructure Selection: Deciding between self-hosted deployment models and Anthropic-hosted models, and determining if the application requires realtime interaction or can leverage asynchronous processing.
Requirement Mapping Table
| Business Need | Technical Implementation Requirement |
|---|---|
| High-volume, non-urgent data processing | Message Batches API implementation |
| Immediate user interaction | Messages API with Server-Sent Events (SSE) streaming |
| Recurring complex instructions | Prompt Caching implementation to reduce latency/cost |
| Interaction with external databases | Model Context Protocol (MCP) or Custom Tool schemas |
| Codebase modernization | Claude Code integration with CLAUDE.md configuration |
2.2 AI Systems Life Cycle Management for Claude Applications
Subdomain 2.2 addresses the management of IT systems through their entire life cycle: development, implementation, operation, and maintenance. In Claude application development, the Systems Life Cycle (SDLC) is influenced by the non-deterministic nature of LLMs.
Life Cycle Phases for Claude Applications
- Development and Prototyping: Utilizing the Messages API to test prompt engineering and initial tool schemas.
- Implementation: Integrating the model into the application code using the Claude SDK (Python, TypeScript, Java, Go, or Ruby). This phase includes setting up identity and access management and secret keys.
- Operation: Monitoring model performance, token usage, and costs. This stage often involves the use of “hooks” for deterministic actions or safety guardrails.
- Maintenance and Evolution: Handling breaking changes across model releases and performing large-scale refactoring as new capabilities (like Claude 4.5 features) become available.
SDLC Integration
Effective Claude development integrates model updates and prompt versioning into standard version control workflows. This ensures that changes to model behavior are tracked alongside application code changes, facilitating easier debugging and rollback if performance drifts.
2.3 Mastering Claude API Mechanics: Messages API and Payloads
The Claude Messages API is the primary interface for interacting with Anthropic’s models. Understanding its payload structure and data access patterns is critical for any developer.
Messages API Payload Structure
The Messages API requires a structured request that typically includes:
- Model: Identifying the specific version (e.g., Claude 4.5 Sonnet, Claude 4.5 Opus).
- Messages: An array of objects containing the conversation history. Each object specifies a “role” (user or assistant) and “content.”
- System Prompt: Optional instructions provided outside the message array to define the model’s persona or rules.
- Max Tokens: A limit on the number of tokens the model can generate in a single response.
- Tools: (If applicable) Definitions of external functions the model can invoke.
Server-Sent Events (SSE) Streaming
For applications requiring low perceived latency, such as chat interfaces, Claude supports streaming responses via Server-Sent Events (SSE). Instead of waiting for the entire response to be generated, the API sends a stream of tokens as they are produced. This requires asynchronous programming patterns on the client side to handle the incoming events and update the user interface in real-time.
Message Batches API for Asynchronous Processing
The Message Batches API is designed for high-volume, latency-tolerant tasks. It allows developers to send multiple Messages API requests in a single batch.
- Processing Window: Anthropic typically processes these batches within a 24-hour window.
- Cost Efficiency: Batch processing is offered at a reduced cost compared to standard realtime API calls.
- Use Cases: Ideal for large-scale data extraction, sentiment analysis of archives, or any task where an immediate response is not required.
2.4 Advanced Anthropic API Features: Vision, Extended Thinking, and Prompt Caching
Modern Claude models, specifically the Claude 4.5 family, introduce sophisticated mechanics that go beyond simple text processing.
Vision and PDF Support
Claude’s vision capabilities allow it to analyze visual information from images and PDFs.
- Image Analysis: Claude can understand charts, graphs, and extract text from images.
- PDF Extraction: The Files API and PDF support allow Claude to extract text and understand visual content within complex documents, making it a powerful tool for document processing workflows.
Extended and Adaptive Thinking
Extended thinking allows Claude to reason through complex tasks before providing a final answer.
- Effort Levels: Developers can configure the “effort” the model puts into its internal reasoning process.
- Use Cases: Essential for high-stakes solve-tasks, complex coding logic, or multi-step mathematical problems.
- Thinking Payload: The model’s reasoning is often returned in a specific “thinking” block within the content response.
Prompt Caching
Prompt Caching is an optimization technique that allows developers to reuse frequently used context (such as large system prompts, document sets, or conversation histories).
- Performance: Significantly reduces latency for repetitive requests.
- Cost Management: Caching reusable content reduces the number of tokens processed in each call, lowering overall API costs.
- Cache Checkpointing: Strategically placing cache breakpoints in long conversations ensures that the model does not have to re-process the entire history for every new turn.
2.5 Software Engineering Foundations for Claude API Integration
Successful integration of Claude requires a solid foundation in standard software engineering principles. The CCDV-F exam assumes proficiency in these core areas.
Core Technical Foundations
- REST APIs and JSON: The Claude API is REST-based, and communication is handled through JSON. Developers must be fluent in structuring JSON requests and parsing JSON responses, especially when handling “refusals” or malformed structured data.
- Asynchronous Programming: Handling streaming responses (SSE) and managing concurrent API calls requires a deep understanding of async patterns in Python or TypeScript.
- Version Control (Git): Managing model version pinning, prompt versions, and application code within repositories.
- Refactoring: The ability to update codebases to accommodate model release changes or to transition from manual workflows to agentic ones.
Integration with Third-Party Vendors
While Anthropic provides direct APIs, developers may also invoke Claude through third-party vendors such as:
- Amazon Bedrock: Utilizing Anthropic models within the AWS ecosystem.
- Google Cloud Vertex AI: Building Claude-powered applications on Google Cloud infrastructure. Understanding the nuances of these vendor-specific APIs (such as authentication and endpoint structures) is a key requirement for the “Applications and Integration” domain.
2.6 Claude Application Design and Schema Interpretation
Designing a Claude application involves more than just API calls; it requires understanding how the model interprets instructions across different interfaces and maintaining the health of the interaction.
Interface Consistency
Claude’s interpretation of instructions can vary slightly depending on the interface used:
- Claude Code: A CLI-driven interface designed for codebase modernization and engineering tasks.
- Claude Desktop and claude.ai: User-facing chat interfaces.
- API/SDKs: Direct programmatic access for custom applications.
Developers must ensure that instructions and content boundaries are designed to be robust across these different environments, particularly when building tools that might be used by an agent in one interface and a human in another.
Schema Design and Session Hygiene
- Schema Design: Creating precise, typed schemas for tool arguments and structured outputs. This reduces the likelihood of the model generating invalid parameters or confusing the application’s internal logic.
- Session Hygiene: Managing conversation state to prevent “context drift”—where the model loses track of the original goal due to an over-long conversation history. Techniques include pruning tool outputs and compacting context.
- Memory Management: Implementing persistence layers to allow agents or applications to remember user preferences or past interactions across different sessions.
2.7 Configuration Management with CLAUDE.md and Environment Settings
Proper configuration management ensures that Claude applications are maintainable, reproducible, and secure.
The CLAUDE.md Hierarchy
In developer environments, specifically those using Claude Code, the CLAUDE.md file serves as a critical configuration component.
- Project Instructions: Defines the rules, style guides, and specific technical requirements for the project.
- Rules and Skills: Can be used to author custom “Skills” (tools) and define “Rules” for how the model should interact with the repository.
- Hierarchy:
CLAUDE.mdfiles can exist at different levels of a repository to provide localized context for specific sub-directories.
Settings and Version Pinning
- settings.json: Used to configure development environment parameters, plugin dependencies, and interface preferences.
- Model Version Pinning: A critical practice in production environments. Developers should pin their application to a specific model version (e.g.,
claude-3-5-sonnet-20241022) to ensure consistent behavior. Relying on “latest” aliases can lead to unexpected application failures when a new model version is released. - Prompt Versioning: Treating prompts as code by versioning them in repositories. This allows for testing different prompt iterations and rolling back if a new prompt degrades model performance.
2.8 Integrating the Model Context Protocol (MCP) in Claude
The Model Context Protocol (MCP) is an open standard that facilitates the connection between Claude and external data sources or tools.
MCP Components
- MCP Server: A service that exposes specific resources (databases, files, APIs), tools (executable functions), or prompts to a client.
- MCP Client: The application (such as the Claude Messages API or Claude Desktop) that connects to the server.
- MCP Host: The environment where the client and server interact.
Architectural Benefits
MCP provides a standardized way to:
- Expose Resources: Safely providing Claude with read-only access to business data.
- Implement Tools: Allowing the model to perform actions like searching the web or executing code within a controlled environment.
- Maintain Security: Using standard protocols (stdio or sockets) and preserving authentication/authorization layers.
2.9 Agentic Architecture and AI Workflow Patterns
Subdomain 2.5 overlaps significantly with Domain 1 (Agents and Workflows), focusing on how to design multi-step tasks.
Workflow vs. Agent
A central design decision is whether to use a deterministic workflow or an autonomous agent.
- Workflows: Best for tasks with a predictable sequence of steps. The logic is hard-coded in the application.
- Agents: Best for complex, open-ended tasks where the model decides which tools to use and what steps to take based on the goal.
Hierarchical Structures
Advanced applications often utilize manager/subagent hierarchies. A manager agent breaks down a high-level goal into smaller sub-tasks and delegates them to specialized subagents. This context isolation improves task execution by preventing any single agent’s context window from becoming overloaded with irrelevant information.
2.10 Security and Safety Best Practices in Claude Integration
The “Applications and Integration” domain requires a “secure-by-design” approach to prevent the misuse of integrated models.
Defense Against Injection
- Prompt Injection: The risk of a user embedding malicious instructions within their input to override the system prompt.
- Mitigation: Developers should isolate untrusted user input from trusted system instructions. Using “least privilege” for tool access ensures that even if an injection occurs, the model cannot perform destructive actions (like deleting a database).
Safe Deployment Practices
- Content Policy: Implementing guardrail layers to filter harmful content in both inputs and outputs.
- Claude Hooks: Using programmable hooks to intercept model decisions before they are executed. For example, a hook can require a human to approve a refund request generated by a support agent.
- Identity and Secrets Management: Ensuring that API keys and credentials for external systems are managed securely (e.g., via environment variables or secret managers) and never exposed to the model directly.
2.11 Glossary of Key Terms for CCDV-F Domain 2
| Term | Definition |
|---|---|
| Agent | An autonomous system where the LLM determines the control flow and tool usage to reach a goal. |
| Batch API | An asynchronous endpoint for processing non-urgent Messages API requests at a lower cost. |
| CLAUDE.md | A configuration file used to provide project-specific instructions and rules to Claude. |
| Context Drift | The degradation of model performance as a conversation grows too long and irrelevant info accumulates. |
| Extended Thinking | A model feature allowing for internal reasoning steps before generating a final response. |
| Harness | The application code that manages the loop, state, and tool execution for an agent. |
| Hook | A deterministic action or check that intercepts a model’s request to enforce safety or logic. |
| MCP | Model Context Protocol; a standard for connecting models to external tools and data. |
| Messages API | The primary Anthropic API for generating responses based on conversation history. |
| Prompt Caching | An optimization that stores and reuses frequently accessed context to save time and tokens. |
| Refusal | A scenario where the model declines to answer a prompt due to safety filters or constraints. |
| SSE | Server-Sent Events; a standard for streaming realtime data (tokens) from the API to a client. |
| Structured Output | Responses formatted according to a specific JSON schema for programmatic use. |
| System Prompt | High-level instructions provided to Claude to define its persona and operational rules. |
| Token | The basic unit of text processing for LLMs; Claude bills based on input and output tokens. |
2.12 Practice Short-Answer Questions for Domain 2
1. What is the primary benefit of using the Message Batches API for a data extraction project?
- Answer: Cost reduction and high-volume processing.
- Explanation: The Batch API provides a significant discount for tasks that can tolerate a 24-hour completion window.
2. In an SSE streaming implementation, why is the perceived latency lower for the end-user?
- Answer: Tokens are displayed as they are generated.
- Explanation: The user sees the response start immediately rather than waiting for the model to finish the entire generation.
3. What is “model version pinning” and why is it recommended for production?
- Answer: Specifying a fixed model version (e.g.,
claude-3-5-sonnet-20241022) instead of a general alias. - Explanation: This prevents application breakage or behavior changes when Anthropic releases new model updates.
4. How does Prompt Caching help manage the “context window” in a long conversation?
- Answer: It reduces the cost and time needed to re-process long conversation histories.
- Explanation: By caching the history, the model only needs to process the new tokens in the latest turn, keeping the system responsive.
5. What role does JSON play in Claude’s “Tool Use” (Function Calling)?
- Answer: It provides the schema for arguments and the structure for the tool’s output.
- Explanation: Claude identifies the tool to use and generates a JSON object of arguments that the application then executes.
6. What is the difference between an MCP Client and an MCP Server?
- Answer: The Client (e.g., Claude) requests resources, while the Server (the data source) provides them.
- Explanation: The server exposes tools and data through the protocol, which the client then consumes to perform tasks.
7. Why is “session hygiene” important for multi-agent researchers?
- Answer: To prevent context drift and ensure agents stay focused on their specific sub-tasks.
- Explanation: Pruning unnecessary tool outputs or conversation history keeps the context window efficient and accurate.
8. What does a “system prompt” provide that a “user message” does not?
- Answer: High-level persona definition and operational rules that persist throughout the session.
- Explanation: System prompts are handled with higher priority for defining the model’s fundamental constraints and identity.
9. In the context of security, what is “least privilege” for an MCP server?
- Answer: Granting the model only the minimum necessary permissions (e.g., read-only) to perform its task.
- Explanation: This limits the damage if a prompt injection attack manages to manipulate the model’s actions.
10. What is the hierarchy of a CLAUDE.md file within a large repository?
- Answer: Root-level instructions apply globally, while sub-directory files provide local context.
- Explanation: This allows for a modular configuration where specific components of a codebase have their own unique rules.
2.13 Open-Ended Design Questions for Applications and Integration
- Scenario Design: You are building a customer support agent that needs to check order status and process refunds. Design a “hook” system that ensures high-value refunds are never processed without human intervention.
- Architecture Tradeoff: Explain when you would choose to build a custom tool from scratch versus utilizing an existing MCP server for a team that needs to integrate Claude with a company’s internal SQL database.
- Optimization Strategy: A developer is seeing high latency and costs in a coding assistant application that processes large files. Propose a multi-layered optimization strategy involving prompt caching, model selection (Opus vs. Haiku), and the Message Batches API.
- Error Handling: Describe a robust pattern for handling “defensive parsing.” How should your application behave if Claude generates a JSON object that is missing a required field or contains a hallucinated argument?
- Interface Integration: How would you configure
CLAUDE.mdandsettings.jsondifferently for a frontend development project versus a backend data pipeline project to ensure the model provides role-appropriate code refactors?
Leaderboard
No scores saved yet. Be the first!
25 Questions — Domain 2 : Applications and Integration
Expand any question to reveal the correct answer and explanation.
-
1 A production application encounters a 'stop_reason' of 'max_tokens' during a complex code generation task. Which integration pattern correctly implements the 'continuation' logic to ensure a complete output payload?
Consider how the conversation history must be preserved to resume exactly where the model was cut off.
Capture the truncated response, append it to the interaction history as an assistant message, and send a new user turn with a 'continue' instruction.
Following a truncation, the application must maintain state by feeding the partial response back into the history before requesting the remaining tokens.
-
✗ Increase the 'max_tokens' parameter in a recursive call using the original user message until the 'stop_reason' reaches 'end_turn'.
Simply re-sending the original message without the context of the generated partial output would lead to a redundant or entirely different response.
-
✗ Implement a retry logic with an exponential backoff specifically targeting the HTTP 429 rate limit error code.
A 'max_tokens' stop reason is a model-side parameter limit, not a networking or rate-limiting infrastructure failure.
-
✗ Switch the model tier to Claude Opus to leverage its larger default context window and higher token generation ceiling.
Context window and generation limits are distinct; truncation can occur on any model tier if the specific request exceeds its set 'max_tokens' value.
-
-
2 When developing a multi-agent system, an architect identifies a failure where subagents consistently lack the necessary data to perform tasks. What is the most likely cause within the 'subagent trap' framework?
Think about the inheritance�or lack thereof�of message history between independent API calls.
The coordinator agent fails to explicitly package and pass the necessary context to the subagent as isolated user input.
Subagents do not automatically inherit the parent coordinator's context window or tool execution history.
-
✗ The subagent's system prompt is identical to the coordinator's, causing a conflict in the alternating role sequence.
The API allows identical system prompts across different calls; the issue is data persistence, not prompt content collision.
-
✗ The integration layer uses different API keys for the coordinator and subagent, preventing shared memory access.
Model 'memory' is not tied to API keys but to the specific messages array provided in the current request payload.
-
✗ The subagent reached its rate limit due to the coordinator spawning too many parallel asynchronous execution threads.
While rate limits are an issue, they result in infrastructure errors rather than the semantic failure of 'missing data' described.
-
-
3 In the context of configuration management, a team wants to enforce coding standards that are specific to a single repository but should not affect the developer's global Claude Code settings. Where should these instructions be placed?
Recall the distinction between personal/local configuration and team/shared configuration.
A 'CLAUDE.md' file located in the root of the specific project repository.
Project-level 'CLAUDE.md' files are version-controlled and shared within the team, overriding or augmenting global settings for that directory.
-
✗ The global 'settings.json' file located in the developer's home directory ('~/.claude/').
Global configuration applies across all repositories on the machine and is not shared via version control with other team members.
-
✗ Hard-coded as comments within the source code files to be parsed by the model during the directory read step.
While effective for local context, this does not utilize the standard Claude Code configuration hierarchy designed for project rules.
-
✗ The '.claude/rules/' directory on the host machine's root filesystem.
Rules files should be project-scoped within the repository to ensure they are portable and version-aligned with the code.
-
-
4 A developer needs to process a high-volume, non-urgent document analysis task involving $100,000$ tokens. Latency is not a concern, but cost efficiency is paramount. Which Messages API feature is most appropriate?
Look for the mechanism specifically designed for large-scale, asynchronous, and cost-reduced workloads.
The Message Batches API for asynchronous processing within a 24-hour window.
The Batch API offers a $50\%$ cost reduction for latency-tolerant workloads by processing them outside of real-time demand.
-
✗ Server-Sent Events (SSE) streaming to optimize the time-to-first-token (TTFT).
Streaming optimizes perceived latency for users but does not provide the token-level cost discounts found in batch processing.
-
✗ Prompt caching of the primary document to reuse context across multiple synchronous calls.
While caching reduces cost, it is less efficient than the Batch API for a single massive, non-urgent workload.
-
✗ Implementing a parallelized thread pool using the standard Messages API to maximize throughput.
Parallel real-time requests incur full costs and risk hitting rate limits without providing the batch discount.
-
-
5 When a Claude model initiates a 'tool_use' stop reason, what is the critical responsibility of the integration layer before returning control to the model?
Identify the step that connects the model's intent to the real-world action.
Parse the tool parameters, execute the local code, and append a 'tool_result' block to the message history.
The application must act as the bridge between the model's request and the actual execution of the tool logic.
-
✗ Immediately send an 'end_turn' signal to flush the buffer and finalize the JSON structure.
The 'tool_use' reason indicates the turn is not finished; the model is waiting for the output of the tool to continue.
-
✗ Recalculate the token budget to account for the increased context size of the tool schema.
While budgeting is good practice, the functional requirement is the execution and reporting of the tool's result.
-
✗ Sanitize the model's text output to remove any mentions of the tool before the user sees it.
The integration layer should focus on providing the requested tool data back to the model in the next turn of the interaction.
-
-
6 Which programmatic control is most effective for preventing a Claude-based agent from executing unauthorized financial transactions triggered by prompt injection?
Think about where 'enforceable' security logic must reside compared to 'suggested' behavior.
Deterministic validation hooks in the application code that verify transaction limits and user permissions before API execution.
Enforcement of high-stakes actions must happen in the code layer, as prompt-based instructions cannot be guaranteed $100\%$ effective against adversarial input.
-
✗ Adding a highly descriptive 'system' instruction that strictly forbids the model from processing malicious input.
System prompts are conversational guidelines and can be bypassed by sophisticated jailbreaking or injection techniques.
-
✗ Lowering the 'temperature' setting to $0.0$ to ensure the model's behavior is completely predictable and less creative.
Low temperature improves consistency but does not act as a security barrier against validly formatted but malicious instructions.
-
✗ Using a smaller model like Claude Haiku to reduce the complexity of the reasoning and minimize potential attack surface.
Model size is not a security control; smaller models can still be manipulated into calling available tools if not programmatically restricted.
-
-
7 An application architect needs to implement a solution where Claude can access an internal SQL database. The requirement specifies that this capability must be reusable across multiple distinct Claude applications. What is the recommended approach?
Consider the protocol designed specifically for decoupling context and tool execution for multi-app reusability.
Build an MCP (Model Context Protocol) server that exposes the database operations as tools.
MCP creates a standardized, reusable interface that allows multiple host applications to share the same tool logic and data resources.
-
✗ Hard-code the database connection string and schema directly into each application's 'CLAUDE.md' file.
This approach is not reusable, poses security risks by exposing credentials, and creates maintenance overhead across applications.
-
✗ Develop a custom Skill that includes the SQL queries as few-shot examples for the model to follow.
Skills provide behavioral instructions but do not provide the underlying transport or execution environment for database connectivity.
-
✗ Use the 'tool_choice' parameter set to 'any' to force the model to generate SQL syntax in its text response.
Forcing syntax generation does not solve the problem of actual database execution or the need for a reusable interface.
-
-
8 A developer is optimizing a Claude application for speed. They notice that the TTFT (Time-to-First-Token) is high because the system prompt contains a $5,000$ line schema definition that rarely changes. What is the best optimization strategy?
Focus on a feature that allows the model to 'remember' and skip re-processing static instructions.
Implement prompt caching with a breakpoint after the static schema definition.
Prompt caching allows the model to reuse the processed state of static content, significantly reducing both latency and input token costs.
-
✗ Move the schema definition from the 'system' prompt to the first 'user' message in the array.
Moving content between roles does not reduce the computational work needed to process the tokens on each request.
-
✗ Compress the schema into a single-line JSON string to minimize the total character count.
Tokenization is based on more than just character count; compression often makes it harder for the model to reason accurately.
-
✗ Utilize SSE (Server-Sent Events) to stream the response as it is generated.
Streaming addresses perceived latency after generation begins but does not reduce the processing time of a massive system prompt.
-
-
9 When parsing a 'Messages API' response, why should an application prioritize checking 'stop_reason' over simply detecting the presence of a closing brace in a JSON string?
Consider what happens if the model is interrupted before it finishes writing its response.
The model might terminate early due to 'max_tokens' or 'stop_sequence', resulting in an invalid or incomplete JSON payload.
Only the 'stop_reason' field provides an authoritative signal from the API on whether the model actually finished its intended generation.
-
✗ Checking 'stop_reason' is computationally less expensive than string pattern matching in high-throughput environments.
Performance differences are negligible; the priority is based on the correctness and completeness of the data.
-
✗ The 'stop_reason' parameter automatically triggers the application's reconnection logic in the event of a websocket failure.
Stop reasons are part of the JSON response payload and do not manage the underlying network socket state.
-
✗ The 'Messages API' does not support structured JSON output without a 'forced-choice' tool call.
Claude can generate structured JSON in standard text turns, but reliability requires verifying the termination state.
-
-
10 In an MCP (Model Context Protocol) architecture, which component is responsible for managing user authorization and enforcing safety policies for tool execution?
Identify the 'bridge' component that has the final say on local system access.
The MCP Client (Host Application).
The host application acts as the primary gatekeeper, managing credentials and ensuring the model does not execute dangerous actions without approval.
-
✗ The MCP Server.
The server's role is to provide the tool logic and resources, but it generally operates within the trust boundaries established by the client.
-
✗ The Claude Model (Anthropic API).
The model identifies the intent to use a tool, but it lacks the programmatic context of the local environment to enforce security.
-
✗ The transport layer (stdio/SSE).
Transports are communication channels and do not have logic for authorization or policy enforcement.
-
-
11 A developer needs to implement a 'pre-commit' check in their development workflow using Claude Code. Which configuration allows for an automated script to run before any changes are finalized?
Look for the feature designed to intercept and validate actions within the tool's execution lifecycle.
Configuring hooks within the project-level 'CLAUDE.md' or rules directory.
Claude Code supports programmatic hooks that allow developers to integrate external validation and automation directly into the agent's workflow.
-
✗ Modifying the 'version_pinning' parameter in the 'settings.json' file.
Version pinning controls which model release is used but does not support the execution of arbitrary lifecycle scripts.
-
✗ Using a 'User' role message to instruct the model to manually run a linting command before every save.
While possible, this is a manual prompting strategy rather than an automated, configuration-driven engineering hook.
-
✗ Enabling 'Headless Mode' to bypass all local security checks and file permissions.
Headless mode is for CI/CD automation and does not inherently provide pre-commit validation logic.
-
-
12 What is the primary architectural trade-off when selecting 'any' for the 'tool_choice' parameter in a Claude API request?
Consider the impact of forcing a specific behavior versus letting the model decide autonomously.
It forces the model to invoke at least one tool but may lead to redundant calls if the task is already simple.
The 'any' setting ensures a tool is used, which is helpful for structured workflows but removes the model's ability to provide a text-only response if a tool is unnecessary.
-
✗ It reduces the token cost by skipping the 'thinking' block generation for that specific turn.
Tool choice does not disable the model's reasoning capabilities; it only constrains the final output behavior.
-
✗ It significantly increases the latency as the model must poll every available MCP server before responding.
Latency is affected by the model's generation length and reasoning, not by a broadcast search for servers.
-
✗ It allows the model to bypass the 'system' prompt's safety instructions to ensure the tool is executed.
Safety guardrails and system instructions remain active regardless of the 'tool_choice' configuration.
-
-
13 A developer receives a 'JSON' response from Claude that is truncated because it hit the 'context_window' limit. Which 'stop_reason' will the API report?
Recall the specific terminology used when a hard limit halts the model's output.
max_tokens
The 'max_tokens' reason is triggered whenever the generation is cut off due to reaching the limit specified in the request or the model's hard ceiling.
-
✗ end_turn
'end_turn' indicates the model finished naturally, which is the opposite of being cut off by a limit.
-
✗ stop_sequence
This reason only occurs if the model generates a specific string provided by the developer to halt execution.
-
✗ null
The API always provides a stop reason once generation is complete or terminated.
-
-
14 Which software engineering foundation is most critical for managing long-running agentic tasks where the model must perform multiple tool-use turns over an extended period?
Focus on the concepts that handle 'non-blocking' work and 'remembering' the current progress.
Asynchronous orchestration and state management.
Reliable agents require the ability to handle non-blocking interactions and maintain state persistence across multiple API round-trips.
-
✗ Static type checking and compile-time validation.
While helpful for code quality, these do not address the runtime challenge of managing stateful, multi-turn LLM loops.
-
✗ Monolithic architecture design.
Agentic systems typically benefit more from decoupled, microservice-like tool designs (e.g., MCP) than monolithic structures.
-
✗ Synchronous, blocking IO operations.
Blocking IO is generally discouraged for long-running AI workflows as it limits scalability and responsiveness.
-
-
15 When configuring Claude Code for a large engineering organization, why might an architect prefer 'project-scoped' rules over 'user-scoped' rules?
Think about the benefits of 'Source of Truth' and team collaboration.
Project-scoped rules allow for version-controlled, consistent standards that are shared automatically across all team members.
Placing rules in the repository ensures that every developer using Claude Code on that project follows the same architectural and style guidelines.
-
✗ Project-scoped rules bypass the 'token' cost associated with injecting global instructions into every request.
Both types of rules consume tokens; the difference is in how the configuration is managed and distributed.
-
✗ User-scoped rules are inherently more secure as they are stored on the developer's encrypted local drive.
Security is based on the contents and handling of the rules, not just their file system location.
-
✗ Claude Code does not support the execution of custom slash commands if they are defined at the project level.
Claude Code explicitly supports both project-level and user-level custom commands.
-
-
16 In the Messages API, which content block type is used to provide the results of a function call back to the model after a 'tool_use' request?
Identify the block name that matches the outcome of an executed tool.
tool_result
The 'tool_result' block is a specific API structure designed to carry the output (success or error) of a tool execution back to the model's context.
-
✗ text
While the result may contain text, it must be wrapped in a 'tool_result' block so the model can associate it with the correct tool call ID.
-
✗ assistant_output
This is not a valid API block type; the roles are 'user' and 'assistant', and blocks are 'text', 'image', 'tool_use', etc.
-
✗ system_feedback
Results of tools are sent as 'user' role messages containing a 'tool_result' block, not as system-level feedback.
-
-
17 A developer wants to use 'Claude Code' in a headless mode for a CI/CD pipeline. Which of the following is a known limitation or requirement of this operational mode?
Think about what an automated server environment lacks compared to a human terminal session.
It requires explicit environment variables and non-interactive authentication to avoid hanging the build pipeline.
Headless automation cannot handle interactive 'Turing' tests or password prompts and must be configured for silent, automated execution.
-
✗ It can only execute 'read-only' commands and cannot modify the filesystem or commit code.
Headless mode is fully capable of code modification and git operations if permitted by the environment's security settings.
-
✗ It requires a physical GPU on the CI/CD runner to process the model's visual reasoning chunks.
Claude Code is a CLI tool that interacts with a hosted API; local GPU resources are not required for model execution.
-
✗ It only supports Claude Haiku to minimize the impact on CI/CD build duration.
Headless mode can use any supported model tier as specified in the configuration.
-
-
18 When designing an MCP (Model Context Protocol) server, why is it recommended to return 'structured error envelopes' instead of raw stack traces?
Consider how the model uses tool output to decide its next conversational turn.
Structured errors allow the model to reason about the failure (e.g., 'permission denied') and potentially suggest a corrective action to the user.
Raw stack traces are often confusing for LLMs; clear, semantic error categories enable the model to handle the failure intelligently.
-
✗ Stack traces contain too many tokens and will quickly bloat the context window and increase API costs.
While true, the primary benefit is the model's ability to interpret the error rather than just the token count reduction.
-
✗ The Anthropic API will automatically terminate the session if it detects a standard Python or Node.js error pattern.
The API does not monitor tool output for specific code-level error patterns; it treats all tool output as text context.
-
✗ MCP servers do not support text-based error reporting and must use binary status codes.
MCP supports flexible JSON-based communication, and clear text descriptions are highly encouraged for model interaction.
-
-
19 An architect is concerned about 'context drift' in a long-running customer support agent. Which technique most effectively prevents the model from being overwhelmed by stale interaction history?
Focus on the process of 'compaction' or 'distillation' of history.
Implementing programmatic context isolation and summarizing past turns into a condensed 'state' block.
By periodically summarizing history and pruning unnecessary tool outputs, the application keeps the most relevant information within the model's focus.
-
✗ Increasing the frequency of API calls to ensure the model 'refreshes' its internal weights more often.
API calls do not update model weights; they only consume tokens and provide the history contained in the message array.
-
✗ Switching from a multi-agent hierarchy to a single, monolithic prompt to ensure all data is always available.
A monolithic approach actually increases the risk of drift and bloat compared to a well-orchestrated, segmented system.
-
✗ Setting 'temperature' to its maximum value to encourage the model to ignore older parts of the conversation.
High temperature increases randomness but does not provide any logical mechanism for context management or prioritization.
-
-
20 A developer needs to ensure that their Claude-powered application is resilient to 'breaking behavior changes' when Anthropic releases a new version of the Sonnet model. What is the standard practice?
Identify the configuration setting that specifically targets 'immutable' identifiers.
Pinning the application to a specific, immutable model version (e.g., 'claude-3-5-sonnet-20240620') instead of using the generic 'claude-3-5-sonnet' alias.
Version pinning prevents automatic updates from changing the model's behavior, allowing for controlled testing and migration on the developer's timeline.
-
✗ Setting a strict 'stop_sequence' that triggers a manual review whenever the model's output deviates from a baseline regex.
Stop sequences halt generation but do not provide a mechanism for managing model updates or versioning.
-
✗ Relying on the 'system' prompt to explicitly instruct the model to only use features from a previous model generation.
Models cannot 'downgrade' their own capabilities or internal logic based on a prompt instruction.
-
✗ Implementing a dynamic router that switches models based on the current API latency.
Latency-based routing does not address the risk of semantic or functional changes in model behavior across versions.
-
-
21 Which field in the Messages API response should a developer parse to determine if the model successfully performed a multi-modal analysis of a PDF file?
Consider where the actual 'intelligence' or 'answer' from the model is delivered.
The 'content' array of the assistant's message, specifically looking for text blocks containing the extracted PDF information.
Claude's analysis results are returned as standard text content blocks after the model has processed the visual or textual data from the file.
-
✗ A specialized 'pdf_metadata' object in the top-level API response header.
The API does not return separate PDF metadata objects; the model's insights are part of its generated message content.
-
✗ The 'stop_reason' field, which will explicitly state 'file_extraction_complete'.
Stop reasons are generic (end_turn, tool_use, etc.) and do not describe the specific nature of the successful task.
-
✗ The 'usage' block, which lists the number of 'image_tokens' consumed by the PDF's visual elements.
The usage block confirms consumption and cost but does not validate the semantic success of the analysis itself.
-
-
22 In a scenario where Claude must interact with a sensitive banking API, why is 'programmatic' validation of tool arguments considered superior to 'prompt-based' validation?
Think about 'deterministic' vs. 'probabilistic' outcomes in security-critical code.
Generative models can occasionally hallucinate parameters or bypass instructions, whereas application code provides a deterministic and enforceable security gate.
Code-level validation is not susceptible to the same 'jailbreaking' or 'drift' issues as natural language instructions.
-
✗ Programmatic validation reduces the token count of the request by $20-30\%$.
Token savings are minimal; the primary driver for programmatic validation is security and reliability, not cost.
-
✗ The Messages API will automatically block any request that contains the word 'password' or 'account_number' in a tool schema.
The API does not perform word-level blacklisting of schemas; security is the responsibility of the developer.
-
✗ Prompt-based validation requires a specialized license for Claude Opus.
All model tiers support prompt-based instructions, but all are equally vulnerable to the same fundamental reliability issues.
-
-
23 A developer is using 'Claude Code' and wants to set up a custom slash command for the whole team. Where should the command definition file be stored?
Consider the location that supports version control and team-wide availability.
In the '.claude/commands/' directory within the project's root folder.
Storing commands in the project directory allows them to be shared via version control, ensuring consistency across the engineering team.
-
✗ In the '~/.claude/commands/' directory on each developer's individual machine.
Home directory storage is personal and does not facilitate automatic sharing or consistency across a team's repositories.
-
✗ As an entry in the 'plugins' array of the global 'settings.json' file.
Slash commands are generally configured via markdown files in specific directories rather than as entries in a JSON plugin array.
-
✗ Directly within the 'CLAUDE.md' file under a specific '# Slash Commands' heading.
While 'CLAUDE.md' can describe commands, the actual executable definitions for Claude Code live in the dedicated commands folder.
-
-
24 What is the primary function of the 'system' parameter in a Messages API request compared to 'user' messages?
Identify the top-level 'instruction layer' that sets the stage for the conversation.
It establishes the foundational rules, persona, and operational boundaries that guide the model's behavior throughout the interaction.
The system prompt is isolated from user input to provide a more robust, top-level set of instructions that are harder for the model to 'forget' or override.
-
✗ It provides a secondary channel for the model to send private debugging information to the application logs.
The 'system' parameter is for input instructions, not for model-to-app private logging channels.
-
✗ It is used exclusively for providing few-shot examples to avoid cluttering the conversational history.
Few-shot examples can be in the system prompt or user messages; the primary purpose is persona and boundary setting.
-
✗ It acts as a high-speed cache for large PDF files and image assets.
Caching is a separate feature; the system prompt is for text-based instructions and context.
-
-
25 A developer needs to implement a 'defensive parsing' strategy for Claude's output. Which of the following best describes this technique?
Think about 'robustness' when dealing with slightly unpredictable data structures.
Designing application logic that anticipates and handles common formatting errors, missing JSON keys, or unexpected text in model responses.
Defensive parsing acknowledges that generative models are probabilistic and may occasionally produce malformed output, requiring robust error handling in the integration layer.
-
✗ Using a separate, smaller model to scan every Claude response for potential prompt injection attempts.
This is an output moderation or security check, not a data parsing or consumption strategy.
-
✗ Forcing the model to only output binary data to bypass the need for natural language processing.
Claude is a language model and does not natively output binary data; it is optimized for text and structured formats like JSON.
-
✗ Automatically retrying every API request three times if any non-ASCII character is detected in the payload.
Blind retries based on character encoding are not a strategic parsing approach and would be highly inefficient.
-