Halloween Special 2026! Get Up to 25% OFF Practice Questions! Limited Time - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Anthropic CCAR-F Exam - Topic 2 Question 8 Discussion

Posted by Elouise on Oct 13, 2026 at 11:37 PM

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?

Suggested Answer: D

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.


Get Premium CCAR-F Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
4 comments · newest first
LE
Lea 7 hours ago
I think option D could work, especially since it directly denies edits to the migration files, but I'm not sure about the logging preference being in CLAUDE.md.
CH
Cherry 5 days ago
I feel like option C might be too vague; just rewriting the requirements in CLAUDE.md doesn't guarantee Claude will follow them.
AR
Aron 11 days ago
I'm not entirely sure, but I think using hooks like in option B could give us more control over the behavior we want from Claude.
MA
Malika 16 days ago
I remember we discussed how important it is to prevent Claude from modifying migration files, so option A seems like a solid choice for that.
0/2000 characters

Save Cancel