claude-code-headless
SolidRun Claude Code programmatically without interactive UI. Triggers on: headless, CLI automation, --print, output-format, stream-json, CI/CD, scripting.
AI & Automation 400 stars
39 forks Updated today
Install
Quality Score: 85/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Claude Code Headless Mode
Run Claude Code from scripts without interactive UI.
## Quick Start
```bash
# Basic headless execution
claude -p "Explain this code" --allowedTools "Read,Grep"
# JSON output for parsing
claude -p "List files" --output-format json
# Continue conversation
claude -p "Start analysis" --output-format json > result.json
session=$(jq -r '.session_id' result.json)
claude --resume "$session" "Now fix the issues"
```
## Essential CLI Options
| Flag | Description |
|------|-------------|
| `-p`, `--print` | Non-interactive (headless) mode |
| `--output-format` | text, json, stream-json |
| `-r`, `--resume` | Resume by session ID |
| `-c`, `--continue` | Continue most recent session |
| `--allowedTools` | Comma-separated allowed tools |
| `--disallowedTools` | Comma-separated denied tools |
| `--mcp-config` | Path to MCP server config JSON |
| `--verbose` | Enable verbose logging |
| `--append-system-prompt` | Add to system prompt |
## Permission Modes
| Mode | Flag | Effect |
|------|------|--------|
| Default | (none) | Prompt for permissions |
| Accept edits | `--permission-mode acceptEdits` | Auto-accept file changes |
| Bypass | `--permission-mode bypassPermissions` | Skip all prompts |
## Output Formats
### Text (default)
```bash
claude -p "Hello"
# Outputs: Human-readable response
```
### JSON
```bash
claude -p "Hello" --output-format json
```
```json
{
"type": "result",
"subtype": "success",
"result": "Hello! How can I help?",
"sess...
Details
- Author
- aiskillstore
- Repository
- aiskillstore/marketplace
- Created
- 7 months ago
- Last Updated
- today
- Language
- Python
- License
- None
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Featured
cli-reference
Claude Code CLI commands, flags, headless mode, and automation patterns
520 Updated 1 weeks ago
vibeeval AI & Automation Solid
claude-code
Delegate coding to Claude Code CLI (features, PRs).
11 Updated 5 days ago
kevinnft AI & Automation Listed
claude-afk
Headless-shaped invocation of `claude` that runs inside an interactive tmux pane you can attach to live. Gives you the shape of `claude -p --output-format json` with full transparency: every turn is observable in real time, attachable mid-flight, and inspectable after the fact via the session log.
0 Updated yesterday
a-canary