Skip to content

When Scripts Stop Being Enough

2026-07-11claude-code, practice

You're writing shell loops around the Claude Code CLI to build a Slack bot, or a pull-request reviewer for CI, or a pipeline that fires on a schedule. That's the point where you've stopped using the tool and started building on it, and it's worth reaching for the Agent SDK instead of scripting around the CLI.

The SDK gives you the agentic loop (the read-act-check cycle that drives multi-step work) without re-implementing tool calls yourself. It searches your codebase on demand instead of requiring you to maintain a separate pre-built index, lets you explicitly allow or deny each tool, and lets you attach programmatic hooks: code that runs at a specific point in that loop, such as a pre-tool-use hook that can block a command like rm -rf before it executes.

The important part is that the permission model comes with it. Building your own agent should not mean rebuilding the safety surface from scratch, and this is the path where you don't have to. What it doesn't give you is a finished policy: you still decide which tools are allowed and what the hooks actually check.