CCDV-F : Claude Code (Domain 3)
Domain 3 : Claude Code
This study guide provides an exhaustive analysis of Domain 3 for the Claude Certified Developer – Foundations (CCDV-F) exam. This domain focuses on the operation and configuration of Claude Code, Anthropic’s command-line interface (CLI) designed for codebase modernization, agentic task execution, and direct software engineering integration. While Domain 3 represents a specific percentage of the total exam weighting, its concepts intersect heavily with agentic architecture, tool use, and configuration management, making it a critical component of the professional developer’s toolkit.
1. Claude Code CLI Architecture for Developers
Claude Code is positioned as a hands-on builder tool that bridges the gap between Claude’s core reasoning capabilities and a local development environment. Unlike the standard web interface, the CLI is designed to operate directly on repositories, allowing it to perform tasks such as refactoring, debugging, and system modernization.
The architecture of Claude Code is built upon a few foundational pillars:
- Direct File System Access: Unlike chat-based interfaces, Claude Code is designed to be initialized within a repository, gaining awareness of the project structure.
- Agentic Execution: It utilizes agent loops to process multi-step commands, allowing it to reason through complex engineering tasks.
- Integration with Development Tools: It supports integration with the Model Context Protocol (MCP) and custom skills, extending its utility beyond simple text generation into active environment manipulation.
For the CCDV-F candidate, understanding Claude Code requires a shift from “prompting” to “operating.” The exam measures the ability to configure these operations through specific files like CLAUDE.md and settings.json, and to manage the agent’s behavior through various operational modes.
2. Core Components of Claude Code: Rules, Skills, and Commands
The operational logic of Claude Code is governed by three primary components: Rules, Skills, and Commands. These define what the agent knows, what it can do, and how the user interacts with it.
Rules
Rules are the primary mechanism for establishing project-specific standards. They are typically housed in the CLAUDE.md file. Rules provide the agent with the necessary context regarding coding standards, preferred libraries, and architectural patterns. Because Claude Code is designed to be “aware” of its environment, these rules act as a persistent system prompt that guides every interaction within the repository.
Skills
Skills represent the functional extensions of Claude Code. While the CLI comes with built-in capabilities, developers can author custom Skills to automate repetitive tasks or integrate with proprietary internal tools. Skills allow the agent to perform specific actions—such as running a build script, executing tests, or querying a database—by providing it with the necessary logic and tool schemas.
Commands
Commands are the primary interface for user interaction. Claude Code utilizes a variety of built-in “slash commands” to manage the session and the environment. These commands allow developers to switch modes, clear history, or inspect the agent’s current state. Understanding the difference between a standard natural language request and a slash command is fundamental to efficient operation.
3. Agentic Foundations in Claude Code: Agents and Memory
A defining feature of Claude Code is its use of agentic patterns. The CLI does not simply respond to a prompt; it creates a plan, executes steps, and manages state.
Agents and Subagents
The system can utilize a manager/supervisor hierarchy where a primary agent delegates specific tasks to subagents. This hierarchy is particularly useful for large-scale tasks where a single context might become bloated. Subagents can be tasked with isolated components—such as writing tests for a specific module—while the primary agent maintains the overall project goals. This modularity improves task execution and helps maintain context window hygiene.
Agent Memory
Agent Memory refers to the system’s ability to maintain awareness of previous actions and decisions within a session. This memory allows Claude Code to “remember” why a specific refactoring choice was made earlier in a session, ensuring consistency across multi-step workflows. For the developer, managing this memory—including knowing when to clear it via session management—is a key operational skill.
4. Claude Code Operational Modes: Streaming, Auto, and Headless
Claude Code offers several modes of operation, each suited to different engineering contexts. The exam requires a deep understanding of when to use each mode.
Streaming Mode
Streaming mode is the default interactive state where Claude provides real-time feedback as it generates code or plans. This is used for standard iterative development where the developer is actively monitoring and approving output.
Auto-Mode
Auto-mode allows the agent to execute a series of steps without requiring manual approval for every single action. While this increases speed, it requires robust rules and guardrails to prevent the agent from making destructive changes. It is typically used for well-defined, repetitive tasks where the developer has high confidence in the project’s rules and the agent’s plan.
Headless Mode
Headless mode is a critical feature for CI/CD integration. In this mode, Claude Code operates without a persistent interactive terminal. It can be triggered by automated scripts to perform tasks like code reviews, automated refactoring, or documentation updates within a pipeline. Candidates must understand how to provide instructions and handle outputs in a headless environment where a human is not present to provide real-time guidance.
5. Strategic Workflows: The Claude Code Plan Mode Lifecycle
One of the most sophisticated features of Claude Code is “Plan Mode.” This mode alters the interaction lifecycle to prioritize architectural alignment before any code is written.
The Plan Mode workflow typically follows these stages:
- Instruction: The developer provides a high-level task.
- Drafting: Claude generates a detailed plan of action, identifying which files will be modified and what tools will be used.
- Review: The developer reviews the plan for logical errors or violations of project standards.
- Refinement: The developer provides feedback, and Claude iterates on the plan.
- Execution: Once the plan is approved, the agent moves into execution, following the refined steps.
This lifecycle ensures that complex changes are vetted before they are applied, reducing the risk of context drift or architectural “hallucination.”
6. Configuration Management with settings.json in Claude Code
While CLAUDE.md focuses on project-specific rules, settings.json is used for broader configuration management. This file allows developers to control the behavior of the CLI tool itself across different environments.
Key configuration items in settings.json include:
- Model Pinning: Specifying which version of the Claude model should be used (e.g., Sonnet vs. Haiku).
- Interface Preferences: Configuring how streaming and notifications are handled.
- Plugin Dependencies: Managing which external plugins or MCP servers the CLI should connect to by default.
- Security Settings: Defining the levels of approval required for certain actions.
Understanding the hierarchy of configuration—how settings.json interacts with the CLAUDE.md file—is essential for ensuring consistent behavior across a team of developers.
7. Structuring CLAUDE.md for Project Governance
The CLAUDE.md file is the heart of project governance in Claude Code. It serves as a living document that defines the relationship between the human developer and the AI agent.
Repository Initialization
When initializing a repository for use with Claude Code, the first step is often the creation or update of the CLAUDE.md file. This process involves the agent scanning the repository to understand the tech stack and then proposing a set of base rules.
The Governance Hierarchy
In large-scale enterprise environments, CLAUDE.md can follow a hierarchical structure.
- Project-Level Rules: These define global standards for the entire repository, such as the use of TypeScript or specific naming conventions for API endpoints.
- Local Overrides: While the primary
CLAUDE.mdis global, specific directories can contain additional context that applies only to those paths.
This hierarchy allows for modular project management, ensuring that the agent has the right amount of context for the specific area of the codebase it is currently modifying.
8. Repository Initialization and Claude Code Workspace Setup
Effective operation of Claude Code begins with proper setup. Repository initialization is more than just running a command; it is the process of building the agent’s “mental model” of the codebase.
During initialization, Claude Code performs several critical tasks:
- Structure Analysis: It identifies the directory layout, configuration files (like
package.jsonorrequirements.txt), and primary source directories. - Environment Detection: It detects the languages, frameworks, and build tools currently in use.
- Rule Proposal: Based on the detected environment, it suggests rules for the
CLAUDE.mdfile.
A successful setup ensures that the agent understands the boundaries of the project and the tools available to it (such as local test runners or linters).
9. Path-Scoped Rules: Modular Context for Claude Code
For massive codebases, providing the agent with every single detail of the project can lead to “context bloat,” where the model becomes less effective due to too much irrelevant information. To combat this, Claude Code supports path-scoped rules.
Path-scoped rules allow a developer to define instructions that only trigger when the agent is working within a specific directory.
- Example: A
/docsdirectory might have rules requiring all files to be in Markdown format with specific front-matter, while the/srcdirectory requires strict adherence to functional programming patterns. - Benefit: This isolation prevents context drift—where rules meant for one part of the system incorrectly influence another—and keeps the active context window focused on the task at hand.
10. Advanced Claude Code Operations and Custom Skills
As a developer progresses in their use of Claude Code, they move from using built-in commands to extending the tool’s capabilities.
Custom Slash Commands
Developers can create custom slash commands to trigger specific engineering workflows. For instance, a /release-notes command could be programmed to scan recent git commits and generate a summary based on project-specific formatting rules.
Authoring Claude Skills
Authoring a Skill involves defining a tool schema that Claude can understand. This includes:
- Name and Description: Telling the agent what the skill does and when to use it.
- Input Schema: Defining the arguments the agent needs to provide.
- Logic Execution: The actual code or script that runs when the skill is invoked.
Skills are what allow Claude Code to act as a true “agent” rather than just a code generator, as they provide the bridge to the external world and the local operating system.
Glossary of Claude Code Key Terms
- Claude Code: A command-line interface (CLI) tool developed by Anthropic for interacting with Claude directly within a local development environment.
- CLAUDE.md: A project-level configuration file used to define rules, standards, and context for the Claude Code agent.
- settings.json: A configuration file used to manage user-level and tool-level preferences, such as model pinning and plugin management.
- Headless Mode: An operational mode where Claude Code runs without an interactive terminal, typically used for CI/CD pipelines.
- Auto-mode: A mode that allows the agent to execute multiple steps in a workflow without requiring manual approval for every action.
- Plan Mode: A strategic workflow state where Claude drafts and refines a detailed action plan before executing any changes.
- Streaming Mode: The default interactive mode where Claude’s output is displayed in real-time as it is generated.
- Skills: Functional extensions that allow Claude Code to perform specific tasks or integrate with external tools.
- Rules: Persistent instructions found in
CLAUDE.mdthat guide the agent’s behavior and ensure adherence to project standards. - Agent Memory: The system’s ability to retain context and awareness of previous actions within a specific session.
- Subagents: Specialized agents created by a primary agent to handle specific sub-tasks in a multi-step workflow.
- Slash Commands: Built-in or custom commands (prefixed with
/) used to manage the session or trigger specific actions. - Repository Initialization: The process of setting up Claude Code within a project, including codebase analysis and rule generation.
- Path-scoped Rules: Rules that apply only to specific directories or file paths within a repository.
- Model Context Protocol (MCP): An open standard that allows Claude to connect to external data sources and tools seamlessly.
- Session Management: The practice of starting, clearing, or resuming interactions to maintain context and token efficiency.
- Context Drift: A phenomenon where the agent’s focus shifts away from the primary task or project rules due to excessive or irrelevant information.
- Prompt Caching: An optimization technique used by the API and CLI to reduce costs and latency by reusing frequent prompt components.
Domain 3 Short-Answer Study Questions
1. What is the primary purpose of the CLAUDE.md file?
Answer: The primary purpose of CLAUDE.md is to define project-specific rules, coding standards, and architectural context that guide the behavior of the Claude Code agent during a session.
Explanation: It acts as a persistent guide for the agent to ensure its output aligns with the specific requirements of the repository it is operating within.
2. Differentiate between headless mode and auto-mode. Answer: Headless mode is designed for non-interactive environments like CI/CD pipelines, while auto-mode is an interactive state that allows the agent to execute multi-step plans without manual approval for each step. Explanation: Headless mode is about where the tool is running (no terminal), while auto-mode is about how it handles the approval workflow.
3. How does settings.json differ from CLAUDE.md in the configuration hierarchy?
Answer: settings.json manages tool-level and user preferences (like model selection), while CLAUDE.md manages project-specific rules and context.
Explanation: settings.json is generally for the tool’s behavior, whereas CLAUDE.md is for the project’s content and standards.
4. What is “Agent Memory” within the context of the Claude Code CLI? Answer: Agent Memory is the system’s ability to maintain awareness of previous interactions, decisions, and outcomes within a single active session. Explanation: This allows the agent to maintain consistency across complex, multi-step engineering tasks.
5. Explain the role of custom slash commands. Answer: Custom slash commands allow developers to create shortcuts for specific, repeatable engineering workflows, such as generating documentation or running specific test suites. Explanation: They extend the CLI’s interface beyond the built-in commands provided by Anthropic.
6. What does “repository initialization” involve for Claude Code?
Answer: Initialization involves the agent scanning the repository to understand its structure, detecting the tech stack, and proposing a CLAUDE.md file with initial rules.
Explanation: This step builds the foundational “mental model” the agent uses to interact with the codebase.
7. Define the concept of “path-scoped rules.” Answer: Path-scoped rules are specific instructions or context that only apply when the agent is working within a designated directory or file path. Explanation: This helps prevent context bloat and ensures that the agent only uses relevant rules for the task at hand.
8. When should a developer use “plan mode”? Answer: A developer should use plan mode for complex or high-risk tasks that require architectural vetting and multi-step execution. Explanation: It allows the developer to review and refine the agent’s logic before any permanent changes are made to the code.
9. How are “Skills” used to extend Claude Code? Answer: Skills are used to give the agent the ability to perform deterministic actions, such as interacting with local build tools or external APIs. Explanation: They turn Claude from a text generator into an active agent capable of manipulating its environment.
10. What is the significance of the scaled passing score for the CCDV-F? Answer: The passing score is 720 on a scale of 100–1,000, which is a criterion-referenced standard rather than a curve against other test-takers. Explanation: This ensures that every certified professional has met a fixed level of competency as defined by Anthropic’s task analysis.
Open-Ended Scenario Questions for Domain 3
- Scenario: You are managing a large enterprise repository with multiple microservices written in different languages (e.g., a Python backend and a TypeScript frontend). Design a
CLAUDE.mdhierarchy that ensures Claude Code follows the correct linting and architectural rules for each service without suffering from context drift. - Design Task: Propose a custom “Skill” for Claude Code that integrates with a proprietary internal database for retrieving error logs. Define the necessary components of the tool schema and explain how the agent should handle database credential security.
- Scenario: Your team wants to integrate Claude Code into an automated CI/CD pipeline to perform code reviews on every pull request. Describe the configuration steps required to run the tool in headless mode and how you would structure the
CLAUDE.mdto prioritize security and performance during the review. - Analysis: Compare the use of “Auto-mode” versus “Plan Mode” for a task involving the refactoring of a critical authentication module. Which mode is more appropriate, and what specific guardrails would you implement in the configuration to prevent a security breach?
- Design Task: You need to optimize the token usage of a long-running Claude Code session that involves deep analysis of a massive codebase. Explain how you would utilize session management, path-scoped rules, and prompt caching to maintain high performance while minimizing API costs.
Leaderboard
No scores saved yet. Be the first!
25 Questions — Domain 3 : Claude Code
Expand any question to reveal the correct answer and explanation.
-
1 A development team wants to ensure that specific architectural patterns are followed across a large monorepo when using Claude Code. Which configuration strategy provides the most granular control using glob patterns?
Consider the method that allows for directory-specific logic rather than a single monolithic instruction file.
Adding specialized rules files within the .claude/rules/ directory.
The .claude/rules/ directory supports multiple files that can target specific paths and file types using glob patterns for modular instruction enforcement.
-
✗ Defining instructions within a single root-level CLAUDE.md file.
While effective for general project rules, a single file lacks the ability to apply different rules to specific sub-directories via globbing.
-
✗ Configuring repository-wide behavior in the global ~/.claude/settings.json file.
This file is typically used for environment-level settings like model pinning rather than repository-specific architectural rules.
-
✗ Embedding instructions directly into custom Claude Skills within the .claude/skills/ folder.
Skills are designed for reusable functional units rather than passive architectural enforcement across a file system.
-
-
2 When running Claude Code in a CI/CD pipeline, what is the primary operational constraint of using the --headless flag compared to the standard interactive mode?
Think about the challenges of running a tool designed for conversation in an automated, script-based environment.
All interactive confirmation prompts are bypassed or require pre-authorization.
Headless mode is designed for non-interactive environments where the system cannot wait for a user to manually approve actions or plan steps.
-
✗ The model is restricted to read-only access of the file system.
Headless mode still allows file modifications; the restriction is on the nature of user input and interaction.
-
✗ The Agent SDK is disabled, forcing the use of basic prompt-response loops.
The underlying agentic capabilities remain active; only the interface for user feedback is altered.
-
✗ Claude Code cannot access network resources or external MCP servers.
Network and MCP access are governed by security settings and environment variables, not by the headless UI flag.
-
-
3 An architect needs to distinguish between personal preferences and team-wide standards for Claude Code. According to the recommended hierarchy, where should team-enforced coding standards reside?
The correct location must be accessible to version control systems like Git to ensure all team members receive the same updates.
<project_root>/CLAUDE.md
Placing the file in the project root allows it to be version-controlled and shared across the entire development team.
-
✗ ~/.claude/CLAUDE.md
This location is reserved for global, personal configurations that apply to every project the individual developer works on.
-
✗ <project_root>/settings.json
While project-specific, this file is used for configuration parameters like model versions rather than markdown-based coding instructions.
-
✗ .claude/memory.json
Agent memory is typically a runtime artifact for tracking state rather than a place for static, team-wide standard definitions.
-
-
4 In Claude Code, what is the specific advantage of using 'Plan Mode' when performing a complex refactor involving more than $10$ source files?
This mode is designed as a 'look before you leap' feature for high-stakes modifications.
It requires the model to generate and present a summary of intended changes for human approval before execution.
Plan mode acts as a safety gate, ensuring the developer can verify the logic and scope of a multi-file change before any bytes are modified on disk.
-
✗ It enables the model to bypass token limits by processing files in parallel segments.
Plan mode does not change the fundamental token limits or parallelization logic of the underlying model.
-
✗ It switches the model to Claude 3 Haiku to reduce costs for large-scale code analysis.
Plan mode is an operational state, not an automatic model-routing or cost-optimization feature.
-
✗ It automatically creates a git branch and commit for every modified file to prevent data loss.
While it may suggest git actions, the primary focus is the pre-execution verification of the logic, not the git workflow itself.
-
-
5 Which Claude Code feature allows a developer to define reusable, markdown-based functional units that can be invoked across different projects?
Think about 'Agentic Customization' which involves extending the model's capabilities with specific, named instruction sets.
Claude Skills
Skills are reusable functional units defined in markdown that extend Claude's capabilities and can be shared or invoked dynamically.
-
✗ Custom Slash Commands
Slash commands are typically for local session management or triggering specific project-bound logic rather than general reusable skills.
-
✗ MCP Resource Templates
MCP resources focus on exposing external data and systems, whereas Skills focus on instructions and agentic capabilities.
-
✗ Prompt Caching Checkpoints
Caching is a performance and cost optimization technique, not a method for defining reusable functional logic.
-
-
6 A developer uses the command `claude --auto` to address a complex bug. What distinguishes 'Auto-mode' from a standard interactive session?
This mode focuses on the agent's ability to drive a multi-step process toward a resolution independently.
It allows the model to enter a self-correcting loop to execute multiple tool calls sequentially without user intervention.
Auto-mode enables the agent to act autonomously to reach a goal, making consecutive decisions and tool calls until the task is complete.
-
✗ It forces the model to use the most expensive available model for every turn.
Auto-mode controls the loop behavior, not the specific model selection logic, which is usually pre-configured.
-
✗ It automatically commits code to the main branch after every successful test run.
Claude Code respects standard safety and version control boundaries; auto-committing to main is not a default auto-mode behavior.
-
✗ It provides real-time mathematical analysis of code complexity using the $\mathcal{O}(n)$ notation.
While Claude can perform this analysis, it is a capability of the model's reasoning, not a defining feature of the auto-mode execution loop.
-
-
7 When configuring a custom slash command in Claude Code, which file is used to define the command's trigger and associated logic within a project?
Look for the file that typically handles key-value pairs for technical tool configuration rather than markdown instructions.
settings.json
Slash commands and other behavioral settings for the Claude Code CLI are defined within the JSON-based configuration files.
-
✗ CLAUDE.md
CLAUDE.md is for project instructions; slash commands require more structured configuration for execution.
-
✗ .claude/history.log
This file is for audit trails and session tracking, not for defining active command logic.
-
✗ package.json
While it may contain scripts that Claude can run, it is not the primary configuration point for internal Claude Code slash commands.
-
-
8 A developer wants Claude Code to ignore a specific legacy directory containing large binary files to save context. Where is the most appropriate place to define this exclusion?
Think about the standard file most developers already use to keep search tools and version control from looking at specific folders.
The .gitignore file at the project root.
Claude Code typically respects standard .gitignore rules to determine which files should be excluded from its repository context.
-
✗ A 'don't read' list inside CLAUDE.md.
While instructions help, the programmatic standard of .gitignore is more reliable and efficient for tool-level exclusion.
-
✗ A 'deny' rule in a custom MCP server.
MCP servers expose external data; they are not used to filter the local project directory that Claude Code is already indexing.
-
✗ Increasing the token limit in settings.json to include the binary data.
Increasing limits is a cost-heavy solution that doesn't solve the core need for efficient context management.
-
-
9 Which of the following describes the correct behavior of 'Agent Memory' in a Claude Code session?
Consider how an agent maintains 'continuity' during a long debugging process.
It persists task-relevant information and 'learned' project context across multiple turns within a session.
Agent memory allows the model to keep track of its progress, discovered bugs, and project nuances as it works through a multi-step task.
-
✗ It stores the entire code repository in a vector database for RAG retrieval.
Memory is generally for tracking session-specific state and context, not for full-scale repository indexing.
-
✗ It creates a backup of the file system to allow for an 'undo' command.
File system state is managed by the OS or Git; Claude's memory is a cognitive artifact, not a backup utility.
-
✗ It synchronizes variables between the CLI and the Anthropic Console web interface.
The CLI and Console sessions are typically isolated; memory is local to the active environment/session.
-
-
10 How does the 'stop_reason' field in the Messages API influence the behavior of an agentic system like Claude Code?
This field is critical for handling responses that are too long for a single API turn.
It indicates if the model has successfully completed its thoughts or was cut off by a token limit.
Agents use 'stop_reason' to determine if they need to request more tokens to finish a response or if they should proceed to the next tool execution phase.
-
✗ It specifies which MCP server caused a fatal crash in the integration layer.
This field is part of the API response metadata for the model output, not a diagnostic for external infrastructure failures.
-
✗ It provides a security flag if a jailbreak attempt was detected in the user prompt.
While related to safety, 'stop_reason' is primarily a technical control for response completeness (e.g., 'end_turn' vs 'max_tokens').
-
✗ It defines the duration of the wait period before a retried request can be sent.
Wait periods for retries are managed by rate-limiting headers and client-side backoff logic, not the 'stop_reason' field.
-
-
11 What is the primary function of the `.claude/rules/` directory in a repository?
Think of this as a way to provide 'local context' that only applies when Claude is 'looking' at a specific part of your project.
To host a set of granular, path-targeted instructions that Claude must follow when interacting with specific modules.
This directory allows for modular 'rules' files that target specific areas of the code, providing more precise guidance than a single global file.
-
✗ To store API keys and secrets in a local-only environment.
API keys should never be stored in instructions or rules; they belong in environment variables or specialized secret managers.
-
✗ To serve as a cache for model responses to reduce API costs by $50\%$.
Response caching is handled by the API provider's infrastructure (e.g., Anthropic's prompt caching), not local rule files.
-
✗ To provide the binaries for custom slash commands compiled from TypeScript.
Claude Code is typically an interpreted environment or uses standard system commands; it does not compile binaries from a rules folder.
-
-
12 In the context of Claude Code, what does 'Headless Mode' lack that 'Auto-mode' typically includes?
Focus on the differences between a 'human-in-the-loop' experience and an automated script execution.
Interactive terminal feedback and manual step-by-step confirmation prompts.
Headless mode is optimized for scripts and CI/CD where no human is present to view progress bars or click 'approve' on individual steps.
-
✗ The ability to execute shell commands.
Both modes can execute shell commands; headless just does so without an interactive TTY (Teletype).
-
✗ The capacity to read files larger than $1$ megabyte.
Mode selection does not impose arbitrary file size limits; these are governed by the model's context window.
-
✗ Access to the Model Context Protocol (MCP) servers.
MCP access is a core engine feature and is available regardless of the UI mode being used.
-
-
13 A developer wants to share a specific 'Skill' for optimizing React components across multiple teams in the organization. What is the best practice for skill portability?
Portability is best achieved through version-controlled files that can be dropped into a standard project structure.
Distributing the skill as a standalone markdown file that can be placed in a project's .claude/skills/ directory.
This approach allows the skill to be versioned, shared, and easily added to any project that needs it.
-
✗ Hard-coding the skill into the global CLAUDE.md file on every developer's machine.
This is difficult to maintain and update across a large organization.
-
✗ Defining the skill as a prompt injection string to be used at the start of every session.
This is a security anti-pattern and is inefficient for long-term capability extension.
-
✗ Compiling the skill into a custom MCP server.
While possible, skills are intended to be instruction-based (markdown); MCP is better suited for data and external system integration.
-
-
14 Which command is used to initialize a new repository for use with Claude Code, ensuring the creation of necessary configuration files?
Most developer tools use a four-letter word starting with 'i' to begin a project's configuration.
claude init
'claude init' sets up the repository by creating initial configuration files like CLAUDE.md to guide the model's behavior.
-
✗ claude start
'claude start' is not a standard initialization command for repository setup.
-
✗ npm install claude
This installs a package but does not perform the repository-level initialization and configuration setup required for Claude Code.
-
✗ git init --claude
Git is a separate tool; while Claude Code works with Git, it does not use Git flags for its own initialization.
-
-
15 When building an agentic loop, what is the 'PostToolUse' hook primarily used for?
Think about the need for safety and validation in a non-deterministic agent loop.
Implementing programmatic guardrails to validate the state of the system after an action has been taken.
Hooks allow developers to run deterministic code to check if a tool's output is safe or if the system is still in a valid state before the model continues.
-
✗ Automatically committing changes to the Git repository after a tool finishes.
While a hook could do this, it is not its primary architectural purpose, and auto-committing is often discouraged without validation.
-
✗ Reducing the API latency by $200$ms by caching the tool's result.
Latency and caching are infrastructure concerns, not the primary focus of lifecycle hooks in the Agent SDK.
-
✗ Translating the tool's output from JSON into a human-readable PDF report.
Hooks are for control flow and validation; UI transformations are usually handled at the presentation layer.
-
-
16 Which of the following describes the most secure way to handle sensitive API keys when developing with Claude Code?
The answer involves a standard DevOps practice for managing 'Secrets'.
Setting them as environment variables on the host system or within a CI/CD secrets manager.
Environment variables are the standard, secure way to pass sensitive credentials to tools without exposing them in the codebase.
-
✗ Including them in the CLAUDE.md file as 'Environmental Context'.
Placing secrets in markdown files is a major security risk as they could be committed to version control.
-
✗ Providing them as plain text within a 'Select TWO' prompt response.
Manually providing secrets in prompts is insecure and violates the principle of keeping credentials out of the model's instruction context where possible.
-
✗ Hard-coding them into a custom Skill under .claude/skills/.
Hard-coding secrets is always an anti-pattern, regardless of the directory structure.
-
-
17 When Claude Code encounters a conflict between a rule in `~/.claude/CLAUDE.md` and one in `<project_root>/CLAUDE.md`, which one takes precedence?
Think about how CSS or Git configurations handle local versus global settings.
The project-level <project_root>/CLAUDE.md takes precedence.
Local configurations are more specific and are designed to override broader, global settings to ensure project-specific standards are met.
-
✗ The global ~/.claude/CLAUDE.md takes precedence because it defines the developer's core identity.
Global settings are meant to be generic; project-specific settings must be able to override them to meet specific repository needs.
-
✗ Both rules are concatenated, and the model must resolve the logic non-deterministically.
Configuration systems generally follow a deterministic 'most-specific wins' precedence rule to avoid ambiguity.
-
✗ Claude Code refuses to start until the conflict is manually resolved in settings.json.
Conflict resolution is built into the tool's hierarchy logic; manual intervention is not required for standard overrides.
-
-
18 A developer wants to use Claude Code to perform a large-scale refactor across multiple microservices. What is the most effective way to coordinate instructions across these repositories?
Consider the protocol designed to bridge the gap between models and external, reusable data/instruction sources.
Using a shared Model Context Protocol (MCP) server that provides a consistent 'prompts' resource to all sessions.
MCP servers can provide centralized, reusable prompts and instructions that multiple Claude Code instances can consume to ensure consistency.
-
✗ Copy-pasting the same instructions into every single terminal session.
This is inefficient and error-prone, lacking a 'single source of truth' for the standards.
-
✗ Storing the instructions in a shared Slack channel and having Claude 'read' the screen.
Screen reading is an unreliable and unstructured way to provide technical instructions to a CLI tool.
-
✗ Writing the instructions in the project root's .gitignore file.
The .gitignore file is for excluding files, not for providing architectural instructions or coordinating refactors.
-
-
19 In the context of Claude Code operation, what is 'Agentic Hierarchy'?
Think about how a human manager works with specialized team members.
A design pattern where a supervisor agent delegates specialized tasks to one or more subagents.
Hierarchy in agentic systems allows a main 'manager' agent to maintain high-level context while subagents handle specific, bounded technical tasks.
-
✗ The permission levels of different users on a Linux filesystem.
Filesystem permissions are OS-level; agentic hierarchy refers to the organization of AI agents themselves.
-
✗ The sequence of commands in a shell script from top to bottom.
This is linear execution, not an agentic hierarchy involving delegation and context isolation.
-
✗ The ranking of Claude models from Haiku to Opus based on intelligence.
This is a model performance tier list, not an operational architectural pattern for agents.
-
-
20 How does Claude Code determine which 'Skills' are available for use in a specific project directory?
The answer lies in the directory structure of the repository itself.
It scans the .claude/skills/ directory in the current project root and its parents.
Claude Code looks for skills in the standard project structure, allowing for both repo-specific and potentially inherited skills.
-
✗ It checks the developer's LinkedIn profile for verified AI certifications.
Skill availability is determined by technical configuration files, not by external social media or certification status.
-
✗ It asks the user to manually type out the markdown for every skill at the start of a session.
This defeats the purpose of 'reusable' skills; they are designed to be loaded automatically from the file system.
-
✗ It connects to a central Anthropic Skill Registry via the cloud.
While a registry might exist in the future, current operation relies on local or team-managed directories for skill definition.
-
-
21 What is the primary risk of using 'Select ALL' responses in an agentic loop without sufficient guardrails?
Focus on the 'safety' implications of letting an autonomous agent run without oversight.
The agent may enter an infinite loop of destructive actions if it incorrectly interprets a tool's failure.
Without proper 'stop_reason' handling and hooks, an agent might continue to try and 'fix' a situation using destructive tools, leading to compounding errors.
-
✗ The model will consume too many tokens and hit a rate limit.
While cost is a factor, the primary risk in a hard-difficulty engineering context is usually system safety and reliability.
-
✗ The model will switch to a non-English language to try and resolve the bug.
This is a rare and non-critical failure mode compared to the risk of destructive system actions.
-
✗ The .claude/rules/ directory will be deleted automatically.
Tools do not typically delete their own configuration directories as a result of an unconstrained loop.
-
-
22 A developer wants to use Claude Code to automatically generate a pull request description. Which built-in command or feature is best suited for this?
Consider the modularity of 'slash commands' and 'skills' for custom workflows.
A custom slash command that triggers a 'summarize changes' skill.
Custom slash commands paired with skills are the standard way to extend Claude Code with specific, repeatable workflows like PR generation.
-
✗ claude pr-create
This is not a standard built-in command for Claude Code; it typically uses its reasoning to generate content rather than having a fixed 'pr' flag.
-
✗ Setting 'auto-pr' to 'true' in settings.json.
Settings.json is for parameters, not for enabling complex, multi-step agentic workflows like summarizing and creating PRs.
-
✗ Deleting the .git folder so Claude can start fresh.
Deleting version control history is a destructive action that prevents rather than helps with PR generation.
-
-
23 Which of the following is a valid use case for 'Headless Mode' in an enterprise environment?
Look for a scenario that describes automation and 'no human present'.
Running a nightly script that uses Claude to audit code for security vulnerabilities and log results.
Headless mode is ideal for automated tasks that run without human intervention, such as cron jobs or CI/CD audits.
-
✗ Pair-programming with a senior developer in a live VS Code session.
Pair-programming is inherently interactive and benefits from the standard, non-headless TTY mode.
-
✗ Interviewing candidates to see how they interact with an AI assistant.
Interviews are interactive; headless mode would hide the very interaction the interviewer needs to observe.
-
✗ Debugging a complex UI issue that requires viewing browser artifacts.
Headless CLI tools are text-based; they are not the primary interface for visual debugging of browser-based UI issues.
-
-
24 Why is it important to include 'System Isolation' through subagents when working on a project with a very large context $(\approx 200,000$ tokens)?
Think about the cognitive load on a human�or an AI�when they have to remember too many things at once.
To prevent 'Context Drift' where the model loses focus on the primary task due to too much irrelevant data.
By delegating to subagents with smaller, targeted context windows, the system maintains higher precision and avoids the 'lost in the middle' phenomenon.
-
✗ Because Claude 3.5 Sonnet can only read $10,000$ tokens at a time.
Modern Claude models have much larger context windows; isolation is about quality and focus, not a hard $10k$ limit.
-
✗ To ensure that every subagent is charged a separate, lower API fee.
Fees are based on total token consumption; using more agents may actually increase costs, but it improves reliability.
-
✗ To allow the model to use the $\mathcal{O}(log n)$ search algorithm instead of linear search.
Search algorithms are part of the model's internal weights or tool implementation; subagents are an architectural pattern, not a search optimization.
-
-
25 A team uses a 'PreToolUse' hook to check for the presence of a 'STAGING' environment variable before allowing a 'deploy' tool to run. This is an example of:
Focus on the word that describes a 'hard stop' or 'safety gate' implemented in code.
Deterministic Guardrails
Guardrails implemented via hooks provide a programmatic, reliable way to enforce safety rules that cannot be bypassed by model hallucinations.
-
✗ Prompt Engineering
This is a programmatic code-level check, not an instruction written in a prompt.
-
✗ Model Optimization
Optimization focuses on cost, latency, or quality; safety hooks are a functional requirement for reliability and security.
-
✗ Context Engineering
While it affects how the model proceeds, it's about enforcing a rule rather than managing the structure or volume of the context window.
-