A housing-authority workflow uses Claude Code to draft casework letters, and the team wants every file write to a case folder to be automatically checked against a redaction policy before it is considered complete. Which mechanism fits this requirement?
Select an answer to reveal the explanation.
Short Explanation
Relying on everyone to remember a redaction step is how tenant data eventually reaches a shared folder. A PostToolUse hook is the automatic doorman, checking every write against policy the instant it happens.
Full Explanation
A requirement phrased as “every write must be checked before it counts as complete” is a request for a mechanism, not for a reminder. Instructions the model reads raise the probability that a step happens; only something the harness executes makes it unconditional, and casework letters carrying tenant data are exactly where that difference matters.
Hooks run deterministically around tool calls, and a PostToolUse hook fires immediately after a matching call such as a file write completes, with the ability to inspect the result and block or flag it. That places the redaction-policy check on the write path itself, so every letter reaching the case folder is gated identically regardless of who is driving the session or how long that session has run.
A manual slash command depends on human memory and will be skipped under deadline pressure, which reintroduces the precise risk the housing authority is trying to eliminate; a polite note in CLAUDE.md is context the model weighs against everything else in the window and offers no enforcement at the moment the write occurs; and a user-level preference file is scoped to one engineer's own machine, so it cannot apply consistently across a team's casework workflow or to runs on shared infrastructure.
Exam caveat: a PostToolUse hook fires after the write has already happened, so it can flag or reject the result but the content may exist on disk in the interim, which matters when the case folder is synced or shared. Operational check: write a letter containing a deliberately unredacted field, confirm the hook fires and blocks or flags it, and confirm whether the non-compliant file was removed or merely reported.