CCAR-F Claude Code Configuration and Workflows Practice Question
A developer wants Claude Code to always run the project's formatter after it edits a file, and wants this behavior shared with the whole team through version control. Which configuration mechanism is intended for this kind of automatic, tool-triggered action?
⚠ Common exam trap
The trap here is assuming that a written instruction in memory will reliably produce an automatic action, when memory text is advisory and no lifecycle event actually triggers it.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
A hook defined in the project settings that fires after file edits and invokes the formatter.
The requirement is an automatic action bound to a lifecycle event, shared through version control. Hooks exist for exactly this: they are configured declaratively, can live in the committed project settings, and execute deterministically when the matching event occurs. Memory text only nudges behavior, shell aliases are local and event-blind, and package install scripts fire at the wrong time. Only the hook satisfies both the automatic and the team-shared criteria.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
A descriptive paragraph in `CLAUDE.md` instructing Claude to format files after editing them.
Why it's wrong here
Memory instructions influence model behavior probabilistically; the model may skip the step under long context or when the task feels complete. It is also not a real trigger — nothing fires automatically. For a guarantee that formatting always happens, a natural-language request is the wrong tool.
- ✗
A `postinstall` script in `package.json` that runs the formatter once when dependencies are installed.
Why it's wrong here
A package install script runs at dependency-installation time, which has no relationship to when Claude Code edits a file. It would also fire on CI and on unrelated installs, creating surprising side effects. The trigger point is simply wrong for the desired behavior.
- ✗
A shell alias in each developer's profile that wraps the Claude Code invocation.
Why it's wrong here
Aliases are local shell conveniences that are not committed with the repository and cannot react to an in-session edit event. They wrap the command, not the tool lifecycle, so there is no point at which the formatter would run relative to a file change. This fails the team-sharing requirement outright.
- ✓
A hook defined in the project settings that fires after file edits and invokes the formatter.
Why this is correct
Hooks are the designed extension point for deterministic, event-driven actions such as running a formatter after an edit. Because they can be declared in the committed project settings, every teammate gets the same behavior without manual setup. This matches both requirements: automatic execution and team-wide sharing through version control.
About these practice questions
Courseiva writes every CCAR-F question from scratch — 271 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Anthropic exam blueprint
This CCAR-F practice question is part of Courseiva's free Anthropic certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CCAR-F exam.