Agent skill · AI & Agents

headless-mode

Guide for using Claude Code programmatically via CLI flags and SDKs. Use for automation, CI/CD pipelines, scripting, and building tools on top of Claude Code. Covers --print mode, output formats, session management, and SDK integration.

majiayu000github.com/majiayu000GitHub ↗
claude-codecan modify filesMIT
Install
npx skills add majiayu000/claude-skill-registry --skill headless-mode-hgeldenhuys-claude-code-sdk --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 6 KB
Bundled scripts: none
Allowed tools: ReadWriteBashGlob
Path: skills/agent/headless-mode-hgeldenhuys-claude-code-sdk/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Headless Mode Run Claude Code programmatically for automation, CI/CD, and scripting. ## Quick Reference | Mode | Command | Use Case | |------|---------|----------| | CLI (simple) | `claude -p "prompt"` | One-shot tasks, scripts | | CLI (structured) | `claude -p "prompt" --output-format json` | Parsing responses | | TypeScript SDK | `@anthropic-ai/claude-code` | Full programmatic control | | Python SDK | `claude-code-sdk` | Python automation | ## Core Concept The `-p` (or `--print`) flag runs Claude Code non-interactively. All CLI options work with `-p`, enabling automated workflows without human interaction. ```bash claude -p "Explain what this project does" ``` ## Essential Flags | Flag | Purpose | Example | |------|---------|---------| | `-p`, `--print` | Run non-interactively | `claude -p "query"` | | `--output-format` | Response format | `json`, `stream-json`, `text` | | `--allowedTools` | Auto-approve tools | `"Bash,Read,Edit"` | | `--max-turns` | Limit agent turns | `--max-turns 5` | | `--continue` | Continue last session | `claude -p "..." --continue` | | `--resume` | Resume specific session | `--resume $SESSION_ID` | ## Output Formats ### Text (Default) Plain text output

What's inside
Steps it walks through
  1. Quick Reference
  2. Core Concept
  3. Essential Flags
  4. Output Formats
  5. Text (Default)
  6. JSON (Structured)
  7. Stream JSON (Real-time)
  8. Tool Auto-Approval
  9. Basic Approval
  10. Granular Bash Commands
  11. Skip All Permissions (Dangerous)
  12. Session Management
  13. Continue Last Session
  14. Resume Specific Session
Ships with 1 file
  • metadata.json
Commands it runs
claude -p "Explain what this project does"
claude -p "Summarize auth.py"
claude -p "Analyze this code" --output-format json
claude -p "Generate report" --output-format stream-json
claude -p "Fix the failing tests" --allowedTools "Bash,Read,Edit"
claude -p "Create a commit for staged changes" \
claude -p "Deploy to staging" --dangerously-skip-permissions
claude -p "Review this codebase"
claude -p "Focus on the database layer" --continue
claude -p "Summarize findings" --continue
More from claude-skill-registry
All skills →
About this skill
What does the headless-mode skill do?

Guide for using Claude Code programmatically via CLI flags and SDKs. Use for automation, CI/CD pipelines, scripting, and building tools on top of Claude Code. Covers --print mode, output formats, session management, and SDK integration.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill headless-mode-hgeldenhuys-claude-code-sdk --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going