Claude Code · tool · fg-0486

claude -p in a freshly cloned repo runs its hooks and .mcp.json servers without asking

If you see Hook commands from the repo's .claude/settings.json run in CI, the cause and the fix for Claude Code are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
Hook commands from the repo's .claude/settings.json run in CIMCP servers from .mcp.json start with no approval prompt in a folder never trusted
Cause
Print mode shows no workspace trust dialog and no per-server approval prompt, so a project's hooks and MCP servers run even in a folder that was never trusted.
Fix
On untrusted code or in CI use --bare, which skips hooks, MCP servers, plugins, skills, auto memory, and CLAUDE.md, and pass what the run needs with flags.
Apply
claude --bare -p "Summarize README.md" --allowedTools "Read"
Affected
Claude Code print mode, as of 2026-10
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun