CCAR-F domain drill
CCAR-F practice questions: Claude Code workflows.
40 original questions on Claude Code workflows, which carries 20% of the Claude Certified Architect – Foundations exam per the published guide. Study notes first, then the questions with an explanation for each. When this domain feels solid, take the timed CCAR-F practice exam and check the domain breakdown.
What to know about Claude Code workflows
- CLAUDE.md as project memory: what belongs in it (commands, conventions, gotchas) and what does not (long documents the model can read on demand).
- The explore, plan, code, commit rhythm from Anthropic's best-practices guide, and plan mode as a way to separate thinking from editing.
- Slash commands, skills, and subagents: reusable prompts versus delegated work with its own context.
- Hooks: deterministic shell steps that run before or after tool calls, used for formatting, linting, blocking dangerous commands, and notifications.
- Permission modes and allow lists, and why the default asks before writes and shell commands.
- MCP server configuration at project and user scope, and headless use in CI and scripts with the print flag.
- Context hygiene: clearing and compacting, and why long sessions degrade without it.
Claude Code workflows questions
What belongs in a project's CLAUDE.md file?
Show answer
Answer: Build and test commands, project conventions, and gotchas Claude needs on every task, kept short. CLAUDE.md is standing project memory: short, high-value instructions loaded into every session. Long documents cost context on every task and are better read on demand; secrets do not belong in a checked-in file; session history is what memory files or notes are for.
A team wants every file Claude Code edits to be run through the formatter, without relying on the model to remember. Which mechanism is right?
Show answer
Answer: A PostToolUse hook matched to the edit tools that runs the formatter on the changed file. Hooks are deterministic shell steps tied to tool events; they run whether or not the model remembers. A CLAUDE.md note is advisory, and a slash command or subagent still depends on someone invoking it.
How would you run Claude Code non-interactively inside a CI job?
Show answer
Answer: Print mode with the -p flag, passing the prompt and a restricted allowed-tools list. Print mode runs a single prompt headlessly and exits, and restricting tools keeps a CI run from taking actions nobody reviewed. An interactive session with accept-all permissions has no human present and no bound on what runs.
A session has been running for hours and answers are getting worse and slower. What is the first thing to try?
Show answer
Answer: Compact or clear the context, then re-brief the task with only what the next step needs. Quality degrades as the window fills with stale material; compaction and clearing exist to fight exactly this. Pasting the transcript back doubles the bulk that caused the problem, and a larger model does not shrink the window's contents.
A developer complains Claude Code re-explores the codebase every session. The cheapest fix is:
Show answer
Answer: A CLAUDE.md with the project's structure, commands, and conventions. CLAUDE.md is loaded automatically and is the place for standing project knowledge. An exploring subagent still spends the exploration every session; a pasted file is CLAUDE.md done by hand.
You want Claude Code to plan before it edits on a large refactor. Which feature matches?
Show answer
Answer: Plan mode, which explores and proposes an approach before any file changes. Plan mode separates thinking from editing so you can review the approach first. A hook that blocks edits enforces a gate but gives you no plan to review; headless mode is for automation, not a review step.
A repeated workflow, 'update the changelog from recent commits', should be one command. Which Claude Code feature?
Show answer
Answer: A custom slash command or skill that captures the prompt and steps. Reusable prompts belong in slash commands or skills; hooks are for deterministic shell steps. A hook on commit fires per commit and cannot write a summarized changelog on demand; an MCP server adds a tool, not a reusable workflow.
Which permission approach is right for a shared CI runner using Claude Code?
Show answer
Answer: An explicit allow list of tools and commands, with no interactive approvals. Headless runs cannot ask a human, so the allowed surface is defined up front and kept narrow. Accepting everything removes the boundary; denying every tool leaves Claude unable to read the code it is meant to work on.
Where does an MCP server configuration belong when it should apply to everyone working in the repository?
Show answer
Answer: In the project-scoped configuration checked into the repository. Project scope travels with the repo; user scope is personal. A dotfiles sync approximates it but relies on every developer keeping up; the system prompt cannot register a server.
A hook that blocks a tool call should communicate the reason. Why?
Show answer
Answer: So the model can adjust its plan instead of retrying the same blocked action. Feedback from a blocked call lets the model take a different path. Logging is a side benefit, not the point; a hook's reason is information for the model, not a mechanism to override the block.
Which task is a good fit for a Claude Code subagent?
Show answer
Answer: A large, self-contained investigation whose details would clutter the main session. Subagents isolate context. Delegate work whose transcript you do not need in the main thread. A one-line change is cheaper to make directly, and CLAUDE.md is already loaded for the main session.
A team notices Claude Code sometimes runs the test suite three times in a row. Which is the right lever?
Show answer
Answer: A hook or CLAUDE.md rule defining when tests run, plus a check of the loop for missing stop conditions. Repeated actions point to missing structure: explicit rules for when to run tests and clear stop conditions. Removing the command hides the symptom and slows feedback; more turns give the loop more room to repeat.
What does the /compact style operation do in a long session?
Show answer
Answer: Summarizes the conversation so far to free context while keeping the essentials. Compaction trades detail for headroom, which is what long sessions need. It summarizes the whole conversation, not just tool results; a clean restart is what /clear does, and it loses the essentials compaction keeps.
A developer wants Claude Code to stop before committing so they can review. Best approach?
Show answer
Answer: Keep commit outside the allowed actions, or gate it with a hook that requires confirmation. Review points are enforced through permissions and hooks, not memory. A PostToolUse hook fires after the commit already exists; plan mode blocks all edits, not just the commit.
Which of these belongs in CLAUDE.md rather than a subagent or a skill?
Show answer
Answer: The linter command and a note that the tests need the local database running. Short, always-relevant operational facts are CLAUDE.md material. Long documents are loaded on demand; a report template is a skill or slash command; keys do not go in a checked-in file.
You need Claude Code to review a pull request in CI and post comments, with no ability to push code. Which controls?
Show answer
Answer: Print mode with a read-only tool allow list and the git push command denied. Least privilege for automation: read-only tools plus explicit denies on writes. Relying on the prompt is advisory; interactive mode has no reviewer present in CI.
A Claude Code session is asked to fix a bug and, without being asked, refactors three unrelated files. What reduces this?
Show answer
Answer: Explicit scope in the prompt, CLAUDE.md conventions about minimal diffs, and plan mode for review. Scope discipline comes from explicit instructions and a review step before edits. A revert hook is a blunt tool that also blocks legitimate changes in a second file; headless mode removes the review, not the drift.
What is the purpose of a PreToolUse hook?
Show answer
Answer: Inspect or block a tool call before it executes. Pre hooks gate actions; post hooks react to them. Running after the response is a Stop hook; compaction and model choice are not what hooks control.
A monorepo has several services with different test commands. Where should that live for Claude Code?
Show answer
Answer: CLAUDE.md, with a short per-service map of test commands and conventions. Project memory holds per-area commands and loads on every session. The README is not loaded automatically, and restating commands in chat is manual and easy to forget.
Which hook event would you use to run a security scan on every file Claude writes?
Show answer
Answer: A PostToolUse hook matched to the Write and Edit tools, run after each change lands. Post hooks react to completed writes, so the scan sees the file as written. A Stop hook runs once per turn and misses intermediate writes; a PreToolUse hook on Read never sees writes at all.
A developer wants Claude Code to ask before running any command that touches the network. Which setting?
Show answer
Answer: Permission rules that allow safe commands and require confirmation for matching network commands. Granular permission rules gate specific commands. A PostToolUse hook runs after the command has already executed, and a CLAUDE.md line is guidance rather than enforcement.
What is the benefit of committing project-scoped MCP configuration to the repo?
Show answer
Answer: Every contributor gets the same integrations without manual setup on each machine. Shared config travels with the code, so integrations are consistent across the team. Credentials should stay out of the repo, in environment variables or user-level config.
Claude Code proposes a plan that touches an unrelated module. What is the right response in plan mode?
Show answer
Answer: Revise the plan's scope before any edits are made to the tree. Plan mode exists to correct scope before edits happen. Accepting and reverting later wastes work and risks missing an edit.
Which is a sensible use of a Claude Code skill?
Show answer
Answer: A packaged procedure like 'write a release note from merged PRs' with its own instructions and helper files. Skills package reusable procedures with their supporting files. Project conventions belong in CLAUDE.md, and secrets belong in environment configuration, not in a skill.
You want a nightly job where Claude Code triages new issues and labels them. Which pieces?
Show answer
Answer: Print mode in a scheduled job with a read-only tool set plus one allowed labeling action. Headless, scheduled, and least-privilege. Hooks respond to Claude's own tool calls, not to external events, and full permissions are more than a labeling job needs.
A PreToolUse hook exits with code 2 on a tool call. What should happen?
Show answer
Answer: The call is blocked and the hook's message is surfaced so the model can adjust. Exit code 2 is the blocking exit: the action stops and the hook's stderr is fed back to the model. Other non-zero codes surface the message to the user and let the call continue.
Which practice keeps a long Claude Code session productive?
Show answer
Answer: Clearing or compacting between unrelated tasks and re-briefing the next task. Fresh context per task keeps attention on what matters. Pasting transcripts or holding every file read fills the window with material the next task does not need.
What should a team review when a Claude Code change is opened as a pull request?
Show answer
Answer: The diff, the tests it ran, and whether the scope matched the request. Review automated changes like any other: the diff, the evidence, and the scope. A green suite does not prove the change did what was asked.
Which is the right place for a rule like 'never edit files under vendor/'?
Show answer
Answer: CLAUDE.md for guidance plus a hook or permission deny rule for enforcement. Guidance plus enforcement: CLAUDE.md explains the rule and a deny rule or hook makes it hold. File comments and READMEs are only read if Claude happens to open them.
How do subagents help with a large migration in Claude Code?
Show answer
Answer: Each handles a bounded slice in its own context and returns a summary, keeping the main session coherent. Bounded slices with summaries back keep the coordinator's window clean. Subagents have separate contexts and can use tools; sharing context is the problem they solve.
A team wants Claude Code to follow its commit message convention every time. Which approach is reliable?
Show answer
Answer: State the convention in CLAUDE.md with an example, and validate with a hook on commit. Guidance plus enforcement. Inferring from the log works until the log has inconsistent history, and a chat instruction does not survive the session.
Which is a good reason to use headless Claude Code inside a GitHub Action?
Show answer
Answer: Repeatable, reviewable automation such as summarizing a PR, with a fixed tool allow list. Headless suits repeatable, bounded jobs with a fixed allow list. Debugging and exploration need a person in the loop.
A hook blocks a command but Claude Code keeps retrying variations. What is missing?
Show answer
Answer: A clear block message that says what is disallowed and what to do instead. Blocks need explanations to redirect behavior. Without a reason the model treats the block as a transient failure and tries again.
What is the difference between a slash command and a skill in practice?
Show answer
Answer: A slash command is a reusable prompt you invoke; a skill packages a procedure with instructions and supporting files. Commands are prompts; skills are packaged procedures with their own files. Neither needs an MCP server, and both can be project-defined.
Which permission stance fits a developer's laptop versus a shared CI runner?
Show answer
Answer: Interactive approvals on the laptop; a narrow pre-approved allow list with no prompts in CI. Human present versus not present: approvals where someone can answer, a narrow allow list where nobody can. Allowing everything in CI is the opposite of what an unattended runner needs.
Claude Code keeps reading the same large log file into context on every task. Fix?
Show answer
Answer: A CLAUDE.md note to grep the log for specific patterns rather than reading it whole, or a tool that returns matches. Targeted retrieval over bulk reads. Compaction removes the copies after the cost has been paid, and putting the log in CLAUDE.md loads it on every session.
Which statement about CLAUDE.md scope is correct?
Show answer
Answer: Files can live at the project root and in subdirectories, applying to work in those areas. Scoped memory files per area, layered with the root file rather than replacing it.
What should a team do before letting Claude Code run database migrations in a shared environment?
Show answer
Answer: Gate the migration command behind approval, run it against a staging copy first, and log the run. Irreversible actions get gates and rehearsal. Self-review by the same model is weaker than a staging run and a human approval.
A developer asks Claude Code to 'make the tests pass' and it edits the tests to always pass. What prevents this?
Show answer
Answer: Explicit instructions that tests define behavior and must not be weakened, plus review of test diffs. State the constraint and review test changes. Plan mode stops all edits, including the fix that was asked for.
When is a subagent overkill?
Show answer
Answer: For a one-line lookup the main session can answer directly. Delegate for scope and isolation, not trivia. The other three are the cases subagents exist for.
Next
- Timed CCAR-F practice exam: 60 questions in 120 minutes, scored against the 720 pass mark.
- All CCAR-F practice questions with a domain filter.
- The CCAR-F exam page: format, weights, registration, study path.
Other CCAR-F domains
FAQ
How much of the CCAR-F exam is Claude Code workflows?+
20% of the marks, per the published CCAR-F exam guide. The full domain list with weights is on the CCAR-F exam page.
Are these real CCAR-F exam questions?+
No. They are 40 original scenario questions written from the blueprint for this domain. Reproducing exam content would violate the candidate agreement.
How should I study Claude Code workflows for CCAR-F?+
Read the domain notes on this page, answer the questions with explanations hidden, then take the timed CCAR-F practice exam and check the per-domain breakdown for this domain.



