CCAR-F : Claude Code & Configuration (Domain 3)
Domain 3 : Claude Code Configuration & Workflows
This study guide provides a deep technical analysis of Domain 3 for the Claude Certified Architect – Foundations (CCAR-F) credential. This domain, representing 20% of the exam weight, focuses on the terminal-based Claude Code developer tool, its configuration hierarchy, agentic workflows, and integration into automated pipelines.
Architectural Overview of Claude Code
Claude Code is a specialized terminal-based developer tool designed to transform a local development environment into an agentic workspace. Unlike standard chat interfaces, Claude Code operates with direct access to the file system, shell execution, and version control systems. It acts as an autonomous agent capable of reasoning across codebases, executing tests, and implementing complex features through iterative refinement.
The architectural foundation of Claude Code rests on its ability to ingest local context while adhering to specific rulesets defined by the developer. This allows it to maintain consistency with existing coding standards, framework preferences, and organizational security protocols. For an architect, mastering Claude Code involves understanding how to bound its autonomy through configuration files and how to leverage its different execution modes for both interactive and automated tasks.
The CLAUDE.md Configuration Hierarchy
The primary mechanism for governing Claude Code’s behavior is the CLAUDE.md file. This markdown-based configuration serves as the localized “source of truth” or persistent ruleset for the agent. To manage complexity across various environments—from individual developer preferences to project-wide standards—Claude Code utilizes a strictly defined three-tier configuration hierarchy.
User Scope Configuration
User-level configurations are stored globally, typically in ~/.claude.json. This scope is used to manage personalized setups, authentication credentials, and global preferences that apply across all projects on a specific machine. While the architect focuses on project standards, understanding the User Scope is critical for managing environment variables and global MCP (Model Context Protocol) configurations that provide the foundational tools available to the agent.
Project Scope Configuration
The Project Scope is the most critical layer for technical leads. It is typically defined at the root of a repository using a CLAUDE.md file or a .mcp.json structure for tool integration. Because these files are checked into version control, they ensure that every team member—and the Claude agent itself—adheres to the same architectural standards.
Key elements of the Project Scope include:
- Coding Standards: Explicit instructions on indentation, naming conventions, and architectural patterns (e.g., “Use functional components over class components”).
- Testing Protocols: Commands used to run unit and integration tests, ensuring Claude can verify its own work.
- Preferred Frameworks: Guidance on which libraries or internal APIs to prioritize.
Directory Scope Configuration
For large or complex repositories, a monolithic configuration can become unwieldy. Directory Scope allows for localized overrides. By placing a specialized configuration file within a specific subdirectory, architects can apply context-sensitive rules that apply only to the files in that folder. For example, a src/backend directory might have different performance constraints and library requirements than a src/frontend directory.
Summary Table: Configuration Scopes
| Scope | Location | Primary Purpose |
|---|---|---|
| User | ~/.claude.json | Personalized setups, global authentication, and machine-specific preferences. |
| Project | Root CLAUDE.md or .mcp.json | Team-wide coding standards, framework alignment, and repository-wide tools. |
| Directory | Subdirectory overrides | Specialized rules for specific modules, localized testing protocols, and folder-specific context. |
Advanced Configuration: @import Syntax and .claude/rules/
As repositories scale, architects must move beyond a single markdown file to a modular configuration system. This is achieved through the use of the .claude/rules/ directory and specialized syntax for context injection.
Modularizing Rules with .claude/rules/
When a CLAUDE.md file exceeds several hundred lines, Claude may begin to miss specific instructions or suffer from “attention dilution.” The recommended architectural pattern is to split the monolithic file into topic-specific markdown files within the .claude/rules/ directory (e.g., api-conventions.md, security-standards.md, testing-logic.md).
These files support path-scoping using YAML frontmatter. This allows an architect to define exactly when a rule should be active based on glob patterns.
- Glob Patterns: Using syntax like
files: "src/api/**/*.ts", a rule can be configured to load only when Claude is working on relevant files. This reduces irrelevant token consumption and improves the model’s adherence to specific constraints.
The @import Syntax for Context Injection
The @import syntax serves as a powerful tool for context engineering. It allows developers to explicitly tell Claude Code to include the contents of other files into its active reasoning context. This is particularly useful for:
- Importing large documentation files.
- Referencing external configuration schemas.
- Linking related rule files across a modular setup.
By utilizing @import, the architect ensures that Claude has access to “just-in-time” information without overwhelming the initial system prompt.
Custom Slash Commands and Agent Skills
Claude Code provides a suite of interactive tools, but its true power in a professional workflow comes from customization via slash commands and skills.
Built-in Context Commands
Managing the session context is vital for maintaining accuracy and controlling token costs during long development sessions.
- /memory: This command allows Claude to store and retrieve persistent state about the current task. It is used to track progress across multiple turns, ensuring the agent doesn’t “forget” the initial objective.
- /compact: Long sessions generate extensive terminal logs, which can bloat the context window. The
/compactcommand compresses the active session log. It preserves a summary of past modifications and current objectives while discarding redundant terminal output tokens, thereby reducing costs and improving reasoning performance. - /context: Used to view or modify the current set of files and information Claude is considering for its current reasoning task.
Custom Commands in .claude/commands/
Architects can define custom slash commands within the .claude/commands/ directory. These commands allow for the automation of repetitive or complex sequences. A custom command might bundle a sequence of shell scripts, test runs, and specific context injections into a single trigger. This ensures that all developers on a project use the same automated verification steps.
Skills and “context: fork” Frontmatter
Skills are higher-level abstractions of agent behavior. When defining skills, developers can use YAML frontmatter to control context generation. The context: fork configuration is particularly significant. It allows the developer to isolate context generation paths. This ensures that when a sub-process or automated workflow is triggered, it does not inadvertently inherit or corrupt the primary session’s context, providing a “clean slate” for specific automated tasks.
Operational Modes: Plan Mode vs. Direct Execution
Claude Code operates in different modes depending on the complexity of the task and the level of oversight required.
Plan Mode (/plan) Workflow
Plan mode is the preferred starting point for complex architectural changes. When initiated via /plan, Claude does not immediately begin modifying files. Instead, it analyzes the codebase and generates a step-by-step proposal.
- Orchestration: Plan mode allows the architect to review the agent’s logic before execution.
- Verification: It serves as a checkpoint where the user can refine the proposed approach, ensuring the agent doesn’t head down an incorrect implementation path.
Direct Execution Dynamics
Direct execution is used for real-time, discrete tasks where a multi-step plan is unnecessary. In this mode, Claude takes immediate action (e.g., “Fix the typo in the README” or “Run the tests in the current directory”). While faster, it offers less opportunity for pre-execution intervention compared to Plan Mode.
The Explore Subagent in Action
During the discovery phase of a project, Claude Code may deploy the Explore subagent. This specialized internal agent is designed to navigate large directories, identify relevant code patterns, and map dependencies. The Explore subagent helps the primary agent build a mental model of the repository before the main work begins, which is essential for projects with high technical debt or poor documentation.
Iterative Refinement and Technical Patterns
Building production-grade code with an AI agent requires moving away from “one-shot” prompting toward iterative cycles of refinement. The exam evaluates three primary patterns for this process.
Test-Driven Iteration Pattern
This is the gold standard for agentic reliability. The workflow follows a predictable loop:
- Define Tests: The architect or the agent writes a failing test case that describes the desired feature.
- Implementation: Claude Code modifies the source code to pass the test.
- Verification: Claude runs the test suite.
- Refinement: If the tests fail, Claude analyzes the output, modifies the code, and runs the tests again. This continues until the code is functionally correct and deterministic.
Using Input/Output Examples
To ensure code generation matches specific stylistic or structural requirements, architects should provide explicit Input/Output examples. By showing Claude a “before” and “after” state of a similar code transformation, the agent can infer the correct logic more reliably than it could from natural language descriptions alone.
The Interview Pattern Strategy
The Interview Pattern is a proactive refinement technique where Claude is instructed to ask clarifying questions before taking any action. In the CLAUDE.md file, an architect can mandate this behavior: “If a request is ambiguous or involves high-risk modules, list three clarifying questions for the user before generating a plan.” This prevents wasted tokens and incorrect implementations caused by vague requirements.
Headless Execution and CI/CD Integration
For enterprise-scale development, Claude Code must function beyond the local terminal, integrating directly into Continuous Integration and Continuous Delivery (CI/CD) pipelines.
Non-Interactive Execution with the -p flag
The -p (or --prompt) flag allows Claude Code to run in a non-interactive, headless mode. This is essential for automated environments like GitHub Actions or Jenkins, where no human is present to provide feedback or approve plans. When running headlessly, Claude relies entirely on the pre-configured rules in CLAUDE.md and .claude/rules/ to make decisions.
Structured Outputs and Validation for CI/CD
In a CI/CD context, the output of a Claude Code run must be machine-readable to allow downstream systems to verify the result.
- —output-format json: This flag forces Claude to return its results as a structured JSON object rather than a natural language summary.
- —json-schema: To ensure the JSON output is valid and predictable, architects can provide a target validation schema. This ensures that the automated pipeline can programmatically extract fields like
status,modified_files, andtest_results.
Use Cases for Headless Claude Code
- Automated Pull Request Reviews: Claude can scan incoming PRs for style violations or security flaws defined in
.claude/rules/. - Automated Unit Testing: Running Claude in a pipeline to generate missing test coverage for newly added functions.
- Versioned Skills Promotion: Using CI/CD to test and promote new Agent Skills across different environments.
Strategy for Monorepos and Large-Scale Codebases
Architecting for a monorepo requires a sophisticated approach to context management. If Claude Code is pointed at the root of a massive repository without constraints, it may suffer from “Lost in the Middle” syndrome or excessive latency.
Path Scoping for Optimal Performance
Using the .claude/rules/ directory with path-scoping is mandatory for monorepos. By ensuring that backend-specific rules only activate for packages/api/** and frontend rules for packages/ui/**, the architect limits the amount of redundant information injected into each turn.
Context Compaction in Automated Pipelines
Even in headless mode, maintaining a clean context is necessary. Using commands that simulate the /compact logic during long-running automated jobs ensures that the agent stays focused on the final verification steps rather than the early logs of a long execution run.
Security and Bounding in Enterprise
In a production environment, architects must enforce least-privilege principles. This involves:
- Limiting the tools available to Claude via
allowedToolsconfigurations. - Ensuring that shell commands executed by Claude are bounded by the environment (e.g., containerization).
- Mandating that all autonomous changes are verified by a deterministic testing suite before being promoted.
Practice Assessment
Short-Answer Questions
- Where is the User Scope configuration for Claude Code stored on a local machine?
- Which command is used to compress the session log and discard redundant terminal output tokens?
- How does an architect apply specific rules to only the files within a
src/apidirectory using.claude/rules/? - What is the purpose of the
-pflag in the Claude Code CLI? - In the configuration hierarchy, which scope takes precedence: Project or Directory?
- What does the
context: forkfrontmatter in a skill definition allow a developer to do? - What is the difference between Plan Mode and Direct Execution?
- Why would an architect utilize the
@importsyntax in aCLAUDE.mdfile? - Which internal subagent is responsible for navigating large directories and mapping code patterns?
- How can an architect ensure that Claude’s JSON output in a CI/CD pipeline is syntactically valid for downstream tools?
Answer Key
- Answer: User Scope is stored in
~/.claude.json. - Answer: The
/compactcommand is used for this purpose to manage context bloat. - Answer: By using YAML frontmatter with glob patterns (e.g.,
files: "src/api/**/*") in a file within the.claude/rules/directory. - Answer: It enables non-interactive, headless execution for use in automated environments like CI/CD.
- Answer: Directory Scope takes precedence, as it provides localized overrides for the broader Project Scope.
- Answer: It allows for the isolation of context generation paths, ensuring automated workflows have a clean context slate.
- Answer: Plan Mode proposing a step-by-step strategy for review, while Direct Execution performs a task immediately without a proposal phase.
- Answer: To modularize documentation and rules, allowing for the explicit injection of relevant external file content into the agent’s context.
- Answer: The Explore subagent is responsible for codebase discovery and mapping.
- Answer: By using the
--output-format jsonflag in combination with a target validation schema via the--json-schemaparameter.
Open-Ended Design Questions for Reflection
- Monorepo Strategy: You are managing a monorepo with 50 packages across different languages (Go, TypeScript, and Python). Design a configuration strategy using
.claude/rules/that ensures Claude Code remains performant and follows language-specific standards without suffering from context bloat. - Automated Quality Gate: Describe how you would implement a headless Claude Code workflow in a GitHub Action that reviews incoming Pull Requests for security anti-patterns defined in your organizational
SECURITY.md. What flags and validation steps would you include? - Context Management: A developer is complaining that Claude Code is becoming “forgetful” and making errors during a 4-hour interactive session involving deep refactoring. Analyze the potential causes and propose a set of slash commands the developer should use to remediate the session.
- The Interview Pattern: Design a
CLAUDE.mdruleset that implements an “Interview Pattern” for a team of junior developers. How would you structure the instructions to ensure Claude minimizes “hallucinated” requirements in high-risk areas like database migrations? - Modular Skills: Your team has developed a custom “Deployment Skill” for Claude Code. How would you use YAML frontmatter and directory scoping to ensure this skill is only available to senior-level architects and only activates within the
deploy/directory of the project?
Glossary of Key Terms
- CLAUDE.md: A markdown file that serves as the localized, persistent ruleset for a workspace, defining standards and testing protocols.
- Path-Scoping: The technique of using glob patterns in YAML frontmatter to restrict a rule’s activation to specific files or directories.
- Glob Pattern: A string of characters used to specify sets of filenames with wildcard characters (e.g.,
**/*.js). - Headless Execution: Running a tool like Claude Code without user interaction, typically in a server or CI/CD environment using the
-pflag. - Plan Mode: An execution mode where Claude proposes a multi-step strategy for a task before making any changes, allowing for user review.
- Explore Subagent: An internal agentic process within Claude Code that maps repository structures and identifies relevant code patterns during discovery.
- Context Compaction: The process of summarizing past interactions and objectives to free up space in the model’s context window, triggered by
/compact. - Slash Command: A terminal-based shortcut (e.g.,
/memory,/context) used to manage the agent’s environment or behavior. - Agent Skill: A high-level, reusable abstraction of an agentic workflow that can be configured and triggered within Claude Code.
- JSON Schema: A declarative language used to annotate and validate the structure and data types of JSON documents.
- YAML Frontmatter: Metadata placed at the beginning of a markdown file, used by Claude Code to define scoping and context rules.
- Interview Pattern: A developer-defined behavioral rule where the agent must ask clarifying questions before executing a task.
- Test-Driven Iteration: A workflow where the agent continuously modifies code and runs automated tests until the desired functionality is verified.
- @import Syntax: A command used within configuration files to explicitly pull the content of external files into the model’s active context.
- AllowedTools: A configuration parameter used to restrict the specific functions or tools an agent is permitted to execute.
- Context: Fork: A specific frontmatter configuration that isolates the generation of context for a sub-workflow or skill.
- User Scope: The most global tier of configuration, stored in the user’s home directory for machine-wide settings.
- Project Scope: The repository-level configuration tier that defines standards for all team members.
- Directory Scope: The most localized tier of configuration, providing overrides for specific folders within a project.
Leaderboard
No scores saved yet. Be the first!
20 Questions — Domain 3 : Claude Code Configuration & Workflows
Expand any question to reveal the correct answer and explanation.
-
1 A new developer joins your team and clones the project repository. They report that Claude Code is not following the established architectural standards defined in the team's $~/.claude/CLAUDE.md$ file. Why is the developer experiencing this issue?
Consider which levels of the configuration hierarchy are typically included in a git repository.
User-level settings in ~/.claude/CLAUDE.md apply only to the local user and are not shared via version control.
Configuration hierarchy dictates that user-scoped files are personal and do not persist across repository clones for other team members.
-
✗ The developer needs to manually run the /load command to sync the user-level configuration from the original author.
There is no '/load' command for syncing user-level markdown files across different machines.
-
✗ The project-level CLAUDE.md file is likely corrupted, preventing the user-level file from being inherited correctly.
User-level and project-level files are independent; a project-level error would not stop a local user-level file from functioning for that specific user.
-
✗ Claude Code requires a specific environment variable, CLAUDE_SYNC_GLOBAL, to be set to true to read from the home directory.
Claude Code reads the user-level hierarchy by default without requiring specialized environment variable flags.
-
-
2 Your project has testing standards that must apply to all files matching the pattern $**/*.test.tsx$, regardless of their directory. What is the most maintainable way to implement this in Claude Code?
Think about how to conditionally load conventions based on file naming patterns.
Create a file in .claude/rules/ with YAML frontmatter specifying the glob pattern in the 'paths' field.
Path-scoped rules using glob patterns allow for conditional loading, ensuring conventions are only applied to relevant files while reducing context bloat.
-
✗ Place a duplicate CLAUDE.md file in every subdirectory that contains a test file.
Duplicating configuration files leads to high maintenance overhead and potential inconsistencies as standards evolve.
-
✗ Add a comprehensive 'Testing' section to the root CLAUDE.md and instruct Claude to look for it when editing any file.
Monolithic files increase token usage and context noise by providing irrelevant instructions for non-test files.
-
✗ Use a project-level .mcp.json file to map specific file extensions to mandatory system prompts.
The .mcp.json file is used for configuring Model Context Protocol servers, not for path-based markdown rule activation.
-
-
3 You are creating an 'Agent Skill' in $.claude/skills/codebase_analysis.md$ that explores complex dependencies. You want to ensure that the extensive output from this discovery phase does not exhaust the context window of your main conversation. Which frontmatter configuration should you use?
Look for a setting that creates a separate branch for the skill's execution.
context: fork
The 'context: fork' option runs the skill in an isolated sub-agent context, preventing verbose exploratory data from polluting the main session.
-
✗ isolation: true
This is not a recognized frontmatter parameter for Claude Code Agent Skills.
-
✗ mode: autonomous
While skills are agentic, 'mode: autonomous' does not specifically address context isolation or window management.
-
✗ subagent: explore
While the Explore subagent exists, 'subagent' is not the correct frontmatter key for configuring skill isolation.
-
-
4 Your team is planning to migrate a large monolith to microservices, a task involving changes to 50+ files and significant architectural boundary decisions. Which Claude Code mode is most appropriate for the initial phase of this task?
Consider which mode focuses on design and exploration before execution.
Plan mode, because it enables safe codebase exploration and architectural design before committing to file modifications.
Plan mode is specifically designed for complex tasks requiring architectural decisions and large-scale, multi-file changes.
-
✗ Direct Execution mode, because it allows for immediate, incremental changes as boundaries are discovered.
Direct execution on high-complexity tasks risks costly rework and inconsistent service boundaries due to lack of upfront design.
-
✗ Interactive mode with the /compact command enabled to preserve memory during the long migration.
/compact is a session management tool, not a functional mode for architectural planning.
-
✗ Headless mode with the -p flag to ensure the model follows a pre-defined migration script without deviation.
Headless mode is for CI/CD automation, not for exploratory architectural design which requires human-in-the-loop validation.
-
-
5 An automated CI/CD pipeline script invokes Claude Code to review a Pull Request, but the job hangs indefinitely and eventually times out. What is the most likely cause?
Automated environments cannot provide the feedback Claude usually expects from a terminal user.
The pipeline is not using the -p (or --print) flag, causing Claude Code to wait for interactive user input.
In automated environments, the non-interactive '-p' flag is required to prevent the process from stalling on a request for user confirmation.
-
✗ Claude Code has exceeded its token budget for the daily CI run.
Token budget exhaustion would typically result in an error message rather than an indefinite hang.
-
✗ The CLAUDE.md file in the repository contains a /plan command that requires a manual override.
Slash commands like /plan are interactive tools and would not be executed as part of a static configuration file initialization.
-
✗ The CI environment lacks a valid .mcp.json file, causing a connection retry loop.
Missing MCP configurations usually lead to tool unavailability rather than blocking the entire execution indefinitely.
-
-
6 You want to keep your project's $CLAUDE.md$ modular by separating team-specific standards from general coding conventions. Which syntax allows you to reference external standards files within $CLAUDE.md$?
Think of a directive often used in stylesheets or modern languages for modularity.
@import "path/to/file.md"
The '@import' syntax is specifically used to keep CLAUDE.md modular by referencing external files relevant to specific packages or domains.
-
✗ #include "path/to/file.md"
This is a C-style preprocessor directive, not the syntax used by Claude Code.
-
✗ !link(path/to/file.md)
This is not valid syntax for modular configuration in Claude Code.
-
✗ <<[path/to/file.md]
This syntax is not used by Claude Code for importing or referencing external rule sets.
-
-
7 A developer is creating a 'Security Audit' skill. To prevent the agent from accidentally modifying the codebase during the audit, which frontmatter parameter should be configured in the $SKILL.md$ file?
Look for a way to explicitly define which functions the agent can invoke.
allowed-tools: ["Read", "Grep", "Glob"]
The 'allowed-tools' parameter restricts the agent's capabilities during skill execution, preventing destructive actions like 'Write' or 'Edit'.
-
✗ read-only: true
This is not a valid frontmatter key; tool restrictions are handled through more granular tool access lists.
-
✗ prevent-modifications: yes
This is not a standard configuration property for Agent Skills.
-
✗ capabilities: ["search", "read"]
Capability-based naming is used in some SDKs, but Claude Code specifically uses a tool-allow-list.
-
-
8 You have been investigating a bug in a named session resumed with $--resume bug-fix-123$. After several unsuccessful attempts, you want to explore an entirely different refactoring approach without losing the current investigation's history. What is the best command to use?
Think of a term used in version control to create a new path from a shared point.
fork_session
The 'fork_session' command creates an independent branch from the shared analysis baseline, allowing for divergent exploration.
-
✗ /compact
This command compresses the current session log to save tokens; it does not create a new session branch.
-
✗ --new-session
Starting a completely new session would lose the initial codebase analysis and context already established.
-
✗ /memory
This command is used to verify loaded memory files, not to manage session state or branches.
-
-
9 When using Claude Code for complex discovery tasks, why is it architecturally preferable to use the 'Explore' subagent rather than performing all discovery in the main session?
Consider the impact of large amounts of raw data on a conversation's focal point.
It isolates verbose discovery output, returning only summaries to preserve the main conversation context.
Isolating discovery prevents the main session's context window from being filled with raw data, which can lead to 'lost-in-the-middle' effects.
-
✗ The Explore subagent has a larger context window than the main session agent.
Both typically operate within the same model constraints, but they manage token distribution differently.
-
✗ The Explore subagent is significantly cheaper per token than the main session agent.
Costs are determined by the underlying model; using a subagent actually adds a small coordination overhead.
-
✗ The Explore subagent is the only way to access restricted built-in tools like Bash and Glob.
The main agent can also access built-in tools unless specifically restricted by 'allowed-tools' configuration.
-
-
10 You are integrating Claude Code into a CI pipeline for automated pull request feedback. You want the output to be machine-parseable for a downstream script that posts inline GitHub comments. Which CLI configuration is required?
Identify the flags used to enforce a specific machine-readable format and its structure.
claude -p --output-format json --json-schema "schema_definition_here"
Using '--output-format json' with '--json-schema' ensures that the headless output is structured and valid for automated consumption.
-
✗ claude -p --format json --schema-file pr_review.json
While 'json' is correct, the specific flag names in the example are incorrect based on the Claude Code documentation.
-
✗ claude --print --structured-mode
The flag '--structured-mode' is not a standard CLI option for Claude Code; schema enforcement is done through specific JSON flags.
-
✗ claude -p --github-mode
Claude Code does not have a native '--github-mode'; integration is achieved via structured JSON output and custom scripts.
-
-
11 You have defined a custom slash command in $~/.claude/commands/deploy.sh$. Why is this command not appearing for your teammates when they run Claude Code in the same project repository?
Differentiate between global user configuration and project-specific repository files.
The command is stored in a user-scoped directory (~/.claude/commands/) rather than a project-scoped directory (.claude/commands/).
User-scoped commands are personal and stay on the local machine; project-scoped commands are committed to the repository and shared.
-
✗ Slash commands must be written in Python to be shared across different operating systems.
Command language is not the issue; the storage location in the hierarchy is the primary factor for visibility.
-
✗ The developer needs to run /reload-commands to sync with the global command registry.
Claude Code does not use a central 'global registry' that requires a sync command for local files.
-
✗ Claude Code only shares commands defined within CLAUDE.md using the @command directive.
CLAUDE.md is for rules and context, while specific command files are stored in the '.claude/commands' directory.
-
-
12 When configuring conventions for a project, why would an architect choose path-specific rules in $.claude/rules/$ over placing $CLAUDE.md$ files in multiple subdirectories?
Think about conventions that apply to specific file types spread across the entire project structure.
Path-specific rules use glob patterns to apply conventions to matching files regardless of their directory location.
Glob patterns (e.g., in .claude/rules/) allow conventions to span the entire codebase without the need for redundant, directory-bound configuration files.
-
✗ Path-specific rules load globally, whereas subdirectory CLAUDE.md files are ignored by sub-agents.
Sub-agents follow the same configuration hierarchy as the main agent.
-
✗ Subdirectory CLAUDE.md files are only effective if they contain at least 100 lines of instructions.
There is no minimum line requirement for configuration files to be effective.
-
✗ CLAUDE.md files in subdirectories cause a 'context loop' that can crash the Claude Code CLI.
While inefficient, subdirectory overrides are a supported part of the hierarchy and do not cause system crashes.
-
-
13 Claude Code's behavior in your project has become inconsistent. You suspect that a conflicting rule is being loaded from a forgotten configuration file. Which command should you use to troubleshoot this?
Look for a command that helps you see what Claude is 'remembering' about your project setup.
/memory
The '/memory' command allows you to verify which memory/configuration files are currently loaded and diagnose inconsistent behavior.
-
✗ /compact
This command reduces history tokens and does not provide a diagnostic report of active configuration files.
-
✗ /rules
While it sounds relevant, '/rules' is not a standard Claude Code command for inspecting the configuration hierarchy.
-
✗ /context --list
This is not the correct command for diagnosing configuration file loading issues in Claude Code.
-
-
14 You are designing an Agent Skill that requires a specific project name as an input. You want to ensure that if a developer forgets to provide the name, Claude Code proactively prompts them for it. Which frontmatter setting should you use?
Identify the frontmatter key used to provide a nudge or tip for missing parameters.
argument-hint: "Please provide the target project name."
The 'argument-hint' frontmatter is used to prompt developers for required parameters when a skill is invoked without them.
-
✗ required-args: ["project_name"]
This is not the documented frontmatter key for prompting users for missing arguments.
-
✗ prompt-on-empty: project_name
This property does not exist in the Agent Skills frontmatter specification.
-
✗ input-validation: { project_name: "required" }
Skill frontmatter uses simpler key-value pairs rather than complex validation objects for argument prompting.
-
-
15 According to the principles of test-driven iteration in Claude Code, what is the most effective way to guide the agent through a progressive improvement of a failing feature?
Focus on providing concrete, deterministic evidence of failure to guide the model.
Writing a test suite first and sharing the specific test failures with the agent to guide fixes.
Sharing concrete test failures provides deterministic feedback, allowing the model to refine its output until it meets a defined pass criterion.
-
✗ Writing a detailed prose description of why the current implementation is logically flawed.
Prose can be ambiguous; the model may interpret descriptions inconsistently across different iterations.
-
✗ Increasing the max_tokens limit to allow the model more 'thinking' space during code generation.
Context size does not improve logical accuracy or provide a feedback loop for iterative refinement.
-
✗ Resetting the session after every failed attempt to prevent 'stale logic' from influencing the next run.
Resetting prevents the agent from learning from its previous mistakes, which is counterproductive to iterative improvement.
-
-
16 You are using Claude Code to fix multiple bugs in a single session. When should you provide all issues in one message versus addressing them sequentially?
Consider the relationship between the problems being solved.
Provide all issues at once when the fixes for the issues are likely to interact with each other.
Interacting issues require the model to consider the unified system state, which is best handled by presenting the related context together.
-
✗ Provide all issues at once when the problems are independent and do not overlap.
Independent problems are easier to fix sequentially to prevent the model from getting distracted or overwhelmed.
-
✗ Always provide issues sequentially to minimize token usage and avoid 'lost-in-the-middle' effects.
While sequential is common, it is not an 'always' rule; interacting issues are an exception that require simultaneous context.
-
✗ Provide all issues at once only if you are using the Message Batches API to save on costs.
Cost optimization is a separate concern from the logical decomposition of debugging tasks.
-
-
17 Why is it recommended to use a second, independent Claude instance to review code generated by the first instance in a CI/CD pipeline?
Consider the benefit of a 'fresh pair of eyes' in a standard software engineering review.
The generating instance is less effective at reviewing its own changes because it lacks fresh perspective and objectivity.
An independent reviewer does not share the generator's internal reasoning context, allowing it to catch assumptions or errors the generator overlooked.
-
✗ To double the speed of the code review by using parallel processing resources.
Speed is not the primary driver; architectural integrity and objectivity are the focus of multi-instance patterns.
-
✗ Anthropic's security policy requires a dual-signature model for all code modifications.
While good practice, this is a procedural choice rather than a hard-coded technical requirement of the platform.
-
✗ A second instance is required because the first instance's context window will be full after generation.
Generating code does not necessarily fill the context window, and a fresh session could be used on the same instance.
-
-
18 In long-running Claude Code sessions, you notice response times are increasing and the model is becoming less responsive. Which command helps manage history tokens without losing the high-level summary of the session?
Think of a term for making something smaller and more dense while keeping its core.
/compact
The '/compact' command compresses the session log, preserving modified summaries of past objectives while discarding redundant output tokens.
-
✗ /clear
This command typically wipes the session history completely, which is not desired if summaries need to be preserved.
-
✗ /memory --reset
Resetting memory would remove all configuration rules and project context, not just conversation history.
-
✗ /summarize
While logically similar, '/summarize' is not the standard command used by Claude Code for token management.
-
-
19 How does Claude Code handle a directory-level $CLAUDE.md$ file that conflicts with a root-level $CLAUDE.md$ file?
Think about how scoping works in CSS or file systems, where the more 'specific' rule wins.
The localized directory-level file overrides the root-level configuration for that specific folder.
Claude Code's hierarchy follows a precedence rule where directory-specific overrides take priority over more general project-level instructions.
-
✗ The root-level file takes precedence because it is the primary project configuration.
In standard configuration hierarchies, the most localized rule (the one closest to the file being edited) usually takes precedence.
-
✗ Both files are ignored, and Claude reverts to the user-level global configuration.
Conflicting configurations lead to precedence resolution, not a total abandonment of the project context.
-
✗ The CLI will throw a 'Hierarchy Conflict' error and refuse to execute any changes until the files are merged.
Claude Code resolves these conflicts silently based on standard scoping rules.
-
-
20 When resuming a named session after a significant period where external code changes were made, why is starting a fresh session with a structured summary sometimes more reliable than using $--resume$?
Consider the state of 'truth' regarding the files when context is preserved from the past.
The resumed session may contain stale tool results that contradict the current state of the codebase.
Resuming context from a time before code was modified means Claude's internal model of the files is outdated, leading to errors.
-
✗ Resuming a session consumes double the tokens as a fresh session.
Resuming a session does not inherently double token consumption; it is the 'stale' context that is the concern.
-
✗ Anthropic limits named session persistence to a maximum of 48 hours.
There is no documentation supporting a 48-hour hard limit on named session persistence.
-
✗ Named sessions are read-only and cannot be used to perform new file modifications.
Named sessions are fully interactive and can be used for any standard development task.
-