Advanced
Open
Pro
Choosing Between the CLI and the Agent SDK
You're building an internal tool: a Python web service where a user submits a bug description through a form, and the service should run Claude Code against a checked-out copy of the repository, stream progress back to the user's browser as Claude works, and store the final diff for review — all without shelling out to a CLI and parsing stdout.
- Should this be built against the Agent SDK or the
claude -pCLI invoked as a subprocess? Justify the choice against the specific requirements given. - Name the two things the SDK gives you here that a subprocess-based approach would have to reconstruct by hand.
- If the same requirements were given but the service were written in Go instead of Python, would the answer change? Why or why not?
Share this question