Overview
Claude Code CLI is Anthropic’s AI-powered coding assistant that can read files, run commands, search the web, edit code, and more. PraisonAI integrates with Claude CLI to use it as an external agent.Installation
Authentication
Set your Anthropic API key:Basic Usage with PraisonAI
CLI Options Reference
Print Mode (Non-Interactive)
| Option | Description |
|---|---|
-p, --print | Print response and exit (useful for pipes/scripts) |
--output-format <format> | Output format: text (default), json, or stream-json |
--include-partial-messages | Include partial message chunks (with stream-json) |
--input-format <format> | Input format: text (default) or stream-json |
Model Selection
| Option | Description |
|---|---|
--model <model> | Model alias (sonnet, opus) or full name (claude-sonnet-4-5-20250929) |
--fallback-model <model> | Fallback model when default is overloaded |
System Prompts
| Option | Description |
|---|---|
--system-prompt <prompt> | Custom system prompt for the session |
--append-system-prompt <prompt> | Append to default system prompt (recommended) |
Tool Control
| Option | Description |
|---|---|
--allowedTools <tools> | Comma-separated list of allowed tools (e.g., Bash,Edit,Read) |
--disallowedTools <tools> | Comma-separated list of denied tools |
--tools <tools> | Specify available tools: "" (none), default (all), or specific names |
Permission Modes
| Option | Description |
|---|---|
--permission-mode <mode> | Permission mode for the session |
--dangerously-skip-permissions | Bypass all permission checks (use with caution) |
default- Standard permission behavioracceptEdits- Auto-accept file editsbypassPermissions- Bypass all permission checksplan- Planning mode (no execution)delegate- Delegate decisionsdontAsk- Don’t ask for permissions
Session Management
| Option | Description |
|---|---|
-c, --continue | Continue the most recent conversation |
-r, --resume [value] | Resume by session ID or open picker |
--fork-session | Create new session ID when resuming |
--no-session-persistence | Disable session persistence |
--session-id <uuid> | Use specific session ID |
Budget & Limits
| Option | Description |
|---|---|
--max-budget-usd <amount> | Maximum dollar amount for API calls |
MCP Integration
| Option | Description |
|---|---|
--mcp-config <configs> | Load MCP servers from JSON files |
--strict-mcp-config | Only use MCP servers from --mcp-config |
Additional Options
| Option | Description |
|---|---|
--add-dir <directories> | Additional directories for tool access |
--verbose | Override verbose mode setting |
--debug | Enable debug mode |
--json-schema <schema> | JSON Schema for structured output validation |
--agents <json> | JSON object defining custom agents |
--settings <file-or-json> | Path to settings JSON file |
Commands
| Command | Description |
|---|---|
claude mcp | Configure and manage MCP servers |
claude plugin | Manage Claude Code plugins |
claude setup-token | Set up authentication token |
claude doctor | Check auto-updater health |
claude update | Check for and install updates |
claude install [target] | Install native build |
Examples
Basic Query
With Tool Restrictions
With Custom System Prompt
JSON Output
Continue Session
Python Integration
Environment Variables
| Variable | Description |
|---|---|
ANTHROPIC_API_KEY | Anthropic API key |
CLAUDE_API_KEY | Alternative API key variable |
Built-in Tools
Claude Code includes these built-in tools:| Tool | Description |
|---|---|
Read | Read any file in the working directory |
Write | Create new files |
Edit | Make precise edits to existing files |
Bash | Run terminal commands, scripts, git operations |
Glob | Find files by pattern |
Grep | Search file contents with regex |
WebSearch | Search the web for information |
WebFetch | Fetch and parse web page content |

