Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Claude Code CLI commands, flags, headless mode, and automation patterns
.claude/skills/cli-reference/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 192% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 71% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 136% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 16% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 28% | 0% |
Complete reference for Claude Code command-line interface.
| 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 |
| Flag | Description | Example | |------|-------------|---------| | --continue, -c | Load most recent conversation | claude --continue | | --resume, -r | Resume session by ID/name | claude --resume auth-refactor | | --session-id | Use specific UUID | claude --session-id "550e8400-..." | | --fork-session | Create new session on resume | claude --resume abc --fork-session |
| Flag | Description | Example | |------|-------------|---------| | --print, -p | Non-interactive, exit after | claude -p "query" | | --output-format | text, json, stream-json | claude -p --output-format json | | --max-turns | Limit agentic turns | claude -p --max-turns 100 "query" | | --verbose | Full turn-by-turn output | claude --verbose | | --dangerously-skip-permissions | Skip permission prompts | claude -p --dangerously-skip-permissions | | --include-partial-messages | Include streaming events | claude -p --output-format stream-json --include-partial-messages | | --input-format | Input format (text/stream-json) | claude -p --input-format stream-json |
| Flag | Description | Example | |------|-------------|---------| | --allowedTools | Auto-approve these tools | "Bash(git log:*)" "Read" | | --disallowedTools | Block these tools | "Bash(rm:*)" "Edit" | | --tools | Only allow these tools | --tools "Bash,Edit,Read" |
Define custom subagents inline via JSON:
bashclaude --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": "inherit" }, "debugger": { "description": "Debugging specialist for errors and test failures.", "prompt": "You are an expert debugger. Analyze errors and provide fixes." } }'
| Field | Required | Description | |-------|----------|-------------| | description | Yes | When to invoke this agent | | prompt | Yes | System prompt for behavior | | tools | No | Allowed tools (inherits all if omitted) | | model | No | Claude adapter only; omit it or use inherit so the parent model remains authoritative |
When Lead uses Task tool, it auto-spawns from these definitions. No manual spawn needed.
| Flag | Behavior | Modes | |------|----------|-------| | --system-prompt | Replace entire prompt | Interactive + Print | | --system-prompt-file | Replace from file | Print only | | --append-system-prompt | Append to default (recommended) | Interactive + Print |
Use --append-system-prompt for most cases - preserves Claude Code capabilities.
| Flag | Description | Example | |------|-------------|---------| | --model | Set model for session | --model claude-sonnet-4-5 | | --fallback-model | Fallback if default overloaded | --fallback-model sonnet |
Aliases: sonnet, opus, haiku. Codex and luna_worker do not read this router guidance.
| Flag | Description | Example | |------|-------------|---------| | --mcp-config | Load MCP servers from JSON | --mcp-config ./mcp.json | | --strict-mcp-config | Only use these MCP servers | --strict-mcp-config --mcp-config ./mcp.json |
| Flag | Description | Example | |------|-------------|---------| | --add-dir | Add working directories | --add-dir ../apps ../lib | | --agent | Specify agent for session | --agent my-custom-agent | | --permission-mode | Start in permission mode | --permission-mode plan | | --permission-prompt-tool | MCP tool for permissions | --permission-prompt-tool mcp_auth | | --plugin-dir | Load plugins from directory | --plugin-dir ./my-plugins | | --settings | Load settings from file/JSON | --settings ./settings.json | | --setting-sources | Which settings to load | --setting-sources user,project | | --betas | Beta API headers | --betas interleaved-thinking | | --debug | Enable debug mode | --debug "api,hooks" | | --ide | Auto-connect to IDE | --ide | | --chrome | Enable Chrome integration | --chrome | | --no-chrome | Disable Chrome for session | --no-chrome | | --enable-lsp-logging | Verbose LSP debugging | --enable-lsp-logging | | --version, -v | Output version | claude -v |
bashclaude -p "query" --output-format json # {"result": "...", "session_id": "...", "usage": {...}}
bashclaude -p "query" --output-format stream-json # Newline-delimited JSON events
bashclaude -p "Extract data" \ --output-format json \ --json-schema '{"type":"object","properties":{...}}'
Proper headless agent spawn:
bashclaude -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 loopsbashclaude -p "Run tests and fix failures" \ --dangerously-skip-permissions \ --max-turns 50 \ --output-format json | jq '.result'
bashcat error.log | claude -p "Find root cause" gh pr diff | claude -p "Review for security"
bashid=$(claude -p "Start task" --output-format json | jq -r '.session_id') claude -p "Continue" --resume "$id"
bashclaude -p "Long task" \ --output-format stream-json \ --include-partial-messages | while read -r line; do echo "$line" | jq '.type' done
| Shortcut | Action | |----------|--------| | Ctrl+C | Cancel current | | Ctrl+D | Exit | | Ctrl+R | Reverse search history | | Esc Esc | Rewind changes | | Shift+Tab | Toggle permission mode |
| Prefix | Action | |--------|--------| | / | Slash command | | ! | Bash mode | | # | Add to memory | | @ | File mention |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-20 | pass→pass | 8,174 | 7,454 | -9% | 1 | 1 | 0% | 1,657 | 3,610 | +118% | 0 | 0 | — |
case-01 | fail→pass | 30,456 | 15,296 | -50% | 1 | 1 | 0% | 1,273 | 3,717 | +192% | 0 | 0 | — |
case-02 | fail→pass | 27,957 | 5,314 | -81% | 1 | 1 | 0% | 1,845 | 3,150 | +71% | 0 | 0 | — |
case-03 | pass→pass | 10,685 | 5,239 | -51% | 1 | 1 | 0% | 1,835 | 3,152 | +72% | 0 | 0 | — |
case-04 | pass→pass | 11,579 | 3,905 | -66% | 1 | 1 | 0% | 1,812 | 2,708 | +49% | 0 | 0 | — |
case-05 | fail→pass | 5,945 | 2,254 | -62% | 1 | 1 | 0% | 1,082 | 2,549 | +136% | 0 | 0 | — |
case-06 | fail→pass | 12,858 | 3,464 | -73% | 1 | 1 | 0% | 2,316 | 2,685 | +16% | 0 | 0 | — |
case-07 | pass→pass | 5,034 | 3,573 | -29% | 1 | 1 | 0% | 727 | 2,418 | +233% | 0 | 0 | — |
case-08 | fail→pass | 13,938 | 6,829 | -51% | 1 | 1 | 0% | 2,303 | 2,956 | +28% | 0 | 0 | — |
case-09 | fail→pass | 15,483 | 3,542 | -77% | 1 | 1 | 0% | 2,752 | 2,816 | +2% | 0 | 0 | — |
case-10 | fail→pass | 14,068 | 4,771 | -66% | 1 | 1 | 0% | 2,278 | 2,952 | +30% | 0 | 0 | — |
case-11 | pass→pass | 14,878 | 2,481 | -83% | 1 | 1 | 0% | 2,642 | 2,471 | -6% | 0 | 0 | — |
case-12 | fail→pass | 8,718 | 1,903 | -78% | 1 | 1 | 0% | 1,469 | 2,411 | +64% | 0 | 0 | — |
case-13 | pass→pass | 3,196 | 1,595 | -50% | 1 | 1 | 0% | 526 | 2,418 | +360% | 0 | 0 | — |
case-14 | fail→pass | 11,092 | 2,756 | -75% | 1 | 1 | 0% | 1,728 | 2,460 | +42% | 0 | 0 | — |
case-15 | pass→pass | 3,845 | 2,326 | -40% | 1 | 1 | 0% | 642 | 2,352 | +266% | 0 | 0 | — |
case-16 | fail→pass | 10,683 | 2,939 | -72% | 1 | 1 | 0% | 1,494 | 2,525 | +69% | 0 | 0 | — |
case-17 | pass→pass | 9,143 | 1,454 | -84% | 1 | 1 | 0% | 1,425 | 2,421 | +70% | 0 | 0 | — |
case-18 | pass→pass | 7,092 | 3,338 | -53% | 1 | 1 | 0% | 1,184 | 2,699 | +128% | 0 | 0 | — |
case-19 | fail→pass | 9,911 | 3,760 | -62% | 1 | 1 | 0% | 1,627 | 2,692 | +65% | 0 | 0 | — |
case-21 | pass→pass | 11,930 | 8,417 | -29% | 1 | 1 | 0% | 2,068 | 3,705 | +79% | 0 | 0 | — |
case-22 | fail→pass | 7,333 | 6,632 | -10% | 1 | 1 | 0% | 1,472 | 3,340 | +127% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 20 counted toward the lift figure. The other 2 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +55 percentage points is the difference between those two pass rates over the 20 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 8/2/2026 | +35% |
| gemini-3.6-flash | verified | 7/28/2026 | +48% |
Other measured skills in the registry, with their headline benchmark lift.