Headless Runner
Run Claude Code in headless/programmatic mode for automation, CI/CD, and agent workflows. Use when user asks about headless mode, programmatic execution, scripting Claude, or automating Claude workflows.
npx skills add majiayu000/claude-skill-registry --skill headless-runner --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Headless Runner Run Claude Code programmatically from scripts, CI/CD pipelines, and autonomous agent workflows. Headless mode automatically loads all project configuration (`.claude/` directory), giving you full access to skills, agents, hooks, and commands. ## Quick Start **Most common usage:** ```bash # Basic headless invocation (from project directory) claude -p "Your prompt here" # With JSON output for programmatic parsing claude -p "Run eval baseline for v0.3.14" --output-format json # Control tool access claude -p "Analyze failures" --allowedTools "Bash,Read,Grep" # Multi-turn conversation claude -p "Start task" --output-format json > result.json SESSION_ID=$(jq -r '.session_id' result.json) claude --resume $SESSION_ID "Continue with next step" ``` **What gets loaded automatically:** - ✅ `.claude/settings.json` and `.claude/settings.local.json` - ✅ `.claude/agents/` (all project agents) - ✅ `.claude/skills/` (all project skills) - ✅ Hooks configured in settings - ✅ Slash commands from `.claude/commands/` - ✅ CLAUDE.md project instructions ## When to Use This Skill Invoke this skill when user asks about: - "How do I run Claude headless?" - "Can I automate Claude workflows?"
- Quick Start
- When to Use This Skill
- Core Commands
- Basic Invocation
- Tool Permissions
- Multi-Turn Conversations
- Common Use Cases
- 1. CI/CD Integration
- 2. Scheduled Analysis
- 3. Agent-to-Agent Workflows
- 4. Automated Testing
- Available Scripts
- scripts/testheadless.sh
- scripts/runwithretry.sh <prompt> [maxretries]
Basic headless invocation (from project directory) claude -p "Your prompt here" With JSON output for programmatic parsing claude -p "Run eval baseline for v0.3.14" --output-format json Control tool access claude -p "Analyze failures" --allowedTools "Bash,Read,Grep" Multi-turn conversation claude -p "Start task" --output-format json > result.json claude --resume $SESSION_ID "Continue with next step" Text output (default)
What does the Headless Runner skill do?
Run Claude Code in headless/programmatic mode for automation, CI/CD, and agent workflows. Use when user asks about headless mode, programmatic execution, scripting Claude, or automating Claude workflows.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill headless-runner --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.
