Question · Vibe coding with Claude Code course · Module 8: Slack clone

Quiz: A hook or a line in CLAUDE.md

How does the PostToolUse hook with Prettier differ from the line "after every file change run npx prettier --write <file>" in CLAUDE.md?

Answer options

  • It does not, the model reads both and decides on its own whether to run them
  • The line in CLAUDE.md always works, and the hook only in plan mode
  • The hook formats the whole repository, and the line in CLAUDE.md only one file
  • The hook is run by the Claude Code program itself after every edit, while the model may skip an instruction in CLAUDE.md

You can check the correct answer by solving this task in the CodeWorlds game.