22 Claude Code Configuration & Workflows Practice Questions & Answers
Every Claude Code Configuration & Workflows practice question from the Claude Certified Architect – Foundations Practice Test, with the correct answer and a short explanation.
Start practice test →1. A team's shared coding conventions live in ~/.claude/CLAUDE.md on the tech lead's machine. New hires clone the repository and find that Claude Code ignores those conventions entirely. What is the correct fix?
- A.Move the conventions into ./CLAUDE.md at the repository root and commit it, so every clone loads that file.✓ Answer
- B.Keep the file at ~/.claude/CLAUDE.md and have each new hire copy the lead's version into their own home directory.
- C.Paste the conventions into a project slash command that reviewers run by hand before approving each pull request.
- D.Add the conventions to the lead's prompt template and ask teammates to paste that text at the start of each session.
Memory files have scopes: a user-level file under ~/.claude/ is personal and applies to all of that one person's projects, while a project-level ./CLAUDE.md (or ./.claude/CLAUDE.md) travels with the repository through version control. Team conventions placed at user level can never reach a teammate, so the fix is to relocate them to the project scope and commit the file.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 3: Claude Code Configuration; Claude Code memory docs (user vs project memory scope)Report a problem with this question
2. A team is deciding what goes into the project-level CLAUDE.md and what stays in individual prompts. Which split matches the file's purpose?
- A.The current ticket text and the list of files to touch belong in the file; the team's conventions belong in each prompt.
- B.Build commands, architecture notes and prohibitions belong in the file; the details of today's task belong in the prompt.✓ Answer
- C.Only a one-line description of the project belongs in the file; commands and conventions belong on a pinned team wiki page.
- D.Anything the model got wrong twice belongs in the file; commands, conventions and prohibitions belong in each new prompt.
The project instruction file is loaded at the start of every session, so it should hold what is true of the project across all tasks: how to build and test, how the code is laid out, what to name things, and what must never be done. Anything specific to one piece of work is cheaper and clearer in the prompt, where it does not persist as standing instruction for unrelated tasks.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 3: project memory content vs per-task prompt contentReport a problem with this question
3. A convention applies only to test files named *.test.tsx, which sit beside the components they test across many directories. How should the team configure it so the agent loads it only for that work?
- A.Put it in a rules file under .claude/rules/ and list the test-file glob in its paths frontmatter field, so it loads on match.✓ Answer
- B.Put a CLAUDE.md in every directory that holds test files, so the convention loads on demand when Claude reads a file there.
- C.Put it in the root CLAUDE.md, opening with a line that tells Claude to apply it only when it is editing a test file.
- D.Put it in a skill and ask teammates to invoke that skill by name whenever they request a change to a test file.
Path-scoped rule files carry a paths list of glob patterns in their frontmatter and are loaded only when Claude works with files that match, which is exactly the case where the relevant files are spread across the tree rather than gathered in one folder. A directory-level CLAUDE.md only helps when the convention really is confined to a subtree, and a prose caveat in the root file still consumes context in every session.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 3: .claude/rules/ path-scoped rules with paths frontmatterReport a problem with this question
4. A project CLAUDE.md has grown long, so a developer proposes splitting sections into separate files pulled in with @import. What does that actually achieve?
- A.It defers each imported file until Claude touches a matching path, so only the relevant standards sit in the session context.
- B.It keeps the standards modular and easier to maintain, but the imports still load at launch, so context use is unchanged.✓ Answer
- C.It lets each teammate override an imported file locally, so the project file stays authoritative while personal edits apply.
- D.It compresses the imported sections into a summary at launch, so the standards remain available at a fraction of the context.
@import is an organisational mechanism: the referenced files are resolved and loaded with the rest of the memory file when the session starts, so the token cost is the same as if the text had been inline. Conditional, path-triggered loading is what rule files with paths frontmatter provide, not what @import does.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 3; Claude Code memory docs (@import resolution at launch)Report a problem with this question
5. A team wants a /release-checks command that everyone gets automatically when they clone the repository. Where should it be defined?
- A.In a markdown file under .claude/commands/ in the repository, committed so every clone exposes the command.✓ Answer
- B.In a markdown file under ~/.claude/commands/ on each machine, which every teammate copies after cloning.
- C.In a commands array inside .claude/config.json in the repository, listing each command's name and prompt.
- D.In a skill under .claude/skills/ whose frontmatter registers a name so it shows up in the slash menu.
Slash commands are markdown files discovered by directory: .claude/commands/ in the repository is project-scoped and version-controlled, so pulling the repo is all a teammate has to do, while ~/.claude/commands/ is personal to one machine. There is no commands array in a .claude/config.json file, and a skill is loaded by relevance rather than registered as a slash entry.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 3: project vs personal slash command directoriesReport a problem with this question
6. Which container fits a multi-step migration procedure that the agent should pick up on its own whenever the work touches the payments module, without anyone naming it?
- A.A slash command, because typing its name is the quickest way to pull a procedure into the chat.
- B.A skill, because its description lets the model load the procedure when the work matches.✓ Answer
- C.A hook, because the harness can inject the procedure deterministically before every tool call.
- D.A subagent, because a separate context is the only place a long procedure can be stored safely.
A skill is packaged instructions plus a description that the model matches against the current work, so it is loaded on demand without an explicit invocation. A slash command is an invocation shortcut that someone must type, a subagent is a separate context with its own brief, and a hook is harness automation tied to events rather than to the topic of the work.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 3: skills vs slash commands vs subagentsReport a problem with this question
7. A skill runs a dependency audit whose output is thousands of lines that nobody needs once the summary exists. Which frontmatter setting addresses that?
- A.context: fork, which runs the skill in an isolated subagent and returns only its result to the main conversation.✓ Answer
- B.argument-hint, which asks for the audit scope up front so the skill examines a narrower set of packages.
- C.model, which routes the skill to a smaller model whose replies are shorter for this kind of bulk output.
- D.allowed-tools, which limits which tools the skill may call so the audit produces fewer lines of output.
Running a skill with context: fork gives it its own isolated context, so the verbose intermediate output is consumed there and only the finished result comes back to the main thread. That is the general reason to reach for a subagent: work whose raw material nobody needs afterwards should not occupy the context the rest of the session depends on.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 3; Claude Code skills docs (frontmatter: context, allowed-tools, argument-hint)Report a problem with this question
8. A CI job runs `claude "review this diff"` as a build step and the job hangs until it is killed by the timeout. What fixes it?
- A.Pipe the diff in on stdin, which the CLI treats as a signal to run once and exit without prompting.
- B.Run it with -p (--print) for a non-interactive run, plus --output-format json to parse the findings.✓ Answer
- C.Set CLAUDE_HEADLESS=1 in the job so the CLI skips the interactive prompt and streams plain text output.
- D.Add the --batch flag so the CLI queues the request and exits, then poll for the result in a later step.
A bare invocation opens an interactive session, which never terminates in an environment with no terminal attached; -p (--print) is the documented flag for a single non-interactive run that prints and exits. Pairing it with --output-format json makes the result machine-parseable so findings can be posted as PR comments, whereas CLAUDE_HEADLESS and --batch are not real controls.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 3: headless/CI invocation (-p/--print, --output-format json)Report a problem with this question
9. An engineer is writing the loop that drives an agent through tool calls. Which control flow is correct?
- A.Continue for a fixed ten iterations, appending each tool_result, and return whatever has accumulated.
- B.Continue while stop_reason is tool_use, appending each tool_result, and stop when stop_reason is end_turn.✓ Answer
- C.Continue while the reply contains a text block, appending each tool_result, and stop once only text is back.
- D.Continue until the assistant's text says the task is done, appending each tool_result as the loop goes.
stop_reason is the structured signal the API gives for why the turn ended, so the loop condition belongs there: tool_use means the model is waiting on results, end_turn means it is finished. Parsing natural-language completion phrases, counting to a fixed cap, or inspecting whether text blocks are present all substitute a probabilistic cue for a deterministic one and will terminate early or late.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 1: agentic loop control via stop_reasonReport a problem with this question
10. A repository requires a formatter to run before every commit. The instruction is in CLAUDE.md, but the agent occasionally commits without it. What makes the step reliable?
- A.Move the formatter into a skill and require the model to load it before committing, making it part of the workflow.
- B.Deny the commit tool entirely and have the model ask a person to commit, removing any chance of an unformatted commit.
- C.Configure a hook that the harness runs on the matching tool call, since it fires regardless of the model's choices.✓ Answer
- D.Restate the rule in stronger wording at the top of CLAUDE.md, since instructions placed early are followed much more reliably.
A hook is automation the harness executes on a matching event, not an action the model elects to take, so it runs on every occurrence with no dependence on instruction-following. Prompt-level instructions, however emphatic or well placed, have a non-zero failure rate, which is why anything business-critical is enforced structurally instead.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 1: hooks as deterministic enforcement vs prompt instructionReport a problem with this question
11. A team is drafting permission rules for its agent. What is the difference between an allow rule and a deny rule?
- A.A deny rule blocks the matching call even when an allow rule would cover it; an allow rule only skips the prompt.✓ Answer
- B.Both are advisory hints the model weighs when choosing tools, so firmer wording in a deny rule matters most.
- C.An allow rule blocks everything it does not list, while a deny rule merely warns and lets the call proceed.
- D.A deny rule holds for the current session only, while an allow rule persists once it has been approved once.
Permission rules are evaluated by the harness, not by the model, and a deny match wins over an allow match, which is why deny is the stronger statement: it removes a capability outright rather than smoothing its use. An allow rule does not grant anything the agent could not otherwise attempt; it only pre-approves the call so no confirmation is asked.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 3: permission rules; Claude Code permissions (deny takes precedence over allow)Report a problem with this question
12. Before adopting an agentic coding tool, a team debates granting it unrestricted shell execution. Why is that a different category of risk from file-editing permission?
- A.Unrestricted shell execution mainly raises cost, since the agent runs many more commands per task than it otherwise would.
- B.Unrestricted shell execution weakens tool choice, since a shell competes with the built-in file tools for the same jobs.
- C.Unrestricted shell execution subsumes the other permissions, since a command can reach files and hosts no rule ever listed.✓ Answer
- D.Unrestricted shell execution slows review, since reviewers must read command transcripts as well as the resulting file diff.
A shell is a superset capability: whatever the surrounding tool permissions carefully scope, a single command can do anyway, including reading files outside the project and opening network connections. That is why adoption requires answering what the agent may run, what it may reach on the network, what a person must confirm, and what is logged, and why shell access is scoped to named commands rather than granted wholesale.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 3: permissions and least-privilege scoping of executionReport a problem with this question
13. A coordinator delegates part of a task to a subagent, and the subagent immediately asks for information the coordinator already established several turns earlier. What explains this?
- A.The subagent reads shared history lazily, so anything not yet in CLAUDE.md is missing on its first turn.
- B.The subagent begins with an isolated context and inherits none of the coordinator's history, so facts must be in its prompt.✓ Answer
- C.The subagent shares memory only with earlier invocations, so coordinator facts arrive one delegation later than expected.
- D.The subagent inherits the history but has a smaller window, so the earliest part of the transcript is dropped first.
Subagents run in their own context and neither inherit the coordinator's conversation nor share memory between invocations, which is exactly what makes them useful for isolating verbose work. The consequence for design is that every fact a subagent needs has to be stated explicitly in the delegating prompt.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 1: subagent context isolation and explicit context passingReport a problem with this question
14. A team wants everyone to connect to the same Jira MCP server, without the API token ending up in the repository. What configuration achieves both?
- A.Have every teammate add the server to their own ~/.claude.json by hand, keeping project configuration out of the repo.
- B.Commit .mcp.json at the project root and write the token as ${JIRA_TOKEN}, expanded from each developer's environment.✓ Answer
- C.Commit a setup script that writes the token into ~/.claude.json on first run, so the server appears for everyone.
- D.Commit .mcp.json at the project root with the token written inline, then add that file to .gitignore after the first push.
Project-level .mcp.json is the shared, version-controlled place to declare a server — its transport and launch details — so a clone gets the same tooling, and ${ENV_VAR} expansion keeps the secret in each developer's environment rather than in the file. Committing a token inline leaks it into history even if the file is later ignored, and per-machine setup drifts because nothing keeps the copies in step.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 2: MCP configuration scoping (.mcp.json project scope, ${ENV_VAR} expansion)Report a problem with this question
15. Two MCP tools are described as "Retrieves customer information" and "Retrieves order details." The agent keeps calling the wrong one. What is the first fix?
- A.Expand each description with input formats, example queries and explicit boundaries against the neighbouring tool.✓ Answer
- B.Put a routing layer in front of both tools that reads keywords in the request and forwards it to one of them.
- C.Merge the two into a single tool with a mode parameter, so the model never chooses between similar options.
- D.Add few-shot examples to the system prompt that pair sample requests with the tool that should answer each.
Tool descriptions are the primary information the model uses to select a tool, so two terse and near-identical descriptions are the root cause rather than a symptom. Fixing the descriptions is also the lowest-effort leverage point: a routing layer, a merged tool with a mode flag, or prompt examples all add machinery around a defect that lives in the tool definitions themselves.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 2: tool descriptions as the primary selection mechanismReport a problem with this question
16. An MCP lookup tool returns the string "Operation failed" both when the backend times out and when a valid search returns zero matches. How should the two cases be reported?
- A.Return isError for both cases, adding the elapsed time so the agent can infer which case it hit before retrying.
- B.Return isError for the timeout, and raise an exception on no matches so the agent stops instead of reporting a false absence.
- C.Return a successful result for both cases, with the failure wording in the text so the agent can read it and decide.
- D.Return isError with a category and a retryable flag for the timeout, and a successful empty result for no matches.✓ Answer
A timeout is an access failure that leaves the answer unknown and may be worth retrying, while a query that legitimately matched nothing is a successful call whose result is empty; collapsing them makes the agent retry a settled question and treat an outage as an absence. The isError flag plus structured metadata — error category, a retryable boolean, a human-readable description — is what lets the agent choose between retrying, escalating, and reporting the empty result.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 2: MCP error semantics (isError, error metadata, access failure vs empty result)Report a problem with this question
17. An engineer must find every call site of a function in an unfamiliar repository. Which use of the built-in tools fits the job?
- A.Glob for file names matching the module's path pattern, then Read each match to see where it is called.
- B.Read the entry point and each file it imports in turn, since only a full pass guarantees nothing is missed.
- C.Edit a marker into the function body, then run the test suite so failures reveal which files call it.
- D.Grep for the function name to find the call sites, then Read those files to follow the imports around them.✓ Answer
Grep searches file contents, which is what a call site is, while Glob matches file paths and names and would only find files whose names happen to fit a pattern. Exploring incrementally — search for the entry points, then read the specific files those hits identify — also keeps the context free of material that reading everything upfront would dump into it.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 2: built-in tools (Grep searches contents, Glob matches paths)Report a problem with this question
18. A code-review agent has detailed written instructions, yet its findings vary in format and it handles ambiguous cases inconsistently. What addresses this?
- A.Add two to four examples showing the exact output shape and the reasoning behind one call over its alternative.✓ Answer
- B.Raise the number of review passes to three and keep only the findings that appear in at least two of the runs.
- C.Add a conservative instruction to report only findings the model is confident about, which steadies the output format.
- D.Restate the format requirements at both the start and the end of the prompt, which is what makes the model honour them.
When detailed instructions still produce inconsistent formatting and judgment, few-shot examples are the standard remedy: they demonstrate the exact output shape and show the reasoning for choosing one call over a plausible alternative, which generalises to cases the instructions never enumerated. Vague confidence language changes nothing measurable, and requiring agreement across runs suppresses real findings that surface intermittently.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 4: few-shot examples for format consistency and ambiguous-case judgmentReport a problem with this question
19. Invoices are extracted through a tool call with a strict JSON schema. The JSON always parses, yet downstream checks still reject records whose line items do not add up. Why?
- A.A schema is applied after generation, so numeric fields get coerced to strings and arithmetic checks fail.
- B.A schema constrains the shape of the output, not its truth, so line items that fail to sum still validate.✓ Answer
- C.A schema forbids optional fields, so the model invents totals to fill required keys and the sums drift.
- D.A schema is advisory for the model, so malformed JSON is still expected and must be repaired before parsing.
A tool call with a JSON schema is the most reliable route to schema-compliant output and it eliminates syntax and structural errors, but it says nothing about whether the values are right, so semantic errors such as a mis-summed total or a value placed in the wrong field pass through untouched. Catching those requires self-validation in the schema itself — for example extracting both the stated total and a calculated total plus a conflict flag — and a downstream check.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 4: schema-constrained tool use eliminates syntax errors, not semantic errorsReport a problem with this question
20. Documents of unknown type arrive, and there is one extraction tool per type. The model sometimes replies with prose instead of extracting anything. Which setting fits?
- A.Set tool_choice to any, which forces a tool call but leaves the choice of extractor to the model.✓ Answer
- B.Set tool_choice to auto, which lets the model reply in prose when no schema fits the document well.
- C.Leave tool_choice unset and ask in the prompt that a tool always be called, and it will be honoured.
- D.Force one named extractor on every request and let the model flag a mismatch in one of its fields.
tool_choice "any" requires the model to call some tool while still letting it pick, which is precisely the situation where several extraction schemas exist and the document type is not known in advance. "auto" permits a plain text answer, forcing one named tool applies the wrong schema whenever the type differs, and a prompt-level requirement is a probabilistic request rather than a constraint on the response.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 4: tool_choice auto vs any vs a forced named toolReport a problem with this question
21. A long refactoring session is nearing the limits of its context. What is the difference between compacting the session and clearing it?
- A.Compaction and clearing both summarise history; one runs on demand and the other on a size trigger.
- B.Compaction drops the oldest messages outright, while clearing keeps a summary so the thread can continue.
- C.Compaction removes tool results and keeps the prose, while clearing removes prose and keeps tool results.
- D.Compaction replaces the history with a summary and keeps the thread going; clearing discards it and starts empty.✓ Answer
Compaction summarises the conversation so far and continues from that summary, which frees space but is lossy — precise values such as file paths, numbers and decisions blur first, so anything that must survive should be restated or written to a scratchpad file. Clearing throws the history away and begins fresh, which is what you want when the earlier material is stale rather than merely bulky.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 5: context management (/compact summarises and continues, clearing discards)Report a problem with this question
22. A team is evaluating an agentic coding tool that edits a shared branch directly and keeps no diff, log, or record of the commands it ran. What is the strongest reason not to adopt it?
- A.Its edits arrive faster than reviewers can read them, so the review queue will keep growing week by week.
- B.Its edits come from a model rather than a person, so they fall outside the team's code-ownership rules.
- C.Its edits cannot be inspected as a diff, so no reviewer can separate a correct change from a wrong one.✓ Answer
- D.Its edits depend on a model whose behaviour shifts between versions, so one prompt may not reproduce a diff.
Agent output is a proposal, not a verified change, and the whole safety model rests on a person being able to inspect what was changed and what was run before it becomes permanent. A tool whose work cannot be reviewed forfeits that check entirely, so no level of capability compensates; the other objections are real management problems but each is survivable with a reviewable trail in place.
Source: CCAR-F Exam Guide v1.0 (July 2026), Domain 3 / Domain 5: reviewability and auditability of agent-produced changesReport a problem with this question
Practice questions based on the official Claude Certified Architect – Foundations (CCAR-F) exam guide and Anthropic's public documentation. This is an independent study tool, not affiliated with or endorsed by Anthropic, and does not grant certification. It is delivered via Pearson VUE; Anthropic publishes the current question count, time limit, passing score and fee in the official CCAR-F exam guide. Official certification page →