The official Agent SDK exists. It's nice. But it requires OAuth flows that don't work for headless servers, and the API surface is narrower than what the CLI exposes. Sometimes you just want to spawn a subprocess and parse the output.
This is a deep-dive on wrapping Claude CLI for programmatic use. We're covering input methods, output formats, structured schemas, and permission patterns. By the end you'll have production-ready wrapper code.
Three reasons I keep coming back to CLI wrappers over the SDK: