Exam CCAR-F Topic 1 Question 52 Discussion
Actual exam question for Anthropic's CCAR-F exam
Question #: 52
Topic #: 1
Question #: 52
Topic #: 1
You are using Claude Code to accelerate software development. Your team uses it for code generation, refactoring, debugging, and documentation. You need to integrate it into your development workflow with custom slash commands, CLAUDE.md configurations, and understand when to use plan mode vs direct execution.
Your team has three requirements for Claude Code's behavior in your project:
* Claude must never modify files in the db/migrations/ directory.
* Claude should prefer your custom logging module over console.log .
* All TypeScript files must be auto-formatted with Prettier after every edit.
All three are currently written as instructions in your project's CLAUDE.md. During a complex refactoring session, a developer discovers that Claude edited a migration file, violating requirement #1.
How should you restructure these requirements across Claude Code's configuration mechanisms?
Your team has three requirements for Claude Code's behavior in your project:
* Claude must never modify files in the db/migrations/ directory.
* Claude should prefer your custom logging module over console.log .
* All TypeScript files must be auto-formatted with Prettier after every edit.
All three are currently written as instructions in your project's CLAUDE.md. During a complex refactoring session, a developer discovers that Claude edited a migration file, violating requirement #1.
How should you restructure these requirements across Claude Code's configuration mechanisms?
Suggested Answer: D Vote an answer
Each requirement belongs in the mechanism matching its enforcement semantics. The migration restriction is a hard safety boundary, so it should be implemented through permissions.deny , not merely expressed as contextual guidance. Anthropic explicitly states that CLAUDE.md content is treated as context rather than enforced configuration. Permission rules use the Tool(specifier) form, evaluate deny rules before ask or allow rules, and support path-based Edit(...) restrictions. ( https://code.claude.com/docs/en/memory ) The custom logging convention is a persistent project preference, making CLAUDE.md the appropriate location. It should guide Claude's code-generation decisions but does not require deterministic interception.
Prettier formatting, by contrast, is deterministic automation. Anthropic documents the exact pattern of using a PostToolUse hook with an Edit|Write matcher to run Prettier automatically after file modifications. (
https://code.claude.com/docs/en/hooks-guide )
Option A incorrectly treats path-scoped rules as a security control; rules remain instructions. Option B overuses hooks for a semantic coding preference that belongs in CLAUDE.md. Option C relies entirely on stronger prompting, which cannot guarantee that protected files remain untouched. Option D correctly separates prohibition, preference, and automatic enforcement.
Official references/topics: Permission rules, CLAUDE.md semantics, PostToolUse formatting hooks.
Prettier formatting, by contrast, is deterministic automation. Anthropic documents the exact pattern of using a PostToolUse hook with an Edit|Write matcher to run Prettier automatically after file modifications. (
https://code.claude.com/docs/en/hooks-guide )
Option A incorrectly treats path-scoped rules as a security control; rules remain instructions. Option B overuses hooks for a semantic coding preference that belongs in CLAUDE.md. Option C relies entirely on stronger prompting, which cannot guarantee that protected files remain untouched. Option D correctly separates prohibition, preference, and automatic enforcement.
Official references/topics: Permission rules, CLAUDE.md semantics, PostToolUse formatting hooks.
by Lilith at Jul 15, 2026, 03:40 AM
0
0
0
10
Comments
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Commenting
You can sign-up / login (it's free).