Step-by-step answer
Core 60–90 min8 stepsGuardrails in Claude Code: tool, permissions, hooks
A Claude Code project where official copies are reachable only through a stdio MCP tool, writes are confined to drafts/ by a PreToolUse hook that resolves real paths, and every call (including denied ones) lands in audit.jsonl. The same decide() function then backs the hand-written Agent SDK options, so the boundary is one piece of code in both harnesses.
Back to the exercise