演習 › 全問
問題 Q7-06
93 / 106分野7・Claudeのフック
まだ解いていません。
Claude Codeが rm -rf を含むコマンドを実行しないよう、必ず止めたい。最も確実な方法はどれか。
正解は A
- A正解です。フックは決定論的に動き、モデルの判断に関係なく止められます。
- B強制力がなく、忘れることもあります。
- C判断に任せる限り、確実にはなりません。
- DCLAUDE.mdは文脈として扱われ、強制されません。
考え方:必ず止めるならフック。
出典:Hooks reference
returns a `permissionDecision` of `"deny"` if it contains `rm -rf`https://code.claude.com/docs/en/hooks.md(取得 2026-11-17)
出典:Hooks guide
certain actions always happen rather than relying on the LLM to choose to run themhttps://code.claude.com/docs/en/hooks-guide.md(取得 2026-11-17)