Call Claude Code without the chat window, from a shell script or the Agent SDK, and read its result as JSON.
Out on Monday 19 October10 minutes, one build start to finish
Why this matters
The chat window is one way to use Claude Code. Running it without one, from a script, a scheduled job or your own Python, is how it becomes part of a pipeline. Headless mode with a fixed list of tools and JSON output makes each run repeatable and safe to automate.
What you build
Claude Code running from a script with a prompt, allowed tools and structured output.
Run Claude Code with a prompt from the shell, with no chat window.
Limit what it may do with a list of allowed tools.
Ask for JSON output and read the result in a script.
Call the same run from Python with the Claude Agent SDK.
The ideas behind it
Headless runs
A prompt in, a result out, with no chat window and no one watching.
Allowed tools
A list of the only tools the run may use, so automation cannot wander outside its job.
JSON output
A result your script can parse and act on, rather than text a person has to read.
Before you start
You need
Claude Code installed, and Python for the SDK part.
Length
About 10 minutes, one build start to finish.
Questions
When should I use the Agent SDK instead?
When you want the run inside your own Python program with more control. The lab shows the same run both ways.
Can it edit files on its own?
Only if editing tools are in the allowed list. Leave them out and it can only read.
Where is this useful?
Nightly checks, release notes, code review comments, and any task you would script if a person did it.
Is the recorded lab free?
Yes. Watch it any time, follow the steps and keep the code you build.
How is it different from a Live Lab?
A recorded lab is one short build you follow on your own. A Live Lab builds a bigger part of the system in an hour, with time for your questions.