Workspace trust
Claude Code checks workspace trust before it runs any hook from a settings file. What counts as trusted depends on the session type:
- Interactive session: Claude Code holds back hooks from every settings file, including your own
~/.claude/settings.json, until you accept the workspace trust dialog for the folder, or for a parent directory whose trust extends to it -por SDK session: Claude Code never shows the dialog and treats the folder as trusted, so hooks committed in a repository's.claude/settings.jsonrun in a folder you've never trusted
Before you script claude -p over a repository you didn't write, review its .claude/ settings files, start with --bare, or turn hooks off for that run with --settings '\{"disableAllHooks": true\}'. Frontmatter hooks in a project subagent follow a stricter rule than settings-file hooks. What runs before you trust a folder lists each kind of repository content by session type.