claude -p
Last updated
What is claude -p?
The claude -p command (short for --print) activates Print Mode, which runs Claude Code as a non-interactive, single-use utility rather than a continuous chat session. When you use this flag, you provide a prompt directly in the command line; Claude then executes its agentic loop—researching, editing files, or running commands as needed—and exits immediately once the task is complete. This mode is designed primarily for automation and scripting, allowing you to integrate Claude's reasoning into CI/CD pipelines, shell scripts, or "one-liners".
Free resources to learn claude -p
- Official docsCLI commands
- Official docsRun Claude Code programmatically
- VideoBuilding headless automation with Claude Code | Code w/ Claude
More in stage 5: Usage Best Practices
claude -p: common questions
Can I learn claude -p in Hindi?
This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain claude -p in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.
Is this claude -p tutorial for beginners?
It is lesson 43 of 109 in the free Claude Code roadmap, in stage 5, Usage Best Practices. If you are new to Claude Code, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.