CCAR-F Claude Code Configuration and Workflows Practice Question
A developer wants Claude Code to automatically run the project's linter after every file edit, but only for files inside the `src/` directory. Where should this be configured so the behavior applies to all contributors of the repository?
⚠ Common exam trap
The trap here is assuming that a natural-language instruction in CLAUDE.md or a permissions allow-rule is equivalent to a deterministic hook, when only hooks guarantee the command actually executes.
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
✓
In a project-scoped `.claude/settings.json` file using a `hooks` entry with a `PostToolUse` matcher for the Edit and Write tools.
A repository-committed `.claude/settings.json` is the only location that both propagates to every contributor and supports deterministic hook execution. Pairing a `PostToolUse` hook with a matcher for the Edit and Write tools ensures the linter fires exactly after file mutations, and the hook command can restrict itself to `src/` paths, satisfying every stated constraint in the scenario.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
In a `.claude/settings.local.json` file with a `PostToolUse` hook that runs the linter unconditionally.
Why it's wrong here
`settings.local.json` is intentionally gitignored and personal to one developer's checkout, so it cannot enforce a team-wide behavior. Even if it were shared, running the linter unconditionally would ignore the requirement to limit execution to files under `src/`, producing noise and failures for edits elsewhere in the repository.
- ✗
In the user-level `~/.claude/settings.json` using a `permissions.allow` rule that lists the linter binary.
Why it's wrong here
The user-level settings file lives on the individual developer's machine and is not shared through version control, so other contributors would never receive the rule. Additionally, `permissions.allow` only grants or denies tool execution; it does not trigger a command automatically after an edit, so no linter would ever run from this configuration.
- ✓
In a project-scoped `.claude/settings.json` file using a `hooks` entry with a `PostToolUse` matcher for the Edit and Write tools.
Why this is correct
Project-scoped `.claude/settings.json` is committed to the repository, so every contributor inherits the same configuration. A `hooks` block with a `PostToolUse` matcher scoped to the Edit and Write tools fires the linter command after each file modification, and the hook command itself can filter to paths under `src/` before invoking the linter.
- ✗
In the top-level `CLAUDE.md` file with a natural-language instruction telling Claude to run the linter after edits.
Why it's wrong here
`CLAUDE.md` supplies contextual guidance that Claude may follow as a model instruction, but it is not a deterministic enforcement mechanism. The model could skip the step, run it at the wrong time, or misinterpret the `src/` scope. Hooks exist precisely to guarantee a shell command executes reliably on the matching tool event.
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.