Mmcp.market

cli-reference skill

by parcadei·parcadei/Continuous-Claude-v3·3.9k stars·MIT

Claude Code CLI commands, flags, headless mode, and automation patterns

A100/100content scan

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
available in every project

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 events

Structured 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'
done

Keyboard Shortcuts (Interactive)

Quick Commands

More skills from parcadei/Continuous-Claude-v3

All agent skills → · MCP servers