CCDV-F Claude Code Practice Question
Exhibit
Error: Command 'npm test' failed with exit code 1. Output: 'TypeError: undefined is not a function'. Context: The agent was attempting to implement a new feature in the 'auth' service.
Refer to the exhibit. Claude Code has encountered a test failure while implementing a feature. How should the developer effectively guide the agent to resolve this error using the agent's internal capabilities?
⚠ Common exam trap
Developers frequently try to fix errors manually after seeing a stack trace. They miss the opportunity to have the agent analyze the logs itself, which is faster and more context-aware.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Instruct the agent to read the logs and apply a fix based on the stack trace.
Claude Code excels at iterative debugging by leveraging its ability to read execution logs and apply fixes directly to code. The most efficient approach involves instructing the agent to analyze the stack trace, locate the undefined function call, and propose a corrective patch. This leverages the agent's autonomous capability to reason about project architecture rather than requiring manual intervention, keeping the development loop self-contained and highly efficient.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Manually apply the fix to the code and restart the Claude Code session.
Why it's wrong here
Restarting the session after a manual fix is inefficient and disrupts the agent's internal state. Claude Code is designed to process error outputs and apply fixes iteratively within a single session, maintaining context and allowing it to learn from previous failures during the development process.
- ✓
Instruct the agent to read the logs and apply a fix based on the stack trace.
Why this is correct
Providing the error log as context allows Claude Code to trace the logic error back to the source. The agent can then identify the missing function definition or improper import, suggest a code modification, and execute the test suite again to verify the resolution effectively.
- ✗
Disable the agent's ability to run commands to prevent further errors.
Why it's wrong here
Disabling command execution prevents the agent from verifying its own fixes. Claude Code requires shell access to run tests and validate changes. Without this capability, the agent cannot confirm if its proposed solution resolves the underlying issue, rendering the debugging process incomplete and unreliable.
- ✗
Run 'npm install' to ensure all dependencies are resolved before proceeding.
Why it's wrong here
While dependency management is important, the error message indicates a 'TypeError' which is typically a logic issue rather than a missing package. Running install does not resolve code-level errors where a function call is targeting an undefined variable or module reference within the project code.
Visual reference
About these practice questions
This CCDV-F question is part of Courseiva's 257-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Anthropic exam blueprint
This CCDV-F practice question is part of Courseiva's free Anthropic certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CCDV-F exam.