The global-install hook performs automatic setup of the package’s own agent extension by writing MCP settings and skill files. This fits the warning-level agent extension lifecycle risk; the hook is gated to global installs, skips CI, and has an opt-out.
Static reason
High-risk behavior combination matched malicious policy.
Trigger
postinstall during a global install, outside CI, unless PCH_NO_AGENT_INSTALL is set.
Impact
Agent configuration changes without a separate user-run agent install command; the added Patch tools become available after the agent restarts.
Mechanism
The hook launches pch agent install, which updates agent MCP settings and writes Patch skill files under agent user directories.
Evidence
package.jsondist/postinstall.cjsdist/cli.js~/.cursor/mcp.jsonClaude Code and Codex user MCP settings~/.claude/skills/<server-name>/SKILL.md~/.codex/skills/<server-name>/SKILL.md