Quick Reference: Claude CLI ​
Updated: 2026-05-26
Core Commands ​
| Command | Description |
|---|---|
claude | Start interactive session |
claude "prompt" | Run a one-shot prompt |
claude -p | Pipe input from stdin |
claude --model MODEL | Specify model |
claude --max-tokens N | Set max output tokens |
claude --system "text" | Set system prompt |
Tool Commands ​
| Command | Description |
|---|---|
claude tools | List available tools |
claude skills | List installed skills |
claude skill install NAME | Install a skill |
claude mcp | Manage MCP tunnel connections |
Common Patterns ​
bash
# One-shot prompt
claude "Summarize this file" < file.txt
# Interactive with tools
claude --tools
# Specify model
claude --model claude-sonnet-4-6 "Explain the code"
# Pipe input
cat error.log | claude "Diagnose this error"
# With system prompt
claude --system "You are a security auditor" "Review this config"Gotchas ​
| Issue | Fix |
|---|---|
| Tools not available | Add --tools flag |
| Token limit hit | Increase --max-tokens |
| Slow responses | Try Haiku model for speed |
| Auth error | Run claude login or set ANTHROPIC_API_KEY |