ع
Start Topics Teams Reference What's new Saved
The software world

Headless mode

claude -p

Running Claude as a one-shot command instead of a conversation: you pass a prompt in, it does the work and prints a result, with no interactive session. In the CLI that's claude -p "…".
Why it matters

It's what makes Claude scriptable. Anything that can run a command can now run an agent — a scheduled job, a CI step, a line in a shell script, a build pipeline. It's also the natural rung below the Agent SDK: a one-off task in a script is headless mode's job, and you only reach for the SDK when the agent needs to be a component inside a real program.

Part of Building Claude into your own software
see also

← All terms