Skip to content
47% off: the complete course for $79 (reg. $149)Order now →
Agent Builder

AI agent glossary

Headless mode

Running an agent non-interactively from a script, CI job, or scheduler, with the task passed in and the result printed or saved instead of a live chat.

Most people meet coding agents through an interactive session where they watch and respond. Headless mode runs the same agent with no one at the keyboard: you pass the prompt as an argument, it works until done, and it writes its output to the terminal, a file, or structured JSON.

Claude Code supports this with its print flag, as in claude -p followed by a prompt, and other coding agents such as OpenAI Codex and Gemini CLI have their own non-interactive modes. Agent SDKs offer the same capability from code.

Headless runs are what make agents automatable: triaging issues in a CI pipeline, generating a nightly report, or fixing lint errors on every pull request. Because nobody is there to approve risky actions, configure permissions up front, restrict tools to what the task needs, and run in a sandbox.

Example

A CI job runs a coding agent headlessly on each new pull request with the prompt 'review this diff for missing tests and post a summary', then posts the output as a comment.

Learn more in the course

Related terms

Go from definitions to doing

Learn to use and build AI agents in 65 practical lessons.