cli-reference
Claude Code CLI commands, flags, headless mode, and automation patterns
npx skills add majiayu000/claude-skill-registry --skill cli-reference-carmandale-agent-config --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.
# 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 | Command | Description | Example | |---------|-------------|---------| | `claude` | Start interactive REPL | `claude` | | `claude "query"` | REPL with initial prompt | `claude "explain this project"` | | `claude -p "query"` | Headless mode (SDK) | `claude -p "explain function"` | | `cat file \| claude -p` | Process piped content | `cat logs.txt \| claude -p "explain"` | | `claude -c` | Continue most recent | `claude -c` | | `claude -c -p "query"` | Continue via SDK | `claude -c -p "check types"` | | `claude -r "id" "query"` | Resume session | `claude -r "auth" "finish PR"` | | `claude update` | Update version | `claude update` | | `claude mcp` | Configure MCP servers | See MCP docs | ## Session Control | Flag | Description | Example | |------|-------------|---------| | `--continue, -c` | Load most recent conversation | `claude --continue` | | `--resume, -r` | Resume session by ID/name | `claude
- When to Use
- Core Commands
- Session Control
- Headless Mode (Critical for Agents)
- Tool Control
- Subagent Definition (--agents flag)
- Agent Fields
- Key Insight
- System Prompt Customization
- Model Selection
- MCP Configuration
- Advanced Flags
- Output Formats
- JSON (for parsing)
claude --agents '{
claude -p "query" --output-format json
claude -p "query" --output-format stream-json
Newline-delimited JSON events
claude -p "Extract data" \
claude -p "$TASK_PROMPT" \
claude -p "Run tests and fix failures" \
cat error.log | claude -p "Find root cause"
gh pr diff | claude -p "Review for security"
claude -p "Continue" --resume "$id"What does the cli-reference skill do?
Claude Code CLI commands, flags, headless mode, and automation patterns
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill cli-reference-carmandale-agent-config --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.
