cli-reference skill
Claude Code CLI commands, flags, headless mode, and automation patterns
Is the cli-reference skill safe?
Clean: nothing in its files matched our rules. We read 1 file in the folder on 2026-09-28.
No findings.
Install the cli-reference skill
A skill is a folder. Copy it into your agent's skills folder and the agent loads it when the task matches its description.
git clone --depth 1 https://github.com/parcadei/Continuous-Claude-v3.git /tmp/Continuous-Claude-v3 mkdir -p ~/.claude/skills cp -r /tmp/Continuous-Claude-v3/.claude/skills/cli-reference ~/.claude/skills/cli-reference
In the Claude apps, zip the folder and upload it from the Skills settings. The folder on GitHub
The instructions your agent would load
SKILL.md as published, without the frontmatter. Read it on GitHub
CLI Reference
Complete reference for Claude Code command-line interface.
When to Use
- "What CLI flags are available?"
- "How do I use headless mode?"
- "Claude in automation/CI/CD"
- "Output format options"
- "System prompt via CLI"
- "How do I spawn agents properly?"
Core Commands
Session Control
Headless Mode (Critical for Agents)
Tool Control
Subagent Definition (--agents flag)
Define custom subagents inline via JSON:
claude --agents '{
"code-reviewer": {
"description": "Expert code reviewer. Use proactively after code changes.",
"prompt": "You are a senior code reviewer. Focus on code quality and security.",
"tools": ["Read", "Grep", "Glob", "Bash"],
"model": "sonnet"
},
"debugger": {
"description": "Debugging specialist for errors and test failures.",
"prompt": "You are an expert debugger. Analyze errors and provide fixes."
}
}'Agent Fields
Key Insight
When Lead uses Task tool, it auto-spawns from these definitions. No manual spawn needed.
System Prompt Customization
Use --append-system-prompt for most cases - preserves Claude Code capabilities.
Model Selection
Aliases: sonnet, opus, haiku
MCP Configuration
Advanced Flags
Output Formats
JSON (for parsing)
claude -p "query" --output-format json
# {"result": "...", "session_id": "...", "usage": {...}}Streaming (for real-time monitoring)
claude -p "query" --output-format stream-json
# Newline-delimited JSON eventsStructured Output (schema validation)
claude -p "Extract data" \
--output-format json \
--json-schema '{"type":"object","properties":{...}}'Headless Agent Pattern (CRITICAL)
Proper headless agent spawn:
claude -p "$TASK_PROMPT" \
--session-id "$UUID" \
--dangerously-skip-permissions \
--max-turns 100 \
--output-format stream-json \
--agents '{...}' \
--append-system-prompt "Context: ..."Missing any of these causes hangs:
- --session-id - Track the session
- --dangerously-skip-permissions - Headless requires this
- --max-turns - Prevents infinite loops
Common Patterns
CI/CD Automation
claude -p "Run tests and fix failures" \
--dangerously-skip-permissions \
--max-turns 50 \
--output-format json | jq '.result'Piped Input
cat error.log | claude -p "Find root cause"
gh pr diff | claude -p "Review for security"Multi-turn Session
id=$(claude -p "Start task" --output-format json | jq -r '.session_id')
claude -p "Continue" --resume "$id"Stream Monitoring
claude -p "Long task" \
--output-format stream-json \
--include-partial-messages | while read -r line; do
echo "$line" | jq '.type'
doneKeyboard Shortcuts (Interactive)
Quick Commands
More skills from parcadei/Continuous-Claude-v3
- Aagent-context-isolationAgent Context Isolation
- Aagent-orchestrationAgent Orchestration Rules
- Aagentic-workflowAgentic Workflow Pattern
- Aagentica-claude-proxyGuide for integrating Agentica SDK with Claude Code CLI proxy
- Aagentica-infrastructureReference guide for Agentica multi-agent infrastructure APIs
- Aagentica-promptsWrite reliable prompts for Agentica/REPL agents that avoid LLM instruction ambiguity
- Aagentica-sdkBuild Python agents with Agentica SDK - @agentic decorator, spawn(), persistence, MCP integration
- Aagentica-serverAgentica server + Claude proxy setup - architecture, startup sequence, debugging
- Aagentica-spawnSpawn Agentica multi-agent patterns
- Aanalytic-functionsProblem-solving strategies for analytic functions in complex analysis
- Aast-grep-findAST-based code search and refactoring via ast-grep MCP
- Aasync-repl-protocolAsync REPL Protocol